diff --git a/charts/all/.keep b/charts/all/.keep new file mode 100644 index 00000000..e69de29b diff --git a/charts/all/config-demo/Chart.yaml b/charts/all/config-demo/Chart.yaml deleted file mode 100644 index abe0f0bd..00000000 --- a/charts/all/config-demo/Chart.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: v2 -description: A Helm chart to build and deploy a use of remote configuration enabled by ACM and Vault -keywords: -- pattern -name: config-demo -version: 0.0.1 diff --git a/charts/all/config-demo/templates/config-demo-cm.yaml b/charts/all/config-demo/templates/config-demo-cm.yaml deleted file mode 100644 index ac7fe991..00000000 --- a/charts/all/config-demo/templates/config-demo-cm.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: config-demo-configmap - labels: - app.kubernetes.io/instance: config-demo -data: - "index.html": |- - - - - - Config Demo - - -

- Hub Cluster domain is '{{ .Values.global.hubClusterDomain }}'
- Pod is running on Local Cluster Domain '{{ .Values.global.localClusterDomain }}'
-

-

- The secret is secret -

- - diff --git a/charts/all/config-demo/templates/config-demo-deployment.yaml b/charts/all/config-demo/templates/config-demo-deployment.yaml deleted file mode 100644 index 9deee702..00000000 --- a/charts/all/config-demo/templates/config-demo-deployment.yaml +++ /dev/null @@ -1,65 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - application: config-demo - name: config-demo -spec: - replicas: 2 - revisionHistoryLimit: 3 - selector: - matchLabels: - deploymentconfig: config-demo - template: - metadata: - creationTimestamp: null - labels: - app: config-demo - deploymentconfig: config-demo - name: config-demo - spec: - containers: - - name: apache - image: registry.access.redhat.com/ubi8/httpd-24:1-226 - #imagePullPolicy: Always - ports: - - containerPort: 8080 - name: http - protocol: TCP - volumeMounts: - - mountPath: /var/www/html - name: config-demo-configmap - - mountPath: /var/www/html/secret - readOnly: true - name: config-demo-secret - resources: {} - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - livenessProbe: - httpGet: - path: /index.html - port: 8080 - scheme: HTTP - initialDelaySeconds: 5 - timeoutSeconds: 1 - periodSeconds: 10 - successThreshold: 1 - failureThreshold: 3 - readinessProbe: - httpGet: - path: /index.html - port: 8080 - scheme: HTTP - initialDelaySeconds: 5 - timeoutSeconds: 1 - periodSeconds: 10 - successThreshold: 1 - failureThreshold: 3 - volumes: - - name: config-demo-configmap - configMap: - defaultMode: 438 - name: config-demo-configmap - - name: config-demo-secret - secret: - secretName: config-demo-secret diff --git a/charts/all/config-demo/templates/config-demo-external-secret.yaml b/charts/all/config-demo/templates/config-demo-external-secret.yaml deleted file mode 100644 index 0081dd87..00000000 --- a/charts/all/config-demo/templates/config-demo-external-secret.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- -apiVersion: "external-secrets.io/v1beta1" -kind: ExternalSecret -metadata: - name: config-demo-secret - namespace: config-demo -spec: - refreshInterval: 15s - secretStoreRef: - name: {{ .Values.secretStore.name }} - kind: {{ .Values.secretStore.kind }} - target: - name: config-demo-secret - template: - type: Opaque - dataFrom: - - extract: - key: {{ .Values.configdemosecret.key }} diff --git a/charts/all/config-demo/templates/config-demo-is.yaml b/charts/all/config-demo/templates/config-demo-is.yaml deleted file mode 100644 index 6a1aea4e..00000000 --- a/charts/all/config-demo/templates/config-demo-is.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: image.openshift.io/v1 -kind: ImageStream -metadata: - name: config-demo -spec: - lookupPolicy: - local: true - tags: - - name: registry.access.redhat.com/ubi8/httpd-24 - importPolicy: {} - referencePolicy: - type: Local diff --git a/charts/all/config-demo/templates/config-demo-route.yaml b/charts/all/config-demo/templates/config-demo-route.yaml deleted file mode 100644 index 85d2e38e..00000000 --- a/charts/all/config-demo/templates/config-demo-route.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: route.openshift.io/v1 -kind: Route -metadata: - labels: - app: config-demo - name: config-demo -spec: - port: - targetPort: 8080-tcp - to: - kind: Service - name: config-demo - weight: 100 - wildcardPolicy: None diff --git a/charts/all/config-demo/templates/config-demo-svc.yaml b/charts/all/config-demo/templates/config-demo-svc.yaml deleted file mode 100644 index 517c1aad..00000000 --- a/charts/all/config-demo/templates/config-demo-svc.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - app: config-demo - name: config-demo -spec: - ports: - - name: 8080-tcp - port: 8080 - protocol: TCP - targetPort: 8080 - selector: - app: config-demo - deploymentconfig: config-demo - sessionAffinity: None - type: ClusterIP diff --git a/charts/all/config-demo/values.yaml b/charts/all/config-demo/values.yaml deleted file mode 100644 index 2dda4522..00000000 --- a/charts/all/config-demo/values.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- -secretStore: - name: vault-backend - kind: ClusterSecretStore - -configdemosecret: - key: secret/data/global/config-demo - -global: - hubClusterDomain: hub.example.com - localClusterDomain: region-one.example.com - -clusterGroup: - isHubCluster: true diff --git a/charts/all/hello-world/Chart.yaml b/charts/all/hello-world/Chart.yaml deleted file mode 100644 index 6c9611e3..00000000 --- a/charts/all/hello-world/Chart.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: v2 -description: A Helm chart to show a webserver and with no other dependencies -keywords: -- pattern -name: hello-world -version: 0.0.1 diff --git a/charts/all/hello-world/templates/hello-world-cm.yaml b/charts/all/hello-world/templates/hello-world-cm.yaml deleted file mode 100644 index e59561ca..00000000 --- a/charts/all/hello-world/templates/hello-world-cm.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: hello-world-configmap - labels: - app.kubernetes.io/instance: hello-world -data: - "index.html": |- - - - - - Hello World - - -

