From 8e44cd220d27b394611ca48c39c1b1fb6b974a29 Mon Sep 17 00:00:00 2001 From: Amit Lin Date: Sun, 25 May 2025 23:58:58 +0300 Subject: [PATCH 1/3] fix: added missing apiVersion & kind fields to prevent permanent diff when installing using gitOps tools like ArgoCD --- deploy/helm/sumologic/templates/logs/otelcol/statefulset.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deploy/helm/sumologic/templates/logs/otelcol/statefulset.yaml b/deploy/helm/sumologic/templates/logs/otelcol/statefulset.yaml index e90d5a25d6..ae99803d45 100644 --- a/deploy/helm/sumologic/templates/logs/otelcol/statefulset.yaml +++ b/deploy/helm/sumologic/templates/logs/otelcol/statefulset.yaml @@ -153,7 +153,9 @@ spec: {{- end }} {{- if .Values.metadata.persistence.enabled }} volumeClaimTemplates: - - metadata: + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: name: file-storage {{- if .Values.metadata.persistence.pvcLabels }} labels: From 05d41f32706dda219f7689b172c9e8e2ec5f6917 Mon Sep 17 00:00:00 2001 From: Amit Lin Date: Mon, 26 May 2025 00:03:55 +0300 Subject: [PATCH 2/3] Create 3936.fixed.txt --- .changelog/3936.fixed.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 .changelog/3936.fixed.txt diff --git a/.changelog/3936.fixed.txt b/.changelog/3936.fixed.txt new file mode 100644 index 0000000000..c3569afa1e --- /dev/null +++ b/.changelog/3936.fixed.txt @@ -0,0 +1 @@ +"fixed: added missing apiVersion and kind fields to statefulset pvc claim" From ba20dad1e6ea1ad175504e3da5b4b0928cd3c637 Mon Sep 17 00:00:00 2001 From: Amit Lin Date: Wed, 28 May 2025 12:20:28 +0300 Subject: [PATCH 3/3] chore: update goldenfiles --- .../basic.output.yaml | 171 +++++++-------- .../custom.output.yaml | 199 +++++++++--------- .../pvcpolicyenabled.output.yaml | 199 +++++++++--------- 3 files changed, 289 insertions(+), 280 deletions(-) diff --git a/tests/helm/testdata/goldenfile/metadata_logs_otc_statefulset/basic.output.yaml b/tests/helm/testdata/goldenfile/metadata_logs_otc_statefulset/basic.output.yaml index 64ccd90bf3..da9c16d4e6 100644 --- a/tests/helm/testdata/goldenfile/metadata_logs_otc_statefulset/basic.output.yaml +++ b/tests/helm/testdata/goldenfile/metadata_logs_otc_statefulset/basic.output.yaml @@ -22,7 +22,7 @@ spec: template: metadata: annotations: - checksum/config: "%CONFIG_CHECKSUM%" + checksum/config: '%CONFIG_CHECKSUM%' labels: app: RELEASE-NAME-sumologic-otelcol-logs chart: "sumologic-%CURRENT_CHART_VERSION%" @@ -33,91 +33,94 @@ spec: nodeSelector: kubernetes.io/os: linux volumes: - - name: config-volume - configMap: - name: RELEASE-NAME-sumologic-otelcol-logs - - name: tmp - emptyDir: {} + - name: config-volume + configMap: + name: RELEASE-NAME-sumologic-otelcol-logs + - name: tmp + emptyDir: {} securityContext: fsGroup: 999 containers: - - name: otelcol - image: "public.ecr.aws/sumologic/sumologic-otel-collector:0.118.0-sumo-0" - imagePullPolicy: IfNotPresent - args: - - --config=/etc/otel/config.yaml - resources: - limits: - cpu: 1000m - memory: 1Gi - requests: - cpu: 500m - memory: 768Mi - ports: - - name: metrics - containerPort: 8888 - protocol: TCP - - name: otlphttp - containerPort: 4318 - protocol: TCP - - name: pprof - containerPort: 1777 - protocol: TCP - livenessProbe: - httpGet: - path: / - port: 13133 # Health Check extension default port. - failureThreshold: 3 - initialDelaySeconds: 15 - periodSeconds: 15 - timeoutSeconds: 10 - readinessProbe: - httpGet: - path: / - port: 13133 # Health Check extension default port. - failureThreshold: 3 - initialDelaySeconds: 5 - periodSeconds: 10 - timeoutSeconds: 3 - startupProbe: - httpGet: - path: / - port: 13133 # Health Check extension default port. - failureThreshold: 60 - periodSeconds: 3 - volumeMounts: - - name: config-volume - mountPath: /etc/otel/config.yaml - subPath: config.yaml - - name: tmp - mountPath: /tmp - - name: file-storage - mountPath: /var/lib/storage/otc - env: - - name: SUMO_ENDPOINT_DEFAULT_LOGS_SOURCE - valueFrom: - secretKeyRef: - name: sumologic - key: endpoint-logs - - name: SUMO_ENDPOINT_DEFAULT_OTLP_LOGS_SOURCE - valueFrom: - secretKeyRef: - name: sumologic - key: endpoint-logs-otlp - - - name: NO_PROXY - value: kubernetes.default.svc - - name: MY_POD_IP - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: status.podIP - volumeClaimTemplates: - - metadata: - name: file-storage - spec: - accessModes: [ReadWriteOnce] - storageClassName: + - name: otelcol + image: "public.ecr.aws/sumologic/sumologic-otel-collector:0.118.0-sumo-0" + imagePullPolicy: IfNotPresent + args: + - --config=/etc/otel/config.yaml resources: + limits: + cpu: 1000m + memory: 1Gi requests: - storage: 10Gi + cpu: 500m + memory: 768Mi + ports: + - name: metrics + containerPort: 8888 + protocol: TCP + - name: otlphttp + containerPort: 4318 + protocol: TCP + - name: pprof + containerPort: 1777 + protocol: TCP + livenessProbe: + httpGet: + path: / + port: 13133 # Health Check extension default port. + failureThreshold: 3 + initialDelaySeconds: 15 + periodSeconds: 15 + timeoutSeconds: 10 + readinessProbe: + httpGet: + path: / + port: 13133 # Health Check extension default port. + failureThreshold: 3 + initialDelaySeconds: 5 + periodSeconds: 10 + timeoutSeconds: 3 + startupProbe: + httpGet: + path: / + port: 13133 # Health Check extension default port. + failureThreshold: 60 + periodSeconds: 3 + volumeMounts: + - name: config-volume + mountPath: /etc/otel/config.yaml + subPath: config.yaml + - name: tmp + mountPath: /tmp + - name: file-storage + mountPath: /var/lib/storage/otc + env: + - name: SUMO_ENDPOINT_DEFAULT_LOGS_SOURCE + valueFrom: + secretKeyRef: + name: sumologic + key: endpoint-logs + - name: SUMO_ENDPOINT_DEFAULT_OTLP_LOGS_SOURCE + valueFrom: + secretKeyRef: + name: sumologic + key: endpoint-logs-otlp + + + - name: NO_PROXY + value: kubernetes.default.svc + - name: MY_POD_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + volumeClaimTemplates: + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + name: file-storage + spec: + accessModes: [ReadWriteOnce] + storageClassName: + resources: + requests: + storage: 10Gi \ No newline at end of file diff --git a/tests/helm/testdata/goldenfile/metadata_logs_otc_statefulset/custom.output.yaml b/tests/helm/testdata/goldenfile/metadata_logs_otc_statefulset/custom.output.yaml index 5fc4c8e236..f62f363f76 100644 --- a/tests/helm/testdata/goldenfile/metadata_logs_otc_statefulset/custom.output.yaml +++ b/tests/helm/testdata/goldenfile/metadata_logs_otc_statefulset/custom.output.yaml @@ -23,7 +23,7 @@ spec: template: metadata: annotations: - checksum/config: "%CONFIG_CHECKSUM%" + checksum/config: '%CONFIG_CHECKSUM%' someAnnotation: someValue labels: app: RELEASE-NAME-sumologic-otelcol-logs @@ -42,106 +42,109 @@ spec: operator: Equal value: worker volumes: - - name: config-volume - configMap: - name: RELEASE-NAME-sumologic-otelcol-logs - - name: tmp - emptyDir: {} - - name: es-certs - secret: - defaultMode: 420 - secretName: es-certs + - name: config-volume + configMap: + name: RELEASE-NAME-sumologic-otelcol-logs + - name: tmp + emptyDir: {} + - name: es-certs + secret: + defaultMode: 420 + secretName: es-certs securityContext: fsGroup: 999 priorityClassName: "prio" containers: - - name: otelcol - image: "my_repository:my_tag" - imagePullPolicy: IfNotPresent - args: - - --config=/etc/otel/config.yaml - - --config=/etc/otel/test-config.yaml - resources: - limits: - cpu: 2000m - memory: 2Gi - requests: - cpu: 100m - memory: 777Mi - ports: - - name: metrics - containerPort: 8888 - protocol: TCP - - name: otlphttp - containerPort: 4318 - protocol: TCP - - name: pprof - containerPort: 1777 - protocol: TCP - - containerPort: 4319 - name: otlphttp2 - protocol: TCP - - containerPort: 4320 - name: otlphttp3 - protocol: TCP - livenessProbe: - httpGet: - path: / - port: 13133 # Health Check extension default port. - failureThreshold: 3 - initialDelaySeconds: 15 - periodSeconds: 15 - timeoutSeconds: 10 - readinessProbe: - httpGet: - path: / - port: 13133 # Health Check extension default port. - failureThreshold: 3 - initialDelaySeconds: 5 - periodSeconds: 10 - timeoutSeconds: 3 - startupProbe: - httpGet: - path: / - port: 13133 # Health Check extension default port. - failureThreshold: 60 - periodSeconds: 3 - volumeMounts: - - name: config-volume - mountPath: /etc/otel/config.yaml - subPath: config.yaml - - name: tmp - mountPath: /tmp - - name: file-storage - mountPath: /var/lib/storage/otc - - mountPath: /certs - name: es-certs - readOnly: true - env: - - name: SUMO_ENDPOINT_DEFAULT_LOGS_SOURCE - valueFrom: - secretKeyRef: - name: sumologic - key: endpoint-logs - - - name: NO_PROXY - value: kubernetes.default.svc - - name: MY_POD_IP - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: status.podIP - - name: VALUE_FROM_SECRET - valueFrom: - secretKeyRef: - key: secret_key - name: secret_name - volumeClaimTemplates: - - metadata: - name: file-storage - spec: - accessModes: [ReadWriteOnce] - storageClassName: + - name: otelcol + image: "my_repository:my_tag" + imagePullPolicy: IfNotPresent + args: + - --config=/etc/otel/config.yaml + - --config=/etc/otel/test-config.yaml resources: + limits: + cpu: 2000m + memory: 2Gi requests: - storage: 10Gi + cpu: 100m + memory: 777Mi + ports: + - name: metrics + containerPort: 8888 + protocol: TCP + - name: otlphttp + containerPort: 4318 + protocol: TCP + - name: pprof + containerPort: 1777 + protocol: TCP + - containerPort: 4319 + name: otlphttp2 + protocol: TCP + - containerPort: 4320 + name: otlphttp3 + protocol: TCP + livenessProbe: + httpGet: + path: / + port: 13133 # Health Check extension default port. + failureThreshold: 3 + initialDelaySeconds: 15 + periodSeconds: 15 + timeoutSeconds: 10 + readinessProbe: + httpGet: + path: / + port: 13133 # Health Check extension default port. + failureThreshold: 3 + initialDelaySeconds: 5 + periodSeconds: 10 + timeoutSeconds: 3 + startupProbe: + httpGet: + path: / + port: 13133 # Health Check extension default port. + failureThreshold: 60 + periodSeconds: 3 + volumeMounts: + - name: config-volume + mountPath: /etc/otel/config.yaml + subPath: config.yaml + - name: tmp + mountPath: /tmp + - name: file-storage + mountPath: /var/lib/storage/otc + - mountPath: /certs + name: es-certs + readOnly: true + env: + - name: SUMO_ENDPOINT_DEFAULT_LOGS_SOURCE + valueFrom: + secretKeyRef: + name: sumologic + key: endpoint-logs + + + - name: NO_PROXY + value: kubernetes.default.svc + - name: MY_POD_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: VALUE_FROM_SECRET + valueFrom: + secretKeyRef: + key: secret_key + name: secret_name + volumeClaimTemplates: + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + name: file-storage + spec: + accessModes: [ReadWriteOnce] + storageClassName: + resources: + requests: + storage: 10Gi \ No newline at end of file diff --git a/tests/helm/testdata/goldenfile/metadata_logs_otc_statefulset/pvcpolicyenabled.output.yaml b/tests/helm/testdata/goldenfile/metadata_logs_otc_statefulset/pvcpolicyenabled.output.yaml index a00a75841c..a5be033e80 100644 --- a/tests/helm/testdata/goldenfile/metadata_logs_otc_statefulset/pvcpolicyenabled.output.yaml +++ b/tests/helm/testdata/goldenfile/metadata_logs_otc_statefulset/pvcpolicyenabled.output.yaml @@ -20,7 +20,7 @@ spec: template: metadata: annotations: - checksum/config: "%CONFIG_CHECKSUM%" + checksum/config: '%CONFIG_CHECKSUM%' someAnnotation: someValue labels: app: RELEASE-NAME-sumologic-otelcol-logs @@ -39,106 +39,109 @@ spec: operator: Equal value: worker volumes: - - name: config-volume - configMap: - name: RELEASE-NAME-sumologic-otelcol-logs - - name: tmp - emptyDir: {} - - name: es-certs - secret: - defaultMode: 420 - secretName: es-certs + - name: config-volume + configMap: + name: RELEASE-NAME-sumologic-otelcol-logs + - name: tmp + emptyDir: {} + - name: es-certs + secret: + defaultMode: 420 + secretName: es-certs securityContext: fsGroup: 999 priorityClassName: "prio" containers: - - name: otelcol - image: "my_repository:my_tag" - imagePullPolicy: IfNotPresent - args: - - --config=/etc/otel/config.yaml - - --config=/etc/otel/test-config.yaml - resources: - limits: - cpu: 2000m - memory: 2Gi - requests: - cpu: 100m - memory: 777Mi - ports: - - name: metrics - containerPort: 8888 - protocol: TCP - - name: otlphttp - containerPort: 4318 - protocol: TCP - - name: pprof - containerPort: 1777 - protocol: TCP - - containerPort: 4319 - name: otlphttp2 - protocol: TCP - - containerPort: 4320 - name: otlphttp3 - protocol: TCP - livenessProbe: - httpGet: - path: / - port: 13133 # Health Check extension default port. - failureThreshold: 3 - initialDelaySeconds: 15 - periodSeconds: 15 - timeoutSeconds: 10 - readinessProbe: - httpGet: - path: / - port: 13133 # Health Check extension default port. - failureThreshold: 3 - initialDelaySeconds: 5 - periodSeconds: 10 - timeoutSeconds: 3 - startupProbe: - httpGet: - path: / - port: 13133 # Health Check extension default port. - failureThreshold: 60 - periodSeconds: 3 - volumeMounts: - - name: config-volume - mountPath: /etc/otel/config.yaml - subPath: config.yaml - - name: tmp - mountPath: /tmp - - name: file-storage - mountPath: /var/lib/storage/otc - - mountPath: /certs - name: es-certs - readOnly: true - env: - - name: SUMO_ENDPOINT_DEFAULT_LOGS_SOURCE - valueFrom: - secretKeyRef: - name: sumologic - key: endpoint-logs - - - name: NO_PROXY - value: kubernetes.default.svc - - name: MY_POD_IP - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: status.podIP - - name: VALUE_FROM_SECRET - valueFrom: - secretKeyRef: - key: secret_key - name: secret_name - volumeClaimTemplates: - - metadata: - name: file-storage - spec: - accessModes: [ReadWriteOnce] - storageClassName: + - name: otelcol + image: "my_repository:my_tag" + imagePullPolicy: IfNotPresent + args: + - --config=/etc/otel/config.yaml + - --config=/etc/otel/test-config.yaml resources: + limits: + cpu: 2000m + memory: 2Gi requests: - storage: 10Gi + cpu: 100m + memory: 777Mi + ports: + - name: metrics + containerPort: 8888 + protocol: TCP + - name: otlphttp + containerPort: 4318 + protocol: TCP + - name: pprof + containerPort: 1777 + protocol: TCP + - containerPort: 4319 + name: otlphttp2 + protocol: TCP + - containerPort: 4320 + name: otlphttp3 + protocol: TCP + livenessProbe: + httpGet: + path: / + port: 13133 # Health Check extension default port. + failureThreshold: 3 + initialDelaySeconds: 15 + periodSeconds: 15 + timeoutSeconds: 10 + readinessProbe: + httpGet: + path: / + port: 13133 # Health Check extension default port. + failureThreshold: 3 + initialDelaySeconds: 5 + periodSeconds: 10 + timeoutSeconds: 3 + startupProbe: + httpGet: + path: / + port: 13133 # Health Check extension default port. + failureThreshold: 60 + periodSeconds: 3 + volumeMounts: + - name: config-volume + mountPath: /etc/otel/config.yaml + subPath: config.yaml + - name: tmp + mountPath: /tmp + - name: file-storage + mountPath: /var/lib/storage/otc + - mountPath: /certs + name: es-certs + readOnly: true + env: + - name: SUMO_ENDPOINT_DEFAULT_LOGS_SOURCE + valueFrom: + secretKeyRef: + name: sumologic + key: endpoint-logs + + + - name: NO_PROXY + value: kubernetes.default.svc + - name: MY_POD_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: VALUE_FROM_SECRET + valueFrom: + secretKeyRef: + key: secret_key + name: secret_name + volumeClaimTemplates: + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + name: file-storage + spec: + accessModes: [ReadWriteOnce] + storageClassName: + resources: + requests: + storage: 10Gi \ No newline at end of file