Skip to content

Commit

Permalink
Merge pull request #200 from kluster-management/fixfmt
Browse files Browse the repository at this point in the history
Fix unittest snapshot file indentation
  • Loading branch information
stefanprodan authored Oct 25, 2023
2 parents a2f51ff + c7e26c5 commit fb9654e
Show file tree
Hide file tree
Showing 21 changed files with 410 additions and 409 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,43 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v1
uses: azure/setup-helm@v3
with:
version: 3.10.1
version: 3.12.1

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: '3.9'
check-latest: true

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.1.0
uses: helm/chart-testing-action@v2.4.0

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config ct.yaml)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: install helm unittest plugin
if: steps.list-changed.outputs.changed == 'true'
run: |
helm env
helm plugin install https://github.com/quintush/helm-unittest.git --version 0.3.5
helm plugin install https://github.com/helm-unittest/helm-unittest.git --version 0.3.5
- name: Run chart-testing (lint)
run: ct lint --config ct.yaml
if: steps.list-changed.outputs.changed == 'true'

- name: Create kind cluster
uses: helm/kind-action@v1.4.0
uses: helm/kind-action@v1.7.0
if: steps.list-changed.outputs.changed == 'true'
with:
node_image: kindest/node:v1.25.11
Expand Down
2 changes: 1 addition & 1 deletion charts/flux2-multi-tenancy/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: flux2-multi-tenancy
version: 0.0.4
version: 0.0.5
deprecated: true
description: A Helm chart for flux2-multi-tenancy
sources:
Expand Down
2 changes: 1 addition & 1 deletion charts/flux2-multi-tenancy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

