Skip to content

Commit

Permalink
Merge pull request #347 from itewk/feature/operators-installer-fix5
Browse files Browse the repository at this point in the history
operators-installer - updates
  • Loading branch information
eformat authored Jul 16, 2023
2 parents 9568967 + 57e063b commit 5f1fa80
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 28 deletions.
2 changes: 1 addition & 1 deletion charts/operators-installer/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 2.2.0
version: 2.3.0

home: https://github.com/redhat-cop/helm-charts

Expand Down
15 changes: 7 additions & 8 deletions charts/operators-installer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ For all of the Subscription parameters see
| operators[].name | | Yes | [Subscription](https://docs.openshift.com/container-platform/4latest/rest_api/operatorhub_apis/subscription-operators-coreos-com-v1alpha1) name.
| operators[].source | | Yes | [Subscription](https://docs.openshift.com/container-platform/4latest/rest_api/operatorhub_apis/subscription-operators-coreos-com-v1alpha1) source.
| operators[].sourceNamespace | | Yes | [Subscription](https://docs.openshift.com/container-platform/4latest/rest_api/operatorhub_apis/subscription-operators-coreos-com-v1alpha1) sourceNamespace.
| operators[].csv | | Yes | The CSV to install.
| operators[].csv | | Yes | The CSV to install.
| operators[].installPlanApproverRetries | `10 | No | Number of times to try to approve the InstallPlan. This may need to be increased for unpredictable reasons about some clusters taking longer to create InstallPlans.
| operators[].installPlanApproverActiveDeadlineSeconds | `120` | No | Total amount of time that can be spent waiting for InstallPlan to be approved. This may need to be increased for unpredictable reasons about some clusters taking longer to create InstallPlans.
| operators[].installPlanVerifierRetries | `10` | No | Number of times to check if the InstallPlan has actually been installed. This may need to increase of an operator takes a long time to install.
| operators[].installPlanVerifierActiveDeadlineSeconds | `120` | No | Total amount of time that can be spent waiting for InstallPlan to finish installing. This may need to increase of an operator takes a long time to install.
| operators[].namespace | `.Release.Namespace` | No | Specify the namespace to install the operator into, which allows different operators to be installed into different namespaces from the same chart. If
Expand Down Expand Up @@ -51,11 +53,11 @@ if obj.status ~= nil then
for i, condition in pairs(obj.status.conditions) do
msg = msg .. i .. ": " .. condition.type .. " | " .. condition.status .. "\n"
if condition.type == "InstallPlanPending" and condition.status == "True" then
numPending = numPending + 1
numPending = numPending + 1
elseif (condition.type == "InstallPlanMissing" and condition.reason ~= "ReferencedInstallPlanNotFound") then
numDegraded = numDegraded + 1
numDegraded = numDegraded + 1
elseif (condition.type == "CatalogSourcesUnhealthy" or condition.type == "InstallPlanFailed" or condition.type == "ResolutionFailed") and condition.status == "True" then
numDegraded = numDegraded + 1
numDegraded = numDegraded + 1
end
end
if numDegraded == 0 and numPending == 0 then
Expand All @@ -68,17 +70,14 @@ if obj.status ~= nil then
return health_status
elseif numPending > 0 and numDegraded == 0 then
health_status.status = "Progressing"
health_status.message = "An install plan for a subscription is pending installation - ian was here 1"
health_status.message = "An install plan for a subscription is pending installation"
return health_status
else
health_status.status = "Degraded"
health_status.message = msg
return health_status
end
end
end
health_status.status = "Progressing"
health_status.message = "An install plan for a subscription is pending installation - ian was here 2"
return health_status
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,19 @@ metadata:
namespace: {{ .namespace | default $.Release.Namespace }}
labels:
{{- include "operators-installer.labels" $ | nindent 4 }}
{{- if $.Values.approveManualInstallPlanViaHook }}
annotations:
{{- if $.Values.approveManualInstallPlanViaHook }}
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
"helm.sh/hook-weight": "0"
{{- end }}
"helm.sh/hook-weight": "20"
{{- else }}
argocd.argoproj.io/sync-wave: 20
{{- end }}
spec:
completions: 1
backoffLimit: 5
parallelism: 1
activeDeadlineSeconds: 30
backoffLimit: {{ .installPlanApproverRetries | default 10 }}
activeDeadlineSeconds: {{ .installPlanApproverActiveDeadlineSeconds | default 120 }}
template:
spec:
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@ metadata:
namespace: {{ .namespace | default $.Release.Namespace }}
labels:
{{- include "operators-installer.labels" $ | nindent 4 }}
{{- if $.Values.approveManualInstallPlanViaHook }}
annotations:
{{- if $.Values.approveManualInstallPlanViaHook }}
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
"helm.sh/hook-weight": "10"
{{- end }}
"helm.sh/hook-weight": "30"
{{- else }}
argocd.argoproj.io/sync-wave: 30
{{- end }}
spec:
completions: 1
backoffLimit: {{ .installPlanVerifierRetries | default 10 }}
parallelism: 1
backoffLimit: {{ .installPlanVerifierRetries | default 10 }}
activeDeadlineSeconds: {{ .installPlanVerifierActiveDeadlineSeconds | default 120 }}
template:
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ metadata:
namespace: {{ $namespace }}
labels:
{{- include "operators-installer.labels" $ | nindent 4 }}
{{- if $.Values.approveManualInstallPlanViaHook }}
annotations:
{{- if $.Values.approveManualInstallPlanViaHook }}
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
"helm.sh/hook-weight": "-1"
{{- end }}
"helm.sh/hook-weight": "10"
{{- else }}
argocd.argoproj.io/sync-wave: 10
{{- end }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ metadata:
namespace: {{ $namespace }}
labels:
{{- include "operators-installer.labels" $ | nindent 4 }}
{{- if $.Values.approveManualInstallPlanViaHook }}
annotations:
{{- if $.Values.approveManualInstallPlanViaHook }}
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
"helm.sh/hook-weight": "-1"
{{- end }}
"helm.sh/hook-weight": "10"
{{- else }}
argocd.argoproj.io/sync-wave: 10
{{- end }}
rules:
- apiGroups:
- operators.coreos.com
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ metadata:
namespace: {{ $namespace }}
labels:
{{- include "operators-installer.labels" $ | nindent 4 }}
{{- if $.Values.approveManualInstallPlanViaHook }}
annotations:
{{- if $.Values.approveManualInstallPlanViaHook }}
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
"helm.sh/hook-weight": "-1"
{{- end }}
"helm.sh/hook-weight": "10"
{{- else }}
argocd.argoproj.io/sync-wave: 10
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/operators-installer/templates/Subscription.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# create one Subscription per operator
{{- range .Values.operators }}
---
# create one Subscription per operator
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
Expand Down
12 changes: 12 additions & 0 deletions charts/operators-installer/test-install-approve-not-via-hook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
approveManualInstallPlanViaHook: false

operators:
- channel: stable
installPlanApproval: Manual
name: external-secrets-operator
source: community-operators
sourceNamespace: openshift-marketplace
csv: external-secrets-operator.v0.8.1
namespace: openshift-operators
commonLabels:
test-label: xyz123

0 comments on commit 5f1fa80

Please sign in to comment.