anax
anax copied to clipboard
Bug: kube_operator/client.go should support newer operator-sdk scheme
Describe the bug.
Submit an operator.tar.gz to set up a edge cluster service. It fails at kube_operator/client.go Line 377 with this error:
I0701 04:19:59.785906 105 kubeworker.go:142] Kubernetes Worker: begin install of Kube Deployment ff2ebcb2789dda95d489cf68d7df78728e2c6053efd37dcf0f53bd405c96ecb9
E0701 04:19:59.808601 105 kubeworker.go:95] Kubernetes Worker: failed to process kube package after agreement negotiation: Kubernetes Worker: Error: kubernetes object not in recognized scheme.
https://github.com/open-horizon/anax/blame/master/kube_operator/client.go#L377
The getK8sObjectFromYaml function is choking on some part of the scheme that I'm passing it. Possibly we need to add v1alpha1 to the parsable schemes?
// This is required to allow the schema to recognize custom resource definition types
_ = v1beta1scheme.AddToScheme(sch)
My operator uses operators.coreos.com/v1alpha1 scheme.
$ grep apiVersion deploy/operator.yaml
apiVersion: operators.coreos.com/v1alpha1
apiVersion: v1
apiVersion: operators.coreos.com/v1alpha1
apiVersion: operators.coreos.com/v1
apiVersion: operators.coreos.com/v1alpha1
apiVersion: v1
apiVersion: apps/v1
See the docs: https://docs.openshift.com/container-platform/4.8/rest_api/operatorhub_apis/clusterserviceversion-operators-coreos-com-v1alpha1.html
Describe the steps to reproduce the behavior.
No response
Expected behavior.
No response
Screenshots.
No response
Operating Environment
Linux
Additional Information
No response
I provided @MaxMcAdam with an operator.tar.gz that uses the operators.coreos.com/v1alpha1 scheme (which I think was generated from an operator-sdk 1.4 build)
kind: Subscription is one of the features used in recent operators (included in my example operator.tar.gz).
https://docs.openshift.com/container-platform/4.8/rest_api/operatorhub_apis/subscription-operators-coreos-com-v1alpha1.html
Additional operator framework / OLM links:
- https://sdk.operatorframework.io/docs/installation/
- https://sdk.operatorframework.io/docs/upgrading-sdk-version/v1.4.0/
- https://sdk.operatorframework.io/docs/olm-integration/cli-overview/
- https://sdk.operatorframework.io/docs/olm-integration/tutorial-bundle/
ClusterServiceVersion scheme used by newer operators:
- https://docs.openshift.com/container-platform/4.8/rest_api/operatorhub_apis/clusterserviceversion-operators-coreos-com-v1alpha1.html
Also note, issue #3445 when solving this issue. They may or may not be related. Both need to be solved one way or another.
@MaxMcAdam Does https://github.com/open-horizon/anax/commit/a37e9539602117e8654593cc785c6dcdea3d5527 solve this Operator SDK requirement?
We have another use case that requires operator-sdk v1.x schema support.
Cannot close this issue yet. Still need a bug fixed from the operator-framework group
@linggao Will the approach be directly supporting the operator 1.x generated skeleton files OR restructuring the files into 0.x format and then working with existing edge cluster operator deployment techniques?
@SanjeevKGupta the agent supports deploying a 1.x operator, just not one deployed with the olm mechanism