Hello World!

-
-

- Hub Cluster domain is '{{ .Values.global.hubClusterDomain }}'
- Pod is running on Local Cluster Domain '{{ .Values.global.localClusterDomain }}'
-

- - diff --git a/charts/all/hello-world/templates/hello-world-deployment.yaml b/charts/all/hello-world/templates/hello-world-deployment.yaml deleted file mode 100644 index 878ebf5f..00000000 --- a/charts/all/hello-world/templates/hello-world-deployment.yaml +++ /dev/null @@ -1,58 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - application: hello-world - name: hello-world -spec: - replicas: 1 - revisionHistoryLimit: 3 - selector: - matchLabels: - deploymentconfig: hello-world - template: - metadata: - labels: - app: hello-world - deploymentconfig: hello-world - name: hello-world - spec: - containers: - - name: apache - image: registry.access.redhat.com/ubi8/httpd-24:1-226 - #imagePullPolicy: Always - ports: - - containerPort: 8080 - name: http - protocol: TCP - volumeMounts: - - mountPath: /var/www/html - name: hello-world-configmap - resources: {} - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - livenessProbe: - httpGet: - path: /index.html - port: 8080 - scheme: HTTP - initialDelaySeconds: 5 - timeoutSeconds: 1 - periodSeconds: 10 - successThreshold: 1 - failureThreshold: 3 - readinessProbe: - httpGet: - path: /index.html - port: 8080 - scheme: HTTP - initialDelaySeconds: 5 - timeoutSeconds: 1 - periodSeconds: 10 - successThreshold: 1 - failureThreshold: 3 - volumes: - - name: hello-world-configmap - configMap: - defaultMode: 438 - name: hello-world-configmap diff --git a/charts/all/hello-world/templates/hello-world-route.yaml b/charts/all/hello-world/templates/hello-world-route.yaml deleted file mode 100644 index e321f9e4..00000000 --- a/charts/all/hello-world/templates/hello-world-route.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: route.openshift.io/v1 -kind: Route -metadata: - labels: - app: hello-world - name: hello-world -spec: - port: - targetPort: 8080-tcp - to: - kind: Service - name: hello-world - weight: 100 - wildcardPolicy: None diff --git a/charts/all/hello-world/templates/hello-world-svc.yaml b/charts/all/hello-world/templates/hello-world-svc.yaml deleted file mode 100644 index 597f6d54..00000000 --- a/charts/all/hello-world/templates/hello-world-svc.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - app: hello-world - name: hello-world -spec: - ports: - - name: 8080-tcp - port: 8080 - protocol: TCP - targetPort: 8080 - selector: - app: hello-world - deploymentconfig: hello-world - sessionAffinity: None - type: ClusterIP diff --git a/charts/all/hello-world/values.yaml b/charts/all/hello-world/values.yaml deleted file mode 100644 index 55083f74..00000000 --- a/charts/all/hello-world/values.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -global: - hubClusterDomain: hub.example.com - localCluster: local.example.com diff --git a/tests/interop/run_tests.sh b/tests/interop/run_tests.sh index a1af3b4b..de518bc8 100755 --- a/tests/interop/run_tests.sh +++ b/tests/interop/run_tests.sh @@ -1,7 +1,7 @@ #!/usr/bin/bash export EXTERNAL_TEST="true" -export PATTERN_NAME="MultiCloudGitops" +export PATTERN_NAME="LayeredZeroTrust" export PATTERN_SHORTNAME="mcgitops" if [ -z "${KUBECONFIG}" ]; then @@ -25,12 +25,6 @@ fi pytest -lv --disable-warnings test_subscription_status_hub.py --kubeconfig $KUBECONFIG --junit-xml $WORKSPACE/test_subscription_status_hub.xml -pytest -lv --disable-warnings test_subscription_status_edge.py --kubeconfig $KUBECONFIG_EDGE --junit-xml $WORKSPACE/test_subscription_status_edge.xml - pytest -lv --disable-warnings test_validate_hub_site_components.py --kubeconfig $KUBECONFIG --junit-xml $WORKSPACE/test_validate_hub_site_components.xml -pytest -lv --disable-warnings test_validate_edge_site_components.py --kubeconfig $KUBECONFIG_EDGE --junit-xml $WORKSPACE/test_validate_edge_site_components.xml - -pytest -lv --disable-warnings test_modify_web_content.py --kubeconfig $KUBECONFIG --junit-xml $WORKSPACE/test_modify_web_content.xml - python3 create_ci_badge.py diff --git a/tests/interop/test_modify_web_content.py b/tests/interop/test_modify_web_content.py deleted file mode 100644 index cbfb0b8f..00000000 --- a/tests/interop/test_modify_web_content.py +++ /dev/null @@ -1,89 +0,0 @@ -import logging -import os -import re -import subprocess -import time - -import pytest -import requests -from ocp_resources.route import Route -from openshift.dynamic.exceptions import NotFoundError -from validatedpatterns_tests.interop.edge_util import modify_file_content - -from . import __loggername__ - -logger = logging.getLogger(__loggername__) - - -@pytest.mark.modify_web_content -def test_modify_web_content(openshift_dyn_client): - logger.info("Find the url for the hello-world route") - try: - for route in Route.get( - dyn_client=openshift_dyn_client, - namespace="hello-world", - name="hello-world", - ): - logger.info(route.instance.spec.host) - except NotFoundError: - err_msg = "hello-world url/route is missing in hello-world namespace" - logger.error(f"FAIL: {err_msg}") - assert False, err_msg - - url = "http://" + route.instance.spec.host - response = requests.get(url) - logger.info(f"Current page content: {response.content}") - - if os.getenv("EXTERNAL_TEST") != "true": - chart = ( - f"{os.environ['HOME']}" - + "/validated_patterns/layered-zero-trust/charts/" - + "all/hello-world/templates/hello-world-cm.yaml" - ) - else: - chart = "../../charts/all/hello-world/templates/hello-world-cm.yaml" - - logger.info("Modify the file content") - orig_heading = "

Hello World!

" - new_heading = "

Validated Patterns QE was here!

" - modify_file_content( - file_name=chart, orig_content=orig_heading, new_content=new_heading - ) - - logger.info("Merge the change") - patterns_repo = f"{os.environ['HOME']}/validated_patterns/layered-zero-trust" - if os.getenv("EXTERNAL_TEST") != "true": - subprocess.run(["git", "add", chart], cwd=f"{patterns_repo}") - subprocess.run( - ["git", "commit", "-m", "Updating 'hello-world'"], cwd=f"{patterns_repo}" - ) - push = subprocess.run( - ["git", "push"], cwd=f"{patterns_repo}", capture_output=True, text=True - ) - else: - subprocess.run(["git", "add", chart]) - subprocess.run(["git", "commit", "-m", "Updating 'hello-world'"]) - push = subprocess.run(["git", "push"], capture_output=True, text=True) - logger.info(push.stdout) - logger.info(push.stderr) - - logger.info("Checking for updated page content") - timeout = time.time() + 60 * 10 - while time.time() < timeout: - time.sleep(30) - response = requests.get(url) - logger.info(response.content) - - new_content = re.search(new_heading, str(response.content)) - - logger.info(new_content) - if (new_content is None) or (new_content.group() != new_heading): - continue - break - - if (new_content is None) or (new_content.group() != new_heading): - err_msg = "Did not find updated page content" - logger.error(f"FAIL: {err_msg}") - assert False, err_msg - else: - logger.info("PASS: Found updated page content") diff --git a/values-group-one.yaml b/values-group-one.yaml index f17a726d..fb993bcc 100644 --- a/values-group-one.yaml +++ b/values-group-one.yaml @@ -7,15 +7,11 @@ clusterGroup: name: group-one isHubCluster: false namespaces: - - config-demo - - hello-world - golang-external-secrets # The only subscription on spokes is gitops which gets managed by ACM # subscriptions: projects: - eso - - config-demo - - hello-world applications: golang-external-secrets: name: golang-external-secrets @@ -23,16 +19,6 @@ clusterGroup: project: eso chart: golang-external-secrets chartVersion: 0.1.* - config-demo: - name: config-demo - namespace: config-demo - project: config-demo - path: charts/all/config-demo - hello-world: - name: hello-world - namespace: hello-world - project: hello-world - path: charts/all/hello-world imperative: # NOTE: We *must* use lists and not hashes. As hashes lose ordering once parsed by helm # The default schedule is every 10 minutes: imperative.schedule @@ -40,13 +26,7 @@ clusterGroup: # imagePullPolicy is set to always: imperative.imagePullPolicy # For additional overrides that apply to the jobs, please refer to # https://hybrid-cloud-patterns.io/imperative-actions/#additional-job-customizations - jobs: - - name: hello-world - # ansible playbook to be run - playbook: rhvp.cluster_utils.hello_world - # per playbook timeout in seconds - timeout: 234 - # verbosity: "-v" + jobs: [] # Explicitly mention the cluster-state based overrides we plan to use for this pattern. # We can use self-referential variables because the chart calls the tpl function with these variables defined sharedValueFiles: diff --git a/values-hub.yaml b/values-hub.yaml index 08500929..b37ff435 100644 --- a/values-hub.yaml +++ b/values-hub.yaml @@ -5,8 +5,6 @@ clusterGroup: - open-cluster-management - vault - golang-external-secrets - - config-demo - - hello-world subscriptions: acm: name: advanced-cluster-management @@ -15,8 +13,6 @@ clusterGroup: #csv: advanced-cluster-management.v2.6.1 projects: - hub - - config-demo - - hello-world # Explicitly mention the cluster-state based overrides we plan to use for this pattern. # We can use self-referential variables because the chart calls the tpl function with these variables defined sharedValueFiles: @@ -61,16 +57,6 @@ clusterGroup: project: hub chart: golang-external-secrets chartVersion: 0.1.* - config-demo: - name: config-demo - namespace: config-demo - project: config-demo - path: charts/all/config-demo - hello-world: - name: hello-world - namespace: hello-world - project: hello-world - path: charts/all/hello-world imperative: # NOTE: We *must* use lists and not hashes. As hashes lose ordering once parsed by helm # The default schedule is every 10 minutes: imperative.schedule @@ -78,13 +64,7 @@ clusterGroup: # imagePullPolicy is set to always: imperative.imagePullPolicy # For additional overrides that apply to the jobs, please refer to # https://hybrid-cloud-patterns.io/imperative-actions/#additional-job-customizations - jobs: - - name: hello-world - # ansible playbook to be run - playbook: rhvp.cluster_utils.hello_world - # per playbook timeout in seconds - timeout: 234 - # verbosity: "-v" + jobs: [] managedClusterGroups: exampleRegion: name: group-one diff --git a/values-standalone.yaml b/values-standalone.yaml index 41744ed6..f1fafd32 100644 --- a/values-standalone.yaml +++ b/values-standalone.yaml @@ -4,13 +4,9 @@ clusterGroup: namespaces: - vault - golang-external-secrets - - config-demo - - hello-world subscriptions: {} projects: - hub - - config-demo - - hello-world # Explicitly mention the cluster-state based overrides we plan to use for this pattern. # We can use self-referential variables because the chart calls the tpl function with these variables defined sharedValueFiles: @@ -35,16 +31,6 @@ clusterGroup: project: hub chart: golang-external-secrets chartVersion: 0.1.* - config-demo: - name: config-demo - namespace: config-demo - project: config-demo - path: charts/all/config-demo - hello-world: - name: hello-world - namespace: hello-world - project: hello-world - path: charts/all/hello-world imperative: # NOTE: We *must* use lists and not hashes. As hashes lose ordering once parsed by helm # The default schedule is every 10 minutes: imperative.schedule @@ -52,10 +38,4 @@ clusterGroup: # imagePullPolicy is set to always: imperative.imagePullPolicy # For additional overrides that apply to the jobs, please refer to # https://hybrid-cloud-patterns.io/imperative-actions/#additional-job-customizations - jobs: - - name: hello-world - # ansible playbook to be run - playbook: rhvp.cluster_utils.hello_world - # per playbook timeout in seconds - timeout: 234 - # verbosity: "-v" + jobs: []