When deploying to a k8s environment such as Kubernetes or minikube, the operator produces an error when the given CR field DevfileRegistry.spec.k8s.ingress.domain is unset. There should be something stopping this from happening.
To Reproduce:
Start minikube
Run make install-cert and wait until cert-manager is ready
Run make install && make deploy and wait until registry-operator-system is ready
Run the follow command to attempt a deployment without DevfileRegistry.spec.k8s.ingress.domain set:
Should either refuse to deploy without this field set (for k8s clusters) or should deploy without creating an ingress resource and log why its skipping this resource.
Any logs, error output, screenshots etc? Provide the devfile that sees this bug, if applicable
2024-04-12T15:37:32Z ERROR Reconciler error {"controller": "devfileregistry", "controllerGroup": "registry.devfile.io",
"controllerKind": "DevfileRegistry", "DevfileRegistry": {"name":"test-registry","namespace":"dr"}, "namespace": "dr", "name":
"test-registry", "reconcileID": "0868b66d-16d7-48b0-90cc-380a4ed351dc", "error": "Ingress.extensions \"test-registry-devfile-
registry\" is invalid: spec.rules[0].host: Invalid value: \"test-registry-devfile-registry-dr.\": a lowercase RFC 1123 subdomain must
consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g.
'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')"}
Additional context
Any workaround?
Add webhook validation to refuse the deployment without DevfileRegistry.spec.k8s.ingress.domain.
Suggestion on how to fix the bug
Add control logic to skip the generation of the ingress resource if DevfileRegistry.spec.k8s.ingress.domain unset, additionally provide logging to explain why the ingress generation was skipped.
Which area this feature is related to?
/kind bug
Which area this bug is related to?
/area registry
What versions of software are you using?
Go project
Operating System and version: Fedora 39
Go Pkg Version: 1.19
Bug Summary
Describe the bug:
When deploying to a k8s environment such as Kubernetes or minikube, the operator produces an error when the given CR field
DevfileRegistry.spec.k8s.ingress.domain
is unset. There should be something stopping this from happening.To Reproduce:
minikube
make install-cert
and wait untilcert-manager
is readymake install && make deploy
and wait untilregistry-operator-system
is readyDevfileRegistry.spec.k8s.ingress.domain
set:Expected behavior
Should either refuse to deploy without this field set (for k8s clusters) or should deploy without creating an ingress resource and log why its skipping this resource.
Any logs, error output, screenshots etc? Provide the devfile that sees this bug, if applicable
Additional context
Any workaround?
Add webhook validation to refuse the deployment without
DevfileRegistry.spec.k8s.ingress.domain
.Suggestion on how to fix the bug
Add control logic to skip the generation of the ingress resource if
DevfileRegistry.spec.k8s.ingress.domain
unset, additionally provide logging to explain why the ingress generation was skipped.