@@ -7,16 +7,15 @@ import (
77 "os"
88 "path/filepath"
99 "strings"
10+ "time"
11+
12+ operatorv1alpha1 "github.com/operator-framework/operator-controller/api/v1alpha1"
1013
1114 . "github.com/onsi/ginkgo/v2"
1215 . "github.com/onsi/gomega"
13- catalogd "github.com/operator-framework/catalogd/pkg/apis/core/v1beta1"
14- operatorv1alpha1 "github.com/operator-framework/operator-controller/api/v1alpha1"
15- rukpakv1alpha1 "github.com/operator-framework/rukpak/api/v1alpha1"
1616 "gopkg.in/yaml.v2"
1717 appsv1 "k8s.io/api/apps/v1"
1818 corev1 "k8s.io/api/core/v1"
19- v1 "k8s.io/api/core/v1"
2019 "k8s.io/apimachinery/pkg/api/errors"
2120 apimeta "k8s.io/apimachinery/pkg/api/meta"
2221 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -28,13 +27,13 @@ import (
2827
2928 catalogd "github.com/operator-framework/catalogd/api/core/v1alpha1"
3029 rukpakv1alpha1 "github.com/operator-framework/rukpak/api/v1alpha1"
30+ )
3131
3232const (
33- defaultTimeout = 30 * time .Second
34- defaultPoll = 1 * time .Second
35- testCatalogRef = "localhost/testdata/catalogs/test-catalog:e2e"
36- testCatalogName = "test-catalog"
37- artifactName = "operator-controller-e2e"
33+ defaultTimeout = 30 * time .Second
34+ defaultPoll = 1 * time .Second
35+ testCatalogRef = "localhost/testdata/catalogs/test-catalog:e2e"
36+ artifactName = "operator-controller-e2e"
3837)
3938
4039var _ = Describe ("Operator Install" , func () {
@@ -285,7 +284,7 @@ func getArtifactsOutput(ctx context.Context, basePath string) {
285284 GinkgoWriter .Printf ("Failed to marshal operator %w" , err )
286285 continue
287286 }
288- if err := os .WriteFile (filepath .Join (artifactPath , operator .Name + "-operator.yaml" ), operatorYaml , 0644 ); err != nil {
287+ if err := os .WriteFile (filepath .Join (artifactPath , operator .Name + "-operator.yaml" ), operatorYaml , 0600 ); err != nil {
289288 GinkgoWriter .Printf ("Failed to write operator to file %w" , err )
290289 }
291290 }
@@ -302,7 +301,7 @@ func getArtifactsOutput(ctx context.Context, basePath string) {
302301 GinkgoWriter .Printf ("Failed to marshal catalogsource %w" , err )
303302 continue
304303 }
305- if err := os .WriteFile (filepath .Join (artifactPath , catalogsource .Name + "-catalogsource.yaml" ), catalogsourceYaml , 0644 ); err != nil {
304+ if err := os .WriteFile (filepath .Join (artifactPath , catalogsource .Name + "-catalogsource.yaml" ), catalogsourceYaml , 0600 ); err != nil {
306305 GinkgoWriter .Printf ("Failed to write catalogsource to file %w" , err )
307306 }
308307 }
@@ -319,7 +318,7 @@ func getArtifactsOutput(ctx context.Context, basePath string) {
319318 GinkgoWriter .Printf ("Failed to marshal bundle %w" , err )
320319 continue
321320 }
322- if err := os .WriteFile (filepath .Join (artifactPath , bundle .Name + "-bundle.yaml" ), bundleYaml , 0644 ); err != nil {
321+ if err := os .WriteFile (filepath .Join (artifactPath , bundle .Name + "-bundle.yaml" ), bundleYaml , 0600 ); err != nil {
323322 GinkgoWriter .Printf ("Failed to write bundle to file %w" , err )
324323 }
325324 }
@@ -336,7 +335,7 @@ func getArtifactsOutput(ctx context.Context, basePath string) {
336335 GinkgoWriter .Printf ("Failed to marshal bundleDeployment %w" , err )
337336 continue
338337 }
339- if err := os .WriteFile (filepath .Join (artifactPath , bundleDeployment .Name + "-bundleDeployment.yaml" ), bundleDeploymentYaml , 0644 ); err != nil {
338+ if err := os .WriteFile (filepath .Join (artifactPath , bundleDeployment .Name + "-bundleDeployment.yaml" ), bundleDeploymentYaml , 0600 ); err != nil {
340339 GinkgoWriter .Printf ("Failed to write bundleDeployment to file %w" , err )
341340 }
342341 }
@@ -367,7 +366,7 @@ func getArtifactsOutput(ctx context.Context, basePath string) {
367366 GinkgoWriter .Printf ("Failed to marshal deployment %w" , err )
368367 continue
369368 }
370- if err := os .WriteFile (filepath .Join (namespacedArtifactPath , deployment .Name + "-deployment.yaml" ), deploymentYaml , 0644 ); err != nil {
369+ if err := os .WriteFile (filepath .Join (namespacedArtifactPath , deployment .Name + "-deployment.yaml" ), deploymentYaml , 0600 ); err != nil {
371370 GinkgoWriter .Printf ("Failed to write deployment to file %w" , err )
372371 }
373372 }
@@ -378,11 +377,11 @@ func getArtifactsOutput(ctx context.Context, basePath string) {
378377 GinkgoWriter .Printf ("Failed to list pods %w in namespace: %q" , err , namespace .Name )
379378 }
380379 for _ , pod := range pods .Items {
381- if pod .Status .Phase != v1 .PodRunning && pod .Status .Phase != v1 .PodSucceeded && pod .Status .Phase != v1 .PodFailed {
380+ if pod .Status .Phase != corev1 .PodRunning && pod .Status .Phase != corev1 .PodSucceeded && pod .Status .Phase != corev1 .PodFailed {
382381 continue
383382 }
384383 for _ , container := range pod .Spec .Containers {
385- logs , err := kubeClient .CoreV1 ().Pods (namespace .Name ).GetLogs (pod .Name , & v1 .PodLogOptions {Container : container .Name }).Stream (ctx )
384+ logs , err := kubeClient .CoreV1 ().Pods (namespace .Name ).GetLogs (pod .Name , & corev1 .PodLogOptions {Container : container .Name }).Stream (ctx )
386385 if err != nil {
387386 GinkgoWriter .Printf ("Failed to get logs for pod %q in namespace %q: %w" , pod .Name , namespace .Name , err )
388387 continue
0 commit comments