From 2153f12b084d8aef6d84e491aa0f8707344873ba Mon Sep 17 00:00:00 2001 From: Vaishnavi Hire Date: Mon, 11 Mar 2024 18:59:50 -0400 Subject: [PATCH] Fix cleanup of ODHApplications --- pkg/upgrade/upgrade.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/upgrade/upgrade.go b/pkg/upgrade/upgrade.go index 0962b997ff3..2675fa29c37 100644 --- a/pkg/upgrade/upgrade.go +++ b/pkg/upgrade/upgrade.go @@ -383,7 +383,7 @@ func CleanupExistingResource(ctx context.Context, cli client.Client, platform de JupyterhubApp := schema.GroupVersionKind{ Group: "dashboard.opendatahub.io", Version: "v1", - Kind: "odhapplications", + Kind: "OdhApplication", } multiErr = multierror.Append(multiErr, removOdhApplicationsCR(ctx, cli, JupyterhubApp, "jupyterhub", dscApplicationsNamespace)) return multiErr.ErrorOrNil() @@ -541,7 +541,7 @@ func deleteDeprecatedServiceMonitors(ctx context.Context, cli client.Client, nam func removOdhApplicationsCR(ctx context.Context, cli client.Client, gvk schema.GroupVersionKind, instanceName string, applicationNS string) error { // first check if CRD in cluster crd := &apiextv1.CustomResourceDefinition{} - if err := cli.Get(ctx, client.ObjectKey{Name: fmt.Sprintf("%s.%s", gvk.Kind, gvk.Group)}, crd); err != nil { + if err := cli.Get(ctx, client.ObjectKey{Name: "odhapplications.dashboard.opendatahub.io"}, crd); err != nil { return client.IgnoreNotFound(err) }