Skip to content

Commit

Permalink
patch
Browse files Browse the repository at this point in the history
  • Loading branch information
jvoravong committed Dec 19, 2024
1 parent b953342 commit c45b1cb
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
4 changes: 3 additions & 1 deletion functional_tests/functional_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,9 @@ func deployChartsAndApps(t *testing.T) {
install := action.NewInstall(actionConfig)
install.Namespace = "default"
install.ReleaseName = "sock"
install.IncludeCRDs = true
// install.WaitForJobs = true
// The default timeout is 5 mins when using the helm cli
install.Timeout = 5 * time.Minute
_, err = install.Run(chart, values)
if err != nil {
t.Logf("error reported during helm install: %v\n", err)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{{- if .Values.operator.enabled }}
apiVersion: batch/v1
kind: Job
metadata:
name: {{ template "splunk-otel-collector.fullname" . }}-operator-webhook-startupapicheck
namespace: {{ template "splunk-otel-collector.namespace" . }}
labels:
{{- include "splunk-otel-collector.commonLabels" . | nindent 4 }}
app: {{ template "splunk-otel-collector.name" . }}
component: otel-operator
chart: {{ template "splunk-otel-collector.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
app.kubernetes.io/component: otel-operator
annotations:
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-weight": "4"
spec:
template:
spec:
containers:
- name: wget
image: "busybox:latest"
env:
- name: WEBHOOK_SERVICE_CLUSTERIP
value: "{{ template "splunk-otel-collector.fullname" . }}-operator-webhook"
- name: WEBHOOK_SERVICE_PORT
value: "443"
command:
- sh
- -c
- |
echo "Checking if 'otelinst' CRD is available..."
for i in $(seq 1 300); do
if kubectl get otelinst >/dev/null 2>&1; then
echo "'otelinst' CRD is available."
exit 0
fi
echo "Waiting for 'otelinst' CRD to become available... (attempt $i)"
sleep 1
done
echo "Timeout reached. 'otelinst' CRD did not become available."
exit 1
restartPolicy: Never
{{- end }}

0 comments on commit c45b1cb

Please sign in to comment.