From dae4a8b86ad1c45355ed4cedd73f56d138588369 Mon Sep 17 00:00:00 2001 From: "Victor M." Date: Wed, 25 Sep 2024 13:12:04 +0200 Subject: [PATCH 1/3] feat: remove '/preview' --- Makefile | 6 +++--- controllers/reconcile.go | 12 ------------ tests/e2e/basic-frontend/02-assert.yaml | 4 +--- tests/e2e/bundles/02-assert.yaml | 2 -- tests/e2e/cachebust/02-assert.yaml | 6 ------ tests/e2e/cachebust/04-assert.yaml | 6 ------ tests/e2e/frontend-paths/02-assert.yaml | 7 ------- tests/e2e/generate-nav-json/02-assert.yaml | 3 --- tests/e2e/networking/02-assert.yaml | 7 ------- tests/e2e/ssl/02-assert.yaml | 2 -- tests/e2e/storage/02-assert.yaml | 2 -- tests/e2e/whitelist/02-assert.yaml | 2 -- 12 files changed, 4 insertions(+), 55 deletions(-) diff --git a/Makefile b/Makefile index 14ba42ba..42111dbc 100644 --- a/Makefile +++ b/Makefile @@ -6,10 +6,10 @@ VERSION ?= 0.0.1 # CHANNELS define the bundle channels used in the bundle. -# Add a new line here if you would like to change its default config. (E.g CHANNELS = "preview,fast,stable") +# Add a new line here if you would like to change its default config. (E.g CHANNELS = "fast,stable") # To re-generate a bundle for other specific channels without changing the standard setup, you can: -# - use the CHANNELS as arg of the bundle target (e.g make bundle CHANNELS=preview,fast,stable) -# - use environment variables to overwrite this value (e.g export CHANNELS="preview,fast,stable") +# - use the CHANNELS as arg of the bundle target (e.g make bundle CHANNELS=fast,stable) +# - use environment variables to overwrite this value (e.g export CHANNELS="fast,stable") ifneq ($(origin CHANNELS), undefined) BUNDLE_CHANNELS := --channels=$(CHANNELS) endif diff --git a/controllers/reconcile.go b/controllers/reconcile.go index 965dbf41..0cc6eca3 100644 --- a/controllers/reconcile.go +++ b/controllers/reconcile.go @@ -106,16 +106,10 @@ func populateContainerVolumeMounts(frontendEnvironment *crd.FrontendEnvironment) // This will allow chrome to incorperate the generated nav and fed-modules.json // at run time. This means chrome can merge the config in mixed environments - // We need to have the config mounted in 2 places because of the preview/stable - // split. We need to have the config mounted in the preview and stable directories volumeMounts = append(volumeMounts, v1.VolumeMount{ Name: "config", MountPath: "/opt/app-root/src/build/stable/operator-generated", }) - volumeMounts = append(volumeMounts, v1.VolumeMount{ - Name: "config", - MountPath: "/opt/app-root/src/build/preview/operator-generated", - }) // We generate SSL cert mounts conditionally if frontendEnvironment.Spec.SSL { @@ -684,12 +678,10 @@ func (r *FrontendReconciliation) getFrontendPaths() []string { frontendPaths := r.Frontend.Spec.Frontend.Paths defaultPath := fmt.Sprintf("/apps/%s", r.Frontend.Name) defaultBetaPath := fmt.Sprintf("/beta/apps/%s", r.Frontend.Name) - defaultPreviewPath := fmt.Sprintf("/preview/apps/%s", r.Frontend.Name) if r.Frontend.Spec.AssetsPrefix != "" { defaultPath = fmt.Sprintf("/%s/%s", r.Frontend.Spec.AssetsPrefix, r.Frontend.Name) defaultBetaPath = fmt.Sprintf("/beta/%s/%s", r.Frontend.Spec.AssetsPrefix, r.Frontend.Name) - defaultPreviewPath = fmt.Sprintf("/preview/%s/%s", r.Frontend.Spec.AssetsPrefix, r.Frontend.Name) } if !r.Frontend.Spec.Frontend.HasPath(defaultPath) { @@ -700,10 +692,6 @@ func (r *FrontendReconciliation) getFrontendPaths() []string { frontendPaths = append(frontendPaths, defaultBetaPath) } - if !r.Frontend.Spec.Frontend.HasPath(defaultPreviewPath) { - frontendPaths = append(frontendPaths, defaultPreviewPath) - } - return frontendPaths } diff --git a/tests/e2e/basic-frontend/02-assert.yaml b/tests/e2e/basic-frontend/02-assert.yaml index e25c5e85..7fde3128 100644 --- a/tests/e2e/basic-frontend/02-assert.yaml +++ b/tests/e2e/basic-frontend/02-assert.yaml @@ -33,6 +33,4 @@ spec: protocol: TCP volumeMounts: - name: config - mountPath: /opt/app-root/src/build/stable/operator-generated - - name: config - mountPath: /opt/app-root/src/build/preview/operator-generated + mountPath: /opt/app-root/src/build/stable/operator-generated \ No newline at end of file diff --git a/tests/e2e/bundles/02-assert.yaml b/tests/e2e/bundles/02-assert.yaml index e8a28c84..ce250ff5 100644 --- a/tests/e2e/bundles/02-assert.yaml +++ b/tests/e2e/bundles/02-assert.yaml @@ -36,8 +36,6 @@ spec: mountPath: /opt/app-root/src/build/chrome - name: config mountPath: /opt/app-root/src/build/stable/operator-generated - - name: config - mountPath: /opt/app-root/src/build/preview/operator-generated --- apiVersion: cloud.redhat.com/v1alpha1 kind: Bundle diff --git a/tests/e2e/cachebust/02-assert.yaml b/tests/e2e/cachebust/02-assert.yaml index 2e85c388..bb3e8d1d 100644 --- a/tests/e2e/cachebust/02-assert.yaml +++ b/tests/e2e/cachebust/02-assert.yaml @@ -37,8 +37,6 @@ spec: volumeMounts: - name: config mountPath: /opt/app-root/src/build/stable/operator-generated - - name: config - mountPath: /opt/app-root/src/build/preview/operator-generated terminationMessagePath: /dev/termination-log terminationMessagePolicy: File imagePullPolicy: IfNotPresent @@ -118,8 +116,6 @@ spec: volumeMounts: - name: config mountPath: /opt/app-root/src/build/stable/operator-generated - - name: config - mountPath: /opt/app-root/src/build/preview/operator-generated terminationMessagePath: /dev/termination-log terminationMessagePolicy: File imagePullPolicy: IfNotPresent @@ -200,5 +196,3 @@ spec: volumeMounts: - name: config mountPath: /opt/app-root/src/build/stable/operator-generated - - name: config - mountPath: /opt/app-root/src/build/preview/operator-generated diff --git a/tests/e2e/cachebust/04-assert.yaml b/tests/e2e/cachebust/04-assert.yaml index b992c0b3..203770a0 100644 --- a/tests/e2e/cachebust/04-assert.yaml +++ b/tests/e2e/cachebust/04-assert.yaml @@ -37,8 +37,6 @@ spec: volumeMounts: - name: config mountPath: /opt/app-root/src/build/stable/operator-generated - - name: config - mountPath: /opt/app-root/src/build/preview/operator-generated terminationMessagePath: /dev/termination-log terminationMessagePolicy: File imagePullPolicy: IfNotPresent @@ -118,8 +116,6 @@ spec: volumeMounts: - name: config mountPath: /opt/app-root/src/build/stable/operator-generated - - name: config - mountPath: /opt/app-root/src/build/preview/operator-generated terminationMessagePath: /dev/termination-log terminationMessagePolicy: File imagePullPolicy: IfNotPresent @@ -200,5 +196,3 @@ spec: volumeMounts: - name: config mountPath: /opt/app-root/src/build/stable/operator-generated - - name: config - mountPath: /opt/app-root/src/build/preview/operator-generated diff --git a/tests/e2e/frontend-paths/02-assert.yaml b/tests/e2e/frontend-paths/02-assert.yaml index d755beaf..c6e3fbc2 100644 --- a/tests/e2e/frontend-paths/02-assert.yaml +++ b/tests/e2e/frontend-paths/02-assert.yaml @@ -40,11 +40,4 @@ spec: name: chrome port: number: 8000 - - path: /preview/apps/chrome - pathType: Prefix - backend: - service: - name: chrome - port: - number: 8000 diff --git a/tests/e2e/generate-nav-json/02-assert.yaml b/tests/e2e/generate-nav-json/02-assert.yaml index a347fec4..f82e43e7 100644 --- a/tests/e2e/generate-nav-json/02-assert.yaml +++ b/tests/e2e/generate-nav-json/02-assert.yaml @@ -36,6 +36,3 @@ spec: mountPath: /opt/app-root/src/build/chrome - name: config mountPath: /opt/app-root/src/build/stable/operator-generated - - name: config - mountPath: /opt/app-root/src/build/preview/operator-generated - diff --git a/tests/e2e/networking/02-assert.yaml b/tests/e2e/networking/02-assert.yaml index daba07ba..2b7a575d 100644 --- a/tests/e2e/networking/02-assert.yaml +++ b/tests/e2e/networking/02-assert.yaml @@ -39,13 +39,6 @@ spec: name: chrome port: number: 8000 - - path: /preview/apps/chrome - pathType: Prefix - backend: - service: - name: chrome - port: - number: 8000 --- kind: Service apiVersion: v1 diff --git a/tests/e2e/ssl/02-assert.yaml b/tests/e2e/ssl/02-assert.yaml index 5504e539..06100fd0 100644 --- a/tests/e2e/ssl/02-assert.yaml +++ b/tests/e2e/ssl/02-assert.yaml @@ -43,7 +43,5 @@ spec: volumeMounts: - name: config mountPath: /opt/app-root/src/build/stable/operator-generated - - name: config - mountPath: /opt/app-root/src/build/preview/operator-generated - name: certs mountPath: /opt/certs diff --git a/tests/e2e/storage/02-assert.yaml b/tests/e2e/storage/02-assert.yaml index 9098531b..fbea6f6f 100644 --- a/tests/e2e/storage/02-assert.yaml +++ b/tests/e2e/storage/02-assert.yaml @@ -34,8 +34,6 @@ spec: volumeMounts: - mountPath: /opt/app-root/src/build/stable/operator-generated name: config - - mountPath: /opt/app-root/src/build/preview/operator-generated - name: config securityContext: {} terminationGracePeriodSeconds: 30 volumes: diff --git a/tests/e2e/whitelist/02-assert.yaml b/tests/e2e/whitelist/02-assert.yaml index 6c2ade30..f9b0617f 100644 --- a/tests/e2e/whitelist/02-assert.yaml +++ b/tests/e2e/whitelist/02-assert.yaml @@ -34,8 +34,6 @@ spec: volumeMounts: - name: config mountPath: /opt/app-root/src/build/stable/operator-generated - - name: config - mountPath: /opt/app-root/src/build/preview/operator-generated --- kind: Ingress apiVersion: networking.k8s.io/v1 From 8ba53455d7ece21162ce6ba39f100dc7432c556c Mon Sep 17 00:00:00 2001 From: "Victor M." Date: Wed, 25 Sep 2024 15:24:53 +0200 Subject: [PATCH 2/3] rollback changes not related to actual "preview" FE environment --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 42111dbc..14ba42ba 100644 --- a/Makefile +++ b/Makefile @@ -6,10 +6,10 @@ VERSION ?= 0.0.1 # CHANNELS define the bundle channels used in the bundle. -# Add a new line here if you would like to change its default config. (E.g CHANNELS = "fast,stable") +# Add a new line here if you would like to change its default config. (E.g CHANNELS = "preview,fast,stable") # To re-generate a bundle for other specific channels without changing the standard setup, you can: -# - use the CHANNELS as arg of the bundle target (e.g make bundle CHANNELS=fast,stable) -# - use environment variables to overwrite this value (e.g export CHANNELS="fast,stable") +# - use the CHANNELS as arg of the bundle target (e.g make bundle CHANNELS=preview,fast,stable) +# - use environment variables to overwrite this value (e.g export CHANNELS="preview,fast,stable") ifneq ($(origin CHANNELS), undefined) BUNDLE_CHANNELS := --channels=$(CHANNELS) endif From 5848572328c66a1571b98b55fd472e9f864d6d0a Mon Sep 17 00:00:00 2001 From: "Victor M." Date: Wed, 25 Sep 2024 15:29:06 +0200 Subject: [PATCH 3/3] feat: remove '/beta' path references --- controllers/reconcile.go | 6 ------ tests/e2e/frontend-paths/02-assert.yaml | 8 -------- tests/e2e/networking/02-assert.yaml | 7 ------- 3 files changed, 21 deletions(-) diff --git a/controllers/reconcile.go b/controllers/reconcile.go index 0cc6eca3..20bd51c3 100644 --- a/controllers/reconcile.go +++ b/controllers/reconcile.go @@ -677,21 +677,15 @@ func (r *FrontendReconciliation) createAnnotationsAndPopulate(nn types.Namespace func (r *FrontendReconciliation) getFrontendPaths() []string { frontendPaths := r.Frontend.Spec.Frontend.Paths defaultPath := fmt.Sprintf("/apps/%s", r.Frontend.Name) - defaultBetaPath := fmt.Sprintf("/beta/apps/%s", r.Frontend.Name) if r.Frontend.Spec.AssetsPrefix != "" { defaultPath = fmt.Sprintf("/%s/%s", r.Frontend.Spec.AssetsPrefix, r.Frontend.Name) - defaultBetaPath = fmt.Sprintf("/beta/%s/%s", r.Frontend.Spec.AssetsPrefix, r.Frontend.Name) } if !r.Frontend.Spec.Frontend.HasPath(defaultPath) { frontendPaths = append(frontendPaths, defaultPath) } - if !r.Frontend.Spec.Frontend.HasPath(defaultBetaPath) { - frontendPaths = append(frontendPaths, defaultBetaPath) - } - return frontendPaths } diff --git a/tests/e2e/frontend-paths/02-assert.yaml b/tests/e2e/frontend-paths/02-assert.yaml index c6e3fbc2..08086eb4 100644 --- a/tests/e2e/frontend-paths/02-assert.yaml +++ b/tests/e2e/frontend-paths/02-assert.yaml @@ -33,11 +33,3 @@ spec: name: chrome port: number: 8000 - - path: /beta/apps/chrome - pathType: Prefix - backend: - service: - name: chrome - port: - number: 8000 - diff --git a/tests/e2e/networking/02-assert.yaml b/tests/e2e/networking/02-assert.yaml index 2b7a575d..7bd11505 100644 --- a/tests/e2e/networking/02-assert.yaml +++ b/tests/e2e/networking/02-assert.yaml @@ -32,13 +32,6 @@ spec: name: chrome port: number: 8000 - - path: /beta/apps/chrome - pathType: Prefix - backend: - service: - name: chrome - port: - number: 8000 --- kind: Service apiVersion: v1