From eb412bab15abd31956e89e98db7552756c3ebb14 Mon Sep 17 00:00:00 2001 From: Joe Lanford Date: Thu, 22 Feb 2024 05:08:00 -0500 Subject: [PATCH] remove ExtensionInterface and related functions/implementations (#644) Signed-off-by: Joe Lanford --- api/v1alpha1/clusterextension_types.go | 15 --------- api/v1alpha1/extension_types.go | 9 ------ internal/internal.go | 44 -------------------------- 3 files changed, 68 deletions(-) delete mode 100644 internal/internal.go diff --git a/api/v1alpha1/clusterextension_types.go b/api/v1alpha1/clusterextension_types.go index bb49e5f0d..b763cb60a 100644 --- a/api/v1alpha1/clusterextension_types.go +++ b/api/v1alpha1/clusterextension_types.go @@ -18,7 +18,6 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" "github.com/operator-framework/operator-controller/internal/conditionsets" ) @@ -159,17 +158,3 @@ type ClusterExtensionList struct { func init() { SchemeBuilder.Register(&ClusterExtension{}, &ClusterExtensionList{}) } - -func (r *ClusterExtension) GetPackageSpec() *ExtensionSourcePackage { - p := &ExtensionSourcePackage{} - - p.Channel = r.Spec.Channel - p.Name = r.Spec.PackageName - p.Version = r.Spec.Version - - return p -} - -func (r *ClusterExtension) GetUID() types.UID { - return r.ObjectMeta.GetUID() -} diff --git a/api/v1alpha1/extension_types.go b/api/v1alpha1/extension_types.go index f679031e2..74b0b79ca 100644 --- a/api/v1alpha1/extension_types.go +++ b/api/v1alpha1/extension_types.go @@ -18,7 +18,6 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" ) type ExtensionManagedState string @@ -125,11 +124,3 @@ type ExtensionList struct { func init() { SchemeBuilder.Register(&Extension{}, &ExtensionList{}) } - -func (r *Extension) GetPackageSpec() *ExtensionSourcePackage { - return r.Spec.Source.Package.DeepCopy() -} - -func (r *Extension) GetUID() types.UID { - return r.ObjectMeta.GetUID() -} diff --git a/internal/internal.go b/internal/internal.go deleted file mode 100644 index d8475ec30..000000000 --- a/internal/internal.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright 2024. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package internal - -import ( - "k8s.io/apimachinery/pkg/types" - - ocv1alpha1 "github.com/operator-framework/operator-controller/api/v1alpha1" -) - -type ExtensionInterface interface { - GetPackageSpec() *ocv1alpha1.ExtensionSourcePackage - GetUID() types.UID -} - -func ExtensionArrayToInterface(in []ocv1alpha1.Extension) []ExtensionInterface { - ei := make([]ExtensionInterface, len(in)) - for i := range in { - ei[i] = &in[i] - } - return ei -} - -func ClusterExtensionArrayToInterface(in []ocv1alpha1.ClusterExtension) []ExtensionInterface { - ei := make([]ExtensionInterface, len(in)) - for i := range in { - ei[i] = &in[i] - } - return ei -}