Skip to content
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

pkg/upgrade: remove watson-studio dashboard application (#959) #241

Merged

Conversation

VaishnaviHire
Copy link

  • 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]
(cherry picked from commit 23280e7)

…io#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]>
(cherry picked from commit 23280e7)
@VaishnaviHire VaishnaviHire merged commit 1ca4aca into red-hat-data-services:main Apr 10, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants