-
Notifications
You must be signed in to change notification settings - Fork 41
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
GVK differ reports incorrectly with multiple groups of same kind #531
Comments
As we work this be careful to keep in mind that it's not always true that the same Kind between 2 groups represents one being deprecated, as is with deployment and groups of {extensions, apps}. There are other cases where same Kind name is reused in 2 different Groups that do not intend to represent the same thing, example with KNative and 'Route' being under 2 different/incompatible groups. `$ oc api-resources|grep route routes route.openshift.io true Route routes rt serving.knative.dev true Route |
+1, thanks @jwmatthews for pointing this out. I think the answer is not as simple as filter the |
Based on discussion with @djwhatle and pain points shared by @jwmatthews the new proposed solution is as follows:
The above steps will make sure Note 1: Long term, this code should be shared and we should work upstream to refactor this as exported functions to be imported and used by us in mig-controller. Note 2: Need to explore the co-habitating API specific to OpenShift like References:
|
When multiple groups of the same kind are present and one of
the group is getting deprecated at the destination cluster, the
GVK diff complains about deprecated but Valero uses the other
group's preferred kind group-version to migrate successfully.
Example: let's assume the source has two group of
deployment
as follows:
and
Assume the destination has deprecated
extensions
group sothe GVK at the destination is:
Problem
The GVK differ will correctly identify that
extensions/v1beta1
deploymentsis deprecated and incompatible. But because of the way Kube reads/writes
works the resource deployments will automatically be shifted to the preferred
group version of destination. Hence extensions workloads will be migrated as
apps workloads in the above example.
However, the controller checks through the list of incompatible GVK calculated
by the differ and checks if an object[1] of any of the incompatible gvk's exist
in the cluster and report the GVK if the resource exists. This creates a problem,
as
extensions
workloads are identified from the source cluster.Hence the problem is for kinds with multiple groups if at least one group
exists at the destination, the kind will be able to migrate and the controller
should remove all the incompatible GVKs with this kind
Solution
The controller should only complain if, an incompatible GVK exists for a kind with
no other group version available to migrate.
I propose adding a method here[2], to filter the list of incompatible GVKs which
do not have a compatible group kind alternative available for Valero to migrate.
This filtered list will be the correct reflection of GVK's which cannot be migrated,
as required
The text was updated successfully, but these errors were encountered: