Skip to content

Commit

Permalink
Merge pull request #23 from mhjacks/wip-main
Browse files Browse the repository at this point in the history
Fix tests for common and correct common's .gitignore
  • Loading branch information
mhjacks authored Jan 19, 2022
2 parents 29c420b + 06cd405 commit fe9d5e8
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 28 deletions.
2 changes: 1 addition & 1 deletion common/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
*.swp
*.swo
values-secret.yaml
.*-expected.yaml
.*.expected.yaml
pattern-vault.init
vault.init
2 changes: 1 addition & 1 deletion common/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ HUBCLUSTER_APPS_DOMAIN=$(shell oc get ingresses.config/cluster -o jsonpath={.spe

# --set values always take precedence over the contents of -f
HELM_OPTS=-f values-global.yaml -f $(SECRETS) --set main.git.repoURL="$(TARGET_REPO)" --set main.git.revision=$(TARGET_BRANCH) --set main.options.bootstrap=$(BOOTSTRAP) --set global.hubClusterDomain=$(HUBCLUSTER_APPS_DOMAIN)
TEST_OPTS= -f common/examples/values-secret.yaml -f values-global.yaml --set global.repoURL="https://github.com/pattern-clone/mypattern" --set main.git.repoURL="https://github.com/pattern-clone/mypattern" --set main.git.revision=main --set main.options.bootstrap=$(BOOTSTRAP) --set global.valuesDirectoryURL="https://github.com/pattern-clone/mypattern/raw/main" --set global.pattern="mypattern" --set global.namespace="pattern-namespace"
TEST_OPTS= -f common/examples/values-secret.yaml -f values-global.yaml --set global.repoURL="https://github.com/pattern-clone/mypattern" --set main.git.repoURL="https://github.com/pattern-clone/mypattern" --set main.git.revision=main --set main.options.bootstrap=$(BOOTSTRAP) --set global.valuesDirectoryURL="https://github.com/pattern-clone/mypattern/raw/main" --set global.pattern="mypattern" --set global.namespace="pattern-namespace" --set global.hubClusterDomain=hub.example.com --set global.localClusterDomain=region.example.com
PATTERN_OPTS=-f common/examples/values-example.yaml

# Makefiles that use this target must provide:
Expand Down
4 changes: 4 additions & 0 deletions common/tests/acm-normal.expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ spec:
value: mypattern
- name: global.valuesDirectoryURL
value: https://github.com/pattern-clone/mypattern/raw/main
- name: global.hubClusterDomain
value: hub.example.com
- name: global.localClusterDomain
value: '{{ (lookup "config.openshift.io/v1" "Ingress" "" "cluster").spec.domain }}'
- name: clusterGroup.isHubCluster
value: "false"
destination:
Expand Down
2 changes: 2 additions & 0 deletions common/tests/clustergroup-naked.expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ spec:
--set global.targetRevision=$ARGOCD_APP_SOURCE_TARGET_REVISION
--set global.namespace=$ARGOCD_APP_NAMESPACE
--set global.pattern=common
--set global.hubClusterDomain=
--set global.valuesDirectoryURL=https://github.com/pattern-clone/common/raw/main
--post-renderer ./kustomize\"]
\ \n"
Expand All @@ -100,6 +101,7 @@ spec:
cpu: 500m
memory: 2Gi
dex:
openShiftOAuth: true
resources:
limits:
cpu: 500m
Expand Down
36 changes: 10 additions & 26 deletions common/tests/clustergroup-normal.expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ spec:
value: mypattern
- name: global.valuesDirectoryURL
value: https://github.com/pattern-clone/mypattern/raw/main
- name: global.hubClusterDomain
value: hub.example.com
- name: global.localClusterDomain
value: region.example.com
ignoreDifferences: [
{
"group": "internal.open-cluster-management.io",
Expand Down Expand Up @@ -168,6 +172,10 @@ spec:
value: mypattern
- name: global.valuesDirectoryURL
value: https://github.com/pattern-clone/mypattern/raw/main
- name: global.hubClusterDomain
value: hub.example.com
- name: global.localClusterDomain
value: region.example.com
syncPolicy:
automated: {}
# selfHeal: true
Expand Down Expand Up @@ -199,6 +207,7 @@ spec:
--set global.targetRevision=$ARGOCD_APP_SOURCE_TARGET_REVISION
--set global.namespace=$ARGOCD_APP_NAMESPACE
--set global.pattern=mypattern
--set global.hubClusterDomain=hub.example.com
--set global.valuesDirectoryURL=https://github.com/pattern-clone/mypattern/raw/main
--post-renderer ./kustomize\"]
\ \n"
Expand All @@ -220,6 +229,7 @@ spec:
cpu: 500m
memory: 2Gi
dex:
openShiftOAuth: true
resources:
limits:
cpu: 500m
Expand Down Expand Up @@ -287,32 +297,6 @@ spec:
targetNamespaces:
- application-ci
---
# Source: pattern-clustergroup/templates/subsciptions.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: advanced-cluster-management
namespace: open-cluster-management
spec:
name: advanced-cluster-management
source: redhat-operators
sourceNamespace: openshift-marketplace
channel: release-2.3
installPlanApproval: Automatic
---
# Source: pattern-clustergroup/templates/subsciptions.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: openshift-pipelines-operator-rh
namespace: openshift-operators
spec:
name: openshift-pipelines-operator-rh
source: redhat-operators
sourceNamespace: openshift-marketplace
channel: stable
installPlanApproval: Automatic
---
# Source: pattern-clustergroup/templates/subscriptions.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
Expand Down
6 changes: 6 additions & 0 deletions common/tests/install-naked.expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ spec:
value: https://github.com/pattern-clone/mypattern/raw/main
- name: global.pattern
value: install
- name: global.hubClusterDomain
value:
syncPolicy:
automated: {}
---
Expand All @@ -55,3 +57,7 @@ spec:
name: openshift-gitops-operator
source: redhat-operators
sourceNamespace: openshift-marketplace
config:
env:
- name: ARGOCD_CLUSTER_CONFIG_NAMESPACES
value: install-default,openshift-gitops
6 changes: 6 additions & 0 deletions common/tests/install-normal.expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ spec:
value: https://github.com/pattern-clone/mypattern/raw/main
- name: global.pattern
value: install
- name: global.hubClusterDomain
value: hub.example.com
syncPolicy:
automated: {}
---
Expand All @@ -55,3 +57,7 @@ spec:
name: openshift-gitops-operator
source: redhat-operators
sourceNamespace: openshift-marketplace
config:
env:
- name: ARGOCD_CLUSTER_CONFIG_NAMESPACES
value: install-example,openshift-gitops

0 comments on commit fe9d5e8

Please sign in to comment.