> **:exclamation: This Helm Chart is deprecated!**
![Version: 0.0.4](https://img.shields.io/badge/Version-0.0.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![Version: 0.0.5](https://img.shields.io/badge/Version-0.0.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

A Helm chart for flux2-multi-tenancy

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,66 +9,66 @@ should match snapshot of default values:
app.kubernetes.io/instance: NAMESPACE
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/part-of: flux
helm.sh/chart: flux2-multi-tenancy-0.0.4
helm.sh/chart: flux2-multi-tenancy-0.0.5
name: RELEASE-NAME
namespace: NAMESPACE
spec:
rules:
- exclude:
resources:
namespaces:
- flux-system
match:
resources:
kinds:
- Kustomization
- HelmRelease
name: serviceAccountName
validate:
message: .spec.serviceAccountName is required
pattern:
spec:
serviceAccountName: ?*
- exclude:
resources:
namespaces:
- flux-system
match:
resources:
kinds:
- Kustomization
name: kustomizationSourceRefNamespace
preconditions:
any:
- key: '{{request.object.spec.sourceRef.namespace}}'
operator: NotEquals
value: ""
validate:
deny:
conditions:
- key: '{{request.object.spec.sourceRef.namespace}}'
operator: NotEquals
value: '{{request.object.metadata.namespace}}'
message: .spec.sourceRef.namespace must be the same as metadata.namespace
- exclude:
resources:
namespaces:
- flux-system
match:
resources:
kinds:
- HelmRelease
name: helmReleaseSourceRefNamespace
preconditions:
any:
- key: '{{request.object.spec.chart.spec.sourceRef.namespace}}'
operator: NotEquals
value: ""
validate:
deny:
conditions:
- key: '{{request.object.spec.chart.spec.sourceRef.namespace}}'
operator: NotEquals
value: '{{request.object.metadata.namespace}}'
message: .spec.chart.spec.sourceRef.namespace must be the same as metadata.namespace
- exclude:
resources:
namespaces:
- flux-system
match:
resources:
kinds:
- Kustomization
- HelmRelease
name: serviceAccountName
validate:
message: .spec.serviceAccountName is required
pattern:
spec:
serviceAccountName: ?*
- exclude:
resources:
namespaces:
- flux-system
match:
resources:
kinds:
- Kustomization
name: kustomizationSourceRefNamespace
preconditions:
any:
- key: '{{request.object.spec.sourceRef.namespace}}'
operator: NotEquals
value: ""
validate:
deny:
conditions:
- key: '{{request.object.spec.sourceRef.namespace}}'
operator: NotEquals
value: '{{request.object.metadata.namespace}}'
message: .spec.sourceRef.namespace must be the same as metadata.namespace
- exclude:
resources:
namespaces:
- flux-system
match:
resources:
kinds:
- HelmRelease
name: helmReleaseSourceRefNamespace
preconditions:
any:
- key: '{{request.object.spec.chart.spec.sourceRef.namespace}}'
operator: NotEquals
value: ""
validate:
deny:
conditions:
- key: '{{request.object.spec.chart.spec.sourceRef.namespace}}'
operator: NotEquals
value: '{{request.object.metadata.namespace}}'
message: .spec.chart.spec.sourceRef.namespace must be the same as metadata.namespace
validationFailureAction: enforce
2 changes: 1 addition & 1 deletion charts/flux2-notification/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: flux2-notification
type: application
version: 1.12.1
version: 1.12.2
appVersion: 2.1.1
description: A Helm chart for flux2 alerts and the needed providers and secrets
sources:
Expand Down
2 changes: 1 addition & 1 deletion charts/flux2-notification/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# flux2-notification

![Version: 1.12.1](https://img.shields.io/badge/Version-1.12.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.1.1](https://img.shields.io/badge/AppVersion-2.1.1-informational?style=flat-square)
![Version: 1.12.2](https://img.shields.io/badge/Version-1.12.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.1.1](https://img.shields.io/badge/AppVersion-2.1.1-informational?style=flat-square)

A Helm chart for flux2 alerts and the needed providers and secrets

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ should match snapshot:
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/part-of: flux
app.kubernetes.io/version: 2.1.1
helm.sh/chart: flux2-notification-1.12.1
helm.sh/chart: flux2-notification-1.12.2
name: all-kustomizations
namespace: NAMESPACE
spec:
eventSeverity: error
eventSources:
- kind: Kustomization
name: '*'
namespace: default
- kind: Kustomization
name: '*'
namespace: default
providerRef:
name: dev-msteams
suspend: true
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ should match snapshot:
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/part-of: flux
app.kubernetes.io/version: 2.1.1
helm.sh/chart: flux2-notification-1.12.1
helm.sh/chart: flux2-notification-1.12.2
name: on-call-slack
namespace: NAMESPACE
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ should match snapshot of default values:
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/part-of: flux
app.kubernetes.io/version: 2.1.1
helm.sh/chart: flux2-notification-1.12.1
helm.sh/chart: flux2-notification-1.12.2
name: webhook-url
namespace: NAMESPACE
stringData:
Expand Down
2 changes: 1 addition & 1 deletion charts/flux2/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ name: flux2
sources:
- https://github.com/fluxcd-community/helm-charts
type: application
version: 2.10.3
version: 2.10.4
2 changes: 1 addition & 1 deletion charts/flux2/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# flux2

![Version: 2.10.3](https://img.shields.io/badge/Version-2.10.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.1.1](https://img.shields.io/badge/AppVersion-2.1.1-informational?style=flat-square)
![Version: 2.10.4](https://img.shields.io/badge/Version-2.10.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.1.1](https://img.shields.io/badge/AppVersion-2.1.1-informational?style=flat-square)

A Helm chart for flux2

Expand Down
2 changes: 1 addition & 1 deletion charts/flux2/templates/pre-install-job-serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
app.kubernetes.io/part-of: flux
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
name: "{{ .Release.Name }}-flux-check"
annotations:
annotations:
"helm.sh/hook": pre-install
"helm.sh/hook-weight": "-10"
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
96 changes: 48 additions & 48 deletions charts/flux2/tests/__snapshot__/helm-controller_test.yaml.snap
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ should match snapshot of default values:
app.kubernetes.io/part-of: flux
app.kubernetes.io/version: 2.1.1
control-plane: controller
helm.sh/chart: flux2-2.10.3
helm.sh/chart: flux2-2.10.4
labeltestkey: labeltestvalue
labeltestkey2: labeltestvalue2
name: helm-controller
Expand All @@ -30,53 +30,53 @@ should match snapshot of default values:
spec:
automountServiceAccountToken: true
containers:
- args:
- --events-addr=http://notification-controller.$(RUNTIME_NAMESPACE).svc.cluster.local.
- --watch-all-namespaces=true
- --log-level=info
- --log-encoding=json
- --enable-leader-election
env:
- name: RUNTIME_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
image: ghcr.io/fluxcd/helm-controller:v0.36.1
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
path: /healthz
port: healthz
name: manager
ports:
- containerPort: 8080
name: http-prom
- containerPort: 9440
name: healthz
protocol: TCP
readinessProbe:
httpGet:
path: /readyz
port: healthz
resources:
limits: {}
requests:
cpu: 100m
memory: 64Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
volumeMounts:
- mountPath: /tmp
name: temp
- args:
- --events-addr=http://notification-controller.$(RUNTIME_NAMESPACE).svc.cluster.local.
- --watch-all-namespaces=true
- --log-level=info
- --log-encoding=json
- --enable-leader-election
env:
- name: RUNTIME_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
image: ghcr.io/fluxcd/helm-controller:v0.36.1
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
path: /healthz
port: healthz
name: manager
ports:
- containerPort: 8080
name: http-prom
- containerPort: 9440
name: healthz
protocol: TCP
readinessProbe:
httpGet:
path: /readyz
port: healthz
resources:
limits: {}
requests:
cpu: 100m
memory: 64Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
volumeMounts:
- mountPath: /tmp
name: temp
serviceAccountName: helm-controller
terminationGracePeriodSeconds: 600
volumes:
- emptyDir: {}
name: temp
- emptyDir: {}
name: temp
Loading

0 comments on commit fb9654e

Please sign in to comment.