Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkg/upgrade: remove watson-studio dashboard application (#959)
* pkg/upgrade: abstract resource deletion with Unstructured For the coming requirement to remove resources not just by their names but a field inside of spec, abstract the existing deleteDeprecatedResources/deleteDeprecatedServiceMonitors to take a resource to delete description as ``` type ResourceSpec struct { Gvk schema.GroupVersionKind Namespace string Path []string Values []string } ``` TODO: This patch just adds new functionality without changing the existing calls of deleteDeprecatedResources and deleteDeprecatedServiceMonitors yet. The function fetches UnstructuredList by gvk/namespace and uses public unstructured.NestedString() to access the field by path. It should work for ServiceMonitor, where ServiceMonitorList contains list of the pointers, as well. Ignore NoKindMatchError. CRD may not exist on fresh installation for example. Make a wrapper which takes an array of them for convenience and avoid one indentation level and simplifies multierror wrapping a bit. It requires to have a library of GroupVersionKinds which is a future work to make common for the whole project. Signed-off-by: Yauheni Kaliuta <[email protected]> * pkg/gvk: add package to store GroupVersionKind objects schema.GroupVersionKind objects are used around the code, introduce a common global place for it. Add Odh GVKs to be used in the next patch. Signed-off-by: Yauheni Kaliuta <[email protected]> * pkg/upgrade: remove watson-studio dashboard application Jira: https://issues.redhat.com/browse/RHOAIENG-4764 Remove deprecated dashboard resources. Reuse existing infra just make the array of resources in a separate function to avoid growing of CleanupExistingResource(). Signed-off-by: Yauheni Kaliuta <[email protected]> --------- Signed-off-by: Yauheni Kaliuta <[email protected]>
- Loading branch information