Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Registry operator errors out if ingress domain is not set #1520

Closed
michael-valdron opened this issue Apr 12, 2024 · 0 comments · Fixed by devfile/registry-operator#89
Closed
Assignees
Labels
area/registry Devfile registry for stacks and infrastructure kind/bug Something isn't working

Comments

@michael-valdron
Copy link
Member

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:

  1. Start minikube
  2. Run make install-cert and wait until cert-manager is ready
  3. Run make install && make deploy and wait until registry-operator-system is ready
  4. Run the follow command to attempt a deployment without DevfileRegistry.spec.k8s.ingress.domain set:
cat <<EOF | kubectl apply -f -
apiVersion: registry.devfile.io/v1alpha1
kind: DevfileRegistry
metadata:
  name: devfile-registry
spec:
  devfileIndex:
    image: quay.io/devfile/devfile-index:next
  telemetry:
    registryName: test
EOF

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/registry Devfile registry for stacks and infrastructure kind/bug Something isn't working
Projects
Status: Done ✅
Development

Successfully merging a pull request may close this issue.

2 participants