redhat-cop / cert-utils-operator

Set of functionalities around certificates packaged in a Kubernetes operator
Apache License 2.0
94 stars 35 forks source link

[WIP] use correct Service name in ServiceMonitor kustomization #139

Closed davgordo closed 1 year ago

davgordo commented 2 years ago

The following kustomization file references a Service with a generic name (controller-manager-metrics-service). https://github.com/redhat-cop/cert-utils-operator/blob/f471876d07cd35a27cc8e0b176c5ef5afa52727f/config/default/kustomization.yaml#L48-L59

This doesn't work because we need to use unique names for the Service definitions in case multiple operators are installed in the same namespace.

Because of the Service name mismatch, the defaults are always used which causes problems if the operator is installed to an unconventional namespace.

This PR simply corrects the service name so the correct values are used in the resulting ServiceMonitor

davgordo commented 2 years ago

fixes #138

raffaelespazzoli commented 2 years ago

looks good to me. does the helm chart get built correctly? Can we make sure this config looks like the other operators?

davgordo commented 2 years ago

looks good to me. does the helm chart get built correctly? Can we make sure this config looks like the other operators?

Unfortunately, it breaks the Helm side.

Error: Service "cert-utils-operator-cert-utils-operator-controller-manager-metrics-service" is invalid: metadata.name: Invalid value: "cert-utils-operator-cert-utils-operator-controller-manager-metrics-service": must be no more than 63 characters

I'm not understanding how that happens yet. But I will step away and come back in hopes that it becomes more obvious.