Skip to content

Commit

Permalink
pkg/upgrade: remove watson-studio dashboard application (red-hat-data…
Browse files Browse the repository at this point in the history
…-services#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
ykaliuta authored and zdtsw committed Apr 23, 2024
1 parent 6b99c03 commit ffd8563
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit ffd8563

Please sign in to comment.