@@ -19,14 +19,14 @@ package autodiscover
1919import (
2020 "context"
2121 "fmt"
22- "time"
2322
2423 helmclient "github.com/mittwald/go-helm-client"
2524 olmv1Alpha "github.com/operator-framework/api/pkg/operators/v1alpha1"
2625 clientOlm "github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/clientset/versioned"
2726 "github.com/redhat-best-practices-for-k8s/certsuite/internal/log"
2827 "github.com/redhat-best-practices-for-k8s/certsuite/pkg/configuration"
2928
29+ olmpkgv1 "github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apis/operators/v1"
3030 "github.com/redhat-best-practices-for-k8s/certsuite/pkg/stringhelper"
3131 "helm.sh/helm/v3/pkg/release"
3232 "k8s.io/apimachinery/pkg/api/errors"
@@ -44,34 +44,6 @@ const (
4444 istioDeploymentName = "istiod"
4545)
4646
47- type PackageManifest struct {
48- APIVersion string `json:"apiVersion"`
49- Kind string `json:"kind"`
50- Metadata struct {
51- CreationTimestamp time.Time `json:"creationTimestamp"`
52- Labels map [string ]string `json:"labels"`
53- Name string `json:"name"`
54- Namespace string `json:"namespace"`
55- } `json:"metadata"`
56- Spec struct {
57- } `json:"spec"`
58- Status struct {
59- CatalogSource string `json:"catalogSource"`
60- CatalogSourceDisplayName string `json:"catalogSourceDisplayName"`
61- CatalogSourceNamespace string `json:"catalogSourceNamespace"`
62- CatalogSourcePublisher string `json:"catalogSourcePublisher"`
63- Channels []struct {
64- CurrentCSV string `json:"currentCSV"`
65- Name string `json:"name"`
66- } `json:"channels"`
67- DefaultChannel string `json:"defaultChannel"`
68- PackageName string `json:"packageName"`
69- Provider struct {
70- Name string `json:"name"`
71- } `json:"provider"`
72- } `json:"status"`
73- }
74-
7547func isIstioServiceMeshInstalled (appClient appv1client.AppsV1Interface , allNs []string ) bool {
7648 // The Istio namespace must be present
7749 if ! stringhelper .StringInSlice (allNs , istioNamespace , false ) {
@@ -237,7 +209,7 @@ func getAllCatalogSources(olmClient clientOlm.Interface) (out []*olmv1Alpha.Cata
237209}
238210
239211// getAllPackageManifests is a helper function to get the all the PackageManifests in a cluster.
240- func getAllPackageManifests (dynamicClient dynamic.Interface ) (out []* PackageManifest ) {
212+ func getAllPackageManifests (dynamicClient dynamic.Interface ) (out []* olmpkgv1. PackageManifest ) {
241213 gvr := schema.GroupVersionResource {
242214 Group : "packages.operators.coreos.com" ,
243215 Version : "v1" ,
@@ -250,7 +222,7 @@ func getAllPackageManifests(dynamicClient dynamic.Interface) (out []*PackageMani
250222 return out
251223 }
252224 for _ , item := range pkgManifest .Items {
253- var manifest PackageManifest
225+ var manifest olmpkgv1. PackageManifest
254226 if err := runtime .DefaultUnstructuredConverter .FromUnstructured (item .Object , & manifest ); err != nil {
255227 log .Error ("Failed to convert to PackageManifestWithNs: %v" , err )
256228 }
0 commit comments