Skip to content

Commit

Permalink
Fixed Suite Test
Browse files Browse the repository at this point in the history
Signed-off-by: Yuri Sa <[email protected]>
  • Loading branch information
yuriolisa committed Feb 27, 2024
1 parent 18c8385 commit 3e77e72
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
6 changes: 6 additions & 0 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
resources:
- manager.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: controller
newName: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator
newTag: 0.94.0
5 changes: 4 additions & 1 deletion controllers/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,10 @@ service:
Labels: map[string]string{
"app.kubernetes.io/instance": "test.test",
"app.kubernetes.io/managed-by": "opentelemetry-operator",
"app.kubernetes.io/name": "test-ingress",
"app.kubernetes.io/name": "test-collector",
"app.kubernetes.io/component": "opentelemetry-collector",
"app.kubernetes.io/part-of": "opentelemetry",
"app.kubernetes.io/version": "latest",
},
Annotations: map[string]string{
"something": "true",
Expand Down
9 changes: 4 additions & 5 deletions internal/manifests/collector/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@ import (
"github.com/open-telemetry/opentelemetry-operator/apis/v1beta1"
"github.com/open-telemetry/opentelemetry-operator/internal/manifests"
"github.com/open-telemetry/opentelemetry-operator/internal/manifests/collector/adapters"
"github.com/open-telemetry/opentelemetry-operator/internal/manifests/manifestutils"
"github.com/open-telemetry/opentelemetry-operator/internal/naming"
)

func Ingress(params manifests.Params) (*networkingv1.Ingress, error) {
name := naming.Collector(params.OtelCol.Name)
labels := manifestutils.Labels(params.OtelCol.ObjectMeta, name, params.OtelCol.Spec.Image, ComponentOpenTelemetryCollector, params.Config.LabelsFilter())
if params.OtelCol.Spec.Ingress.Type != v1beta1.IngressTypeNginx {
return nil, nil
}
Expand Down Expand Up @@ -58,11 +61,7 @@ func Ingress(params manifests.Params) (*networkingv1.Ingress, error) {
Name: naming.Ingress(params.OtelCol.Name),
Namespace: params.OtelCol.Namespace,
Annotations: params.OtelCol.Spec.Ingress.Annotations,
Labels: map[string]string{
"app.kubernetes.io/name": naming.Ingress(params.OtelCol.Name),
"app.kubernetes.io/instance": fmt.Sprintf("%s.%s", params.OtelCol.Namespace, params.OtelCol.Name),
"app.kubernetes.io/managed-by": "opentelemetry-operator",
},
Labels: labels,
},
Spec: networkingv1.IngressSpec{
TLS: params.OtelCol.Spec.Ingress.TLS,
Expand Down
3 changes: 3 additions & 0 deletions internal/manifests/collector/ingress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ func TestDesiredIngresses(t *testing.T) {
"app.kubernetes.io/name": naming.Ingress(params.OtelCol.Name),
"app.kubernetes.io/instance": fmt.Sprintf("%s.%s", params.OtelCol.Namespace, params.OtelCol.Name),
"app.kubernetes.io/managed-by": "opentelemetry-operator",
"app.kubernetes.io/component": "opentelemetry-collector",
"app.kubernetes.io/part-of": "opentelemetry",
"app.kubernetes.io/version": "latest",
},
},
Spec: networkingv1.IngressSpec{
Expand Down

0 comments on commit 3e77e72

Please sign in to comment.