operator-sdk icon indicating copy to clipboard operation
operator-sdk copied to clipboard

Add support for IngressClass CR

Open droopy4096 opened this issue 3 years ago • 4 comments

Summary

Whenever we add IngressClass CR manifet into our bundle/manifests directory we get an error:

$ operator-sdk bundle validate ./bundle
ERRO[0000] Error: Value networking.k8s.io/v1, Kind=IngressClass: unsupported media type registry+v1 for bundle object

Context

Required tools:

  • operator-sdk binary
  • opm binary
  • GNU make
  • yq
  • git binary
  • kustomize binary

Setup

git clone https://gitlab.com/gitlab-org/cloud-native/gitlab-operator.git
cd gitlab-operator
git checkout 281-list-in-operatorhub-io
make build_operator
make build_test_cr
( cd config/scorecard; kustomize build ) > .build/scorecard.yaml
yq eval . .build/openshift_resources.yaml .build/operator.yaml .build/test_cr.yaml .build/scorecard.yaml | operator-sdk generate bundle -q --overwrite --extra-service-accounts gitlab-manager,gitlab-nginx-ingress,gitlab-app --version 0.2.0 --default-channel=stable --channels=stable,unstable --package=gitlab-operator-kubernetes
yq eval '.metadata.name="gitlab-nginx"' /home/dmytro.makovey/work/gitlab-operator.281-list-in-operatorhub-io/config/rbac/nginx_ingressclass.yaml > bundle/manifests/gitlab-nginx-ingressclass.yaml
operator-sdk bundle validate ./bundle

Additional Notes

Whenever validation step is skipped, produced bundle also "crashes" in OLM as it refuses to instantiate Operator upon submission of Subscription with errors like:

{"level":"error","ts":1642021519.11281,"logger":"controllers.operatorcondition","msg":"Error ensuring OperatorCondition Deployment EnvVars","request":"gitlab-system/gitlab-operator-kubernetes.v0.2.0","error":"Deployment.apps \"gitlab-controller-manager\" not found","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/home/runner/work/operator-lifecycle-manager/operator-lifecycle-manager/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:311\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/home/runner/work/operator-lifecycle-manager/operator-lifecycle-manager/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:266\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\t/home/runner/work/operator-lifecycle-manager/operator-lifecycle-manager/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:227"}
{"level":"error","ts":1642021519.11285,"logger":"controller.operatorcondition","msg":"Reconciler error","reconciler group":"operators.coreos.com","reconciler kind":"OperatorCondition","name":"gitlab-operator-kubernetes.v0.2.0","namespace":"gitlab-system","error":"Deployment.apps \"gitlab-controller-manager\" not found","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\t/home/runner/work/operator-lifecycle-manager/operator-lifecycle-manager/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:227"}

droopy4096 avatar Jan 12 '22 22:01 droopy4096

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

openshift-bot avatar Apr 25 '22 00:04 openshift-bot

/remove-lifecycle stale

droopy4096 avatar Apr 25 '22 14:04 droopy4096

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

openshift-bot avatar Jul 24 '22 19:07 openshift-bot

/remove-lifecycle stale

droopy4096 avatar Jul 25 '22 20:07 droopy4096

There are no plans to support new types in the current registry+v1 format. There is a new project rukpak which supports a new plain+v0 bundle format that allows for arbitrary objects to be provisioned.

jmrodri avatar Nov 22 '22 05:11 jmrodri