Skip to content

Commit

Permalink
add headless label
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristina Pathak committed Nov 17, 2022
1 parent 78ccd93 commit ae29cb1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/collector/reconcile/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ import (
"github.com/open-telemetry/opentelemetry-operator/pkg/targetallocator"
)

// headless label is to differentiate the headless service from the clusterIP service.
const (
headlessLabel = "operator.opentelemetry.io/collector-headless-service"
headlessExists = "Exists"
)

// +kubebuilder:rbac:groups="",resources=services,verbs=get;list;watch;create;update;patch;delete

// Services reconciles the service(s) required for the instance in the current context.
Expand Down Expand Up @@ -154,6 +160,7 @@ func headless(ctx context.Context, params Params) *corev1.Service {
}

h.Name = naming.HeadlessService(params.Instance)
h.Labels[headlessLabel] = headlessExists

// copy to avoid modifying params.Instance.Annotations
annotations := map[string]string{
Expand Down

0 comments on commit ae29cb1

Please sign in to comment.