Skip to content
Merged
15 changes: 14 additions & 1 deletion common/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ show: ## show the starting template without installing it
helm template common/operator-install/ --name-template $(NAME) $(HELM_OPTS)

.PHONY: operator-deploy
operator-deploy operator-upgrade: validate-prereq validate-origin ## runs helm install
operator-deploy operator-upgrade: validate-prereq validate-origin validate-cluster ## runs helm install
@set -e -o pipefail
# Retry five times because the CRD might not be fully installed yet
for i in {1..5}; do \
Expand Down Expand Up @@ -90,6 +90,19 @@ validate-origin: ## verify the git origin is available
echo "Running inside a container: Skipping git ssh checks";\
fi

.PHONY: validate-cluster
validate-cluster: ## Do some cluster validations before installing
@echo "Checking cluster:"
@echo -n " cluster-info: "
@oc cluster-info >/dev/null && echo "OK" || (echo "Error"; exit 1)
@echo -n " storageclass: "
@if [ `oc get storageclass -o go-template='{{printf "%d\n" (len .items)}}'` -eq 0 ]; then\
echo "None Found"; exit 1;\
else\
echo "OK";\
fi


.PHONY: validate-schema
validate-schema: ## validates values files against schema in common/clustergroup
$(eval VAL_PARAMS := $(shell for i in ./values-*.yaml; do echo -n "$${i} "; done))
Expand Down
7 changes: 7 additions & 0 deletions common/ansible/roles/iib_ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ make load-iib
# This will install the pattern using the gitops operator from the IIB
```

***NOTE:*** When using an SNO without shared storage in a non-production environment, the enablement of the internal registry will fail. You need to run the following to enable it:

```sh
oc patch configs.imageregistry.operator.openshift.io cluster --type merge --patch '{"spec":{"managementState":"Managed"}}'
oc patch configs.imageregistry.operator.openshift.io cluster --type merge --patch '{"spec":{"storage":{"emptyDir":{}}}}'
```

Then in case of the `openshift-gitops-operator` we would install with:

```sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
oc registry info --public=true
register: registry_route_raw
retries: 20
delay: 10
delay: 20
until:
- registry_route_raw is not failed
- registry_route_raw.stdout | length > 0
Expand Down
37 changes: 19 additions & 18 deletions common/clustergroup/templates/plumbing/argocd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,27 @@ metadata:
spec:
# Adding health checks to argocd to prevent pvc resources
# that aren't bound state from blocking deployments
resourceCustomizations: |
PersistentVolumeClaim:
health.lua: |
hs = {}
if obj.status ~= nil then
if obj.status.phase ~= nil then
if obj.status.phase == "Pending" then
hs.status = "Healthy"
hs.message = obj.status.phase
return hs
elseif obj.status.phase == "Bound" then
hs.status = "Healthy"
hs.message = obj.status.phase
return hs
end
resourceHealthChecks:
- kind: PersistentVolumeClaim
check: |
hs = {}
if obj.status ~= nil then
if obj.status.phase ~= nil then
if obj.status.phase == "Pending" then
hs.status = "Healthy"
hs.message = obj.status.phase
return hs
elseif obj.status.phase == "Bound" then
hs.status = "Healthy"
hs.message = obj.status.phase
return hs
end
end
hs.status = "Progressing"
hs.message = "Waiting for PVC"
return hs
end
hs.status = "Progressing"
hs.message = "Waiting for PVC"
return hs

applicationInstanceLabelKey: argocd.argoproj.io/instance
# Not the greatest way to pass git/quay info to sub-applications, but it will do until
# we can support helmChart with kustomize
Expand Down
37 changes: 19 additions & 18 deletions common/tests/clustergroup-industrial-edge-factory.expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -452,26 +452,27 @@ metadata:
spec:
# Adding health checks to argocd to prevent pvc resources
# that aren't bound state from blocking deployments
resourceCustomizations: |
PersistentVolumeClaim:
health.lua: |
hs = {}
if obj.status ~= nil then
if obj.status.phase ~= nil then
if obj.status.phase == "Pending" then
hs.status = "Healthy"
hs.message = obj.status.phase
return hs
elseif obj.status.phase == "Bound" then
hs.status = "Healthy"
hs.message = obj.status.phase
return hs
end
resourceHealthChecks:
- kind: PersistentVolumeClaim
check: |
hs = {}
if obj.status ~= nil then
if obj.status.phase ~= nil then
if obj.status.phase == "Pending" then
hs.status = "Healthy"
hs.message = obj.status.phase
return hs
elseif obj.status.phase == "Bound" then
hs.status = "Healthy"
hs.message = obj.status.phase
return hs
end
end
hs.status = "Progressing"
hs.message = "Waiting for PVC"
return hs
end
hs.status = "Progressing"
hs.message = "Waiting for PVC"
return hs

applicationInstanceLabelKey: argocd.argoproj.io/instance
# Not the greatest way to pass git/quay info to sub-applications, but it will do until
# we can support helmChart with kustomize
Expand Down
37 changes: 19 additions & 18 deletions common/tests/clustergroup-industrial-edge-hub.expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1097,26 +1097,27 @@ metadata:
spec:
# Adding health checks to argocd to prevent pvc resources
# that aren't bound state from blocking deployments
resourceCustomizations: |
PersistentVolumeClaim:
health.lua: |
hs = {}
if obj.status ~= nil then
if obj.status.phase ~= nil then
if obj.status.phase == "Pending" then
hs.status = "Healthy"
hs.message = obj.status.phase
return hs
elseif obj.status.phase == "Bound" then
hs.status = "Healthy"
hs.message = obj.status.phase
return hs
end
resourceHealthChecks:
- kind: PersistentVolumeClaim
check: |
hs = {}
if obj.status ~= nil then
if obj.status.phase ~= nil then
if obj.status.phase == "Pending" then
hs.status = "Healthy"
hs.message = obj.status.phase
return hs
elseif obj.status.phase == "Bound" then
hs.status = "Healthy"
hs.message = obj.status.phase
return hs
end
end
hs.status = "Progressing"
hs.message = "Waiting for PVC"
return hs
end
hs.status = "Progressing"
hs.message = "Waiting for PVC"
return hs

applicationInstanceLabelKey: argocd.argoproj.io/instance
# Not the greatest way to pass git/quay info to sub-applications, but it will do until
# we can support helmChart with kustomize
Expand Down
37 changes: 19 additions & 18 deletions common/tests/clustergroup-medical-diagnosis-hub.expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1282,26 +1282,27 @@ metadata:
spec:
# Adding health checks to argocd to prevent pvc resources
# that aren't bound state from blocking deployments
resourceCustomizations: |
PersistentVolumeClaim:
health.lua: |
hs = {}
if obj.status ~= nil then
if obj.status.phase ~= nil then
if obj.status.phase == "Pending" then
hs.status = "Healthy"
hs.message = obj.status.phase
return hs
elseif obj.status.phase == "Bound" then
hs.status = "Healthy"
hs.message = obj.status.phase
return hs
end
resourceHealthChecks:
- kind: PersistentVolumeClaim
check: |
hs = {}
if obj.status ~= nil then
if obj.status.phase ~= nil then
if obj.status.phase == "Pending" then
hs.status = "Healthy"
hs.message = obj.status.phase
return hs
elseif obj.status.phase == "Bound" then
hs.status = "Healthy"
hs.message = obj.status.phase
return hs
end
end
hs.status = "Progressing"
hs.message = "Waiting for PVC"
return hs
end
hs.status = "Progressing"
hs.message = "Waiting for PVC"
return hs

applicationInstanceLabelKey: argocd.argoproj.io/instance
# Not the greatest way to pass git/quay info to sub-applications, but it will do until
# we can support helmChart with kustomize
Expand Down
37 changes: 19 additions & 18 deletions common/tests/clustergroup-naked.expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,26 +270,27 @@ metadata:
spec:
# Adding health checks to argocd to prevent pvc resources
# that aren't bound state from blocking deployments
resourceCustomizations: |
PersistentVolumeClaim:
health.lua: |
hs = {}
if obj.status ~= nil then
if obj.status.phase ~= nil then
if obj.status.phase == "Pending" then
hs.status = "Healthy"
hs.message = obj.status.phase
return hs
elseif obj.status.phase == "Bound" then
hs.status = "Healthy"
hs.message = obj.status.phase
return hs
end
resourceHealthChecks:
- kind: PersistentVolumeClaim
check: |
hs = {}
if obj.status ~= nil then
if obj.status.phase ~= nil then
if obj.status.phase == "Pending" then
hs.status = "Healthy"
hs.message = obj.status.phase
return hs
elseif obj.status.phase == "Bound" then
hs.status = "Healthy"
hs.message = obj.status.phase
return hs
end
end
hs.status = "Progressing"
hs.message = "Waiting for PVC"
return hs
end
hs.status = "Progressing"
hs.message = "Waiting for PVC"
return hs

applicationInstanceLabelKey: argocd.argoproj.io/instance
# Not the greatest way to pass git/quay info to sub-applications, but it will do until
# we can support helmChart with kustomize
Expand Down
37 changes: 19 additions & 18 deletions common/tests/clustergroup-normal.expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -877,26 +877,27 @@ metadata:
spec:
# Adding health checks to argocd to prevent pvc resources
# that aren't bound state from blocking deployments
resourceCustomizations: |
PersistentVolumeClaim:
health.lua: |
hs = {}
if obj.status ~= nil then
if obj.status.phase ~= nil then
if obj.status.phase == "Pending" then
hs.status = "Healthy"
hs.message = obj.status.phase
return hs
elseif obj.status.phase == "Bound" then
hs.status = "Healthy"
hs.message = obj.status.phase
return hs
end
resourceHealthChecks:
- kind: PersistentVolumeClaim
check: |
hs = {}
if obj.status ~= nil then
if obj.status.phase ~= nil then
if obj.status.phase == "Pending" then
hs.status = "Healthy"
hs.message = obj.status.phase
return hs
elseif obj.status.phase == "Bound" then
hs.status = "Healthy"
hs.message = obj.status.phase
return hs
end
end
hs.status = "Progressing"
hs.message = "Waiting for PVC"
return hs
end
hs.status = "Progressing"
hs.message = "Waiting for PVC"
return hs

applicationInstanceLabelKey: argocd.argoproj.io/instance
# Not the greatest way to pass git/quay info to sub-applications, but it will do until
# we can support helmChart with kustomize
Expand Down
37 changes: 19 additions & 18 deletions tests/common-clustergroup-industrial-edge-factory.expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -447,26 +447,27 @@ metadata:
spec:
# Adding health checks to argocd to prevent pvc resources
# that aren't bound state from blocking deployments
resourceCustomizations: |
PersistentVolumeClaim:
health.lua: |
hs = {}
if obj.status ~= nil then
if obj.status.phase ~= nil then
if obj.status.phase == "Pending" then
hs.status = "Healthy"
hs.message = obj.status.phase
return hs
elseif obj.status.phase == "Bound" then
hs.status = "Healthy"
hs.message = obj.status.phase
return hs
end
resourceHealthChecks:
- kind: PersistentVolumeClaim
check: |
hs = {}
if obj.status ~= nil then
if obj.status.phase ~= nil then
if obj.status.phase == "Pending" then
hs.status = "Healthy"
hs.message = obj.status.phase
return hs
elseif obj.status.phase == "Bound" then
hs.status = "Healthy"
hs.message = obj.status.phase
return hs
end
end
hs.status = "Progressing"
hs.message = "Waiting for PVC"
return hs
end
hs.status = "Progressing"
hs.message = "Waiting for PVC"
return hs

applicationInstanceLabelKey: argocd.argoproj.io/instance
# Not the greatest way to pass git/quay info to sub-applications, but it will do until
# we can support helmChart with kustomize
Expand Down
Loading