@@ -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 () {
@@ -240,7 +239,7 @@ func getArtifactsOutput(ctx context.Context, basePath string) {
240239 GinkgoWriter .Printf ("Failed to marshal operator %w" , err )
241240 continue
242241 }
243- if err := os .WriteFile (filepath .Join (artifactPath , operator .Name + "-operator.yaml" ), operatorYaml , 0644 ); err != nil {
242+ if err := os .WriteFile (filepath .Join (artifactPath , operator .Name + "-operator.yaml" ), operatorYaml , 0600 ); err != nil {
244243 GinkgoWriter .Printf ("Failed to write operator to file %w" , err )
245244 }
246245 }
@@ -257,7 +256,7 @@ func getArtifactsOutput(ctx context.Context, basePath string) {
257256 GinkgoWriter .Printf ("Failed to marshal catalogsource %w" , err )
258257 continue
259258 }
260- if err := os .WriteFile (filepath .Join (artifactPath , catalogsource .Name + "-catalogsource.yaml" ), catalogsourceYaml , 0644 ); err != nil {
259+ if err := os .WriteFile (filepath .Join (artifactPath , catalogsource .Name + "-catalogsource.yaml" ), catalogsourceYaml , 0600 ); err != nil {
261260 GinkgoWriter .Printf ("Failed to write catalogsource to file %w" , err )
262261 }
263262 }
@@ -274,7 +273,7 @@ func getArtifactsOutput(ctx context.Context, basePath string) {
274273 GinkgoWriter .Printf ("Failed to marshal bundle %w" , err )
275274 continue
276275 }
277- if err := os .WriteFile (filepath .Join (artifactPath , bundle .Name + "-bundle.yaml" ), bundleYaml , 0644 ); err != nil {
276+ if err := os .WriteFile (filepath .Join (artifactPath , bundle .Name + "-bundle.yaml" ), bundleYaml , 0600 ); err != nil {
278277 GinkgoWriter .Printf ("Failed to write bundle to file %w" , err )
279278 }
280279 }
@@ -291,7 +290,7 @@ func getArtifactsOutput(ctx context.Context, basePath string) {
291290 GinkgoWriter .Printf ("Failed to marshal bundleDeployment %w" , err )
292291 continue
293292 }
294- if err := os .WriteFile (filepath .Join (artifactPath , bundleDeployment .Name + "-bundleDeployment.yaml" ), bundleDeploymentYaml , 0644 ); err != nil {
293+ if err := os .WriteFile (filepath .Join (artifactPath , bundleDeployment .Name + "-bundleDeployment.yaml" ), bundleDeploymentYaml , 0600 ); err != nil {
295294 GinkgoWriter .Printf ("Failed to write bundleDeployment to file %w" , err )
296295 }
297296 }
@@ -322,7 +321,7 @@ func getArtifactsOutput(ctx context.Context, basePath string) {
322321 GinkgoWriter .Printf ("Failed to marshal deployment %w" , err )
323322 continue
324323 }
325- if err := os .WriteFile (filepath .Join (namespacedArtifactPath , deployment .Name + "-deployment.yaml" ), deploymentYaml , 0644 ); err != nil {
324+ if err := os .WriteFile (filepath .Join (namespacedArtifactPath , deployment .Name + "-deployment.yaml" ), deploymentYaml , 0600 ); err != nil {
326325 GinkgoWriter .Printf ("Failed to write deployment to file %w" , err )
327326 }
328327 }
@@ -333,11 +332,11 @@ func getArtifactsOutput(ctx context.Context, basePath string) {
333332 GinkgoWriter .Printf ("Failed to list pods %w in namespace: %q" , err , namespace .Name )
334333 }
335334 for _ , pod := range pods .Items {
336- if pod .Status .Phase != v1 .PodRunning && pod .Status .Phase != v1 .PodSucceeded && pod .Status .Phase != v1 .PodFailed {
335+ if pod .Status .Phase != corev1 .PodRunning && pod .Status .Phase != corev1 .PodSucceeded && pod .Status .Phase != corev1 .PodFailed {
337336 continue
338337 }
339338 for _ , container := range pod .Spec .Containers {
340- logs , err := kubeClient .CoreV1 ().Pods (namespace .Name ).GetLogs (pod .Name , & v1 .PodLogOptions {Container : container .Name }).Stream (ctx )
339+ logs , err := kubeClient .CoreV1 ().Pods (namespace .Name ).GetLogs (pod .Name , & corev1 .PodLogOptions {Container : container .Name }).Stream (ctx )
341340 if err != nil {
342341 GinkgoWriter .Printf ("Failed to get logs for pod %q in namespace %q: %w" , pod .Name , namespace .Name , err )
343342 continue
0 commit comments