In order to improve the user experience when incompatible SMI CRDs versions are installed (outdated or not yet supported), this PR introduce some changes on the prepare command.
In the past we use to start informers and start collecting the different SMI objects already present on the cluster. If SMI CRDs were not installed or an unsupported version was we would get the following errors many times:
E0824 17:40:01.430644 26974 reflector.go:178] pkg/mod/k8s.io/client-go@v0.18.6/tools/cache/reflector.go:125: Failed to list *v1alpha3.TrafficSplit: the server could not find the requested resource (get trafficsplits.split.smi-spec.io)
E0824 17:40:01.430644 26974 reflector.go:178] pkg/mod/k8s.io/client-go@v0.18.6/tools/cache/reflector.go:125: Failed to list *v1alpha3.TrafficSplit: the server could not find the requested resource (get trafficsplits.split.smi-spec.io)
E0824 17:40:01.430644 26974 reflector.go:178] pkg/mod/k8s.io/client-go@v0.18.6/tools/cache/reflector.go:125: Failed to list *v1alpha3.TrafficSplit: the server could not find the requested resource (get trafficsplits.split.smi-spec.io)
E0824 17:40:01.430644 26974 reflector.go:178] pkg/mod/k8s.io/client-go@v0.18.6/tools/cache/reflector.go:125: Failed to list *v1alpha3.TrafficSplit: the server could not find the requested resource (get trafficsplits.split.smi-spec.io)
E0824 17:40:01.430644 26974 reflector.go:178] pkg/mod/k8s.io/client-go@v0.18.6/tools/cache/reflector.go:125: Failed to list *v1alpha3.TrafficSplit: the server could not find the requested resource (get trafficsplits.split.smi-spec.io)
This PR introduce a simpler solution based on the Discovery API of the kubernetes sdk to discover which resource groups are installed and what are there versions.
Fixes #711
How to test it
Install Maesh with Helm using the --skip-crds flag: The controller should fail and you should see a message in the init container logs telling you that the SMI CRDs are missing.
Install Maesh normally: This should work fine
Create a cluster, install an old version of the SMI CRDs (e.g. specs v1alpha) and install Maesh using Helm with the --skip-crds you should see an error in the logs too.
What does this PR do?
In order to improve the user experience when incompatible SMI CRDs versions are installed (outdated or not yet supported), this PR introduce some changes on the prepare command.
In the past we use to start informers and start collecting the different SMI objects already present on the cluster. If SMI CRDs were not installed or an unsupported version was we would get the following errors many times:
This PR introduce a simpler solution based on the
Discovery
API of the kubernetes sdk to discover which resource groups are installed and what are there versions.Fixes #711
How to test it
--skip-crds
flag: The controller should fail and you should see a message in the init container logs telling you that the SMI CRDs are missing.--skip-crds
you should see an error in the logs too.