-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parse postBuild references in the Kustomization #625
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #625 +/- ##
==========================================
- Coverage 93.50% 93.44% -0.06%
==========================================
Files 19 20 +1
Lines 2001 2120 +119
==========================================
+ Hits 1871 1981 +110
- Misses 130 139 +9 ☔ View full report in Codecov by Sentry. |
dd support for expanding postbuild substitions from configmaps/secrets Add test for unknown substitute reference kind
--- tests/testdata/cluster/clusters/prod Kustomization: flux-system/flux-system Kustomization: flux-system/apps
+++ tests/testdata/cluster/clusters/prod Kustomization: flux-system/flux-system Kustomization: flux-system/apps
@@ -12,12 +12,15 @@
- name: infra-configs
interval: 10m0s
path: ./tests/testdata/cluster/apps/prod
postBuild:
substitute:
cluster_env: production
+ substituteFrom:
+ - kind: ConfigMap
+ name: cluster-config
prune: true
sourceRef:
kind: GitRepository
name: flux-system
timeout: 5m0s
wait: true
--- tests/testdata/cluster/clusters/prod Kustomization: flux-system/flux-system ConfigMap: flux-system/cluster-config
+++ tests/testdata/cluster/clusters/prod Kustomization: flux-system/flux-system ConfigMap: flux-system/cluster-config
@@ -0,0 +1,12 @@
+---
+apiVersion: v1
+data:
+ cluster_label: example-value
+kind: ConfigMap
+metadata:
+ labels:
+ kustomize.toolkit.fluxcd.io/name: flux-system
+ kustomize.toolkit.fluxcd.io/namespace: flux-system
+ name: cluster-config
+ namespace: flux-system
+
--- tests/testdata/cluster/apps/prod Kustomization: flux-system/apps HelmRelease: podinfo/podinfo
+++ tests/testdata/cluster/apps/prod Kustomization: flux-system/apps HelmRelease: podinfo/podinfo
@@ -20,12 +20,14 @@
remediation:
retries: 3
interval: 50m
releaseName: podinfo
values:
ingress:
+ additionalLabels:
+ cluster_label: example-value
className: nginx
enabled: true
hosts:
- host: podinfo.production
paths:
- path: / |
--- tests/testdata/cluster/clusters/prod Kustomization: flux-system/flux-system Kustomization: flux-system/apps
+++ tests/testdata/cluster/clusters/prod Kustomization: flux-system/flux-system Kustomization: flux-system/apps
@@ -12,12 +12,15 @@
- name: infra-configs
interval: 10m0s
path: ./tests/testdata/cluster/apps/prod
postBuild:
substitute:
cluster_env: production
+ substituteFrom:
+ - kind: ConfigMap
+ name: cluster-config
prune: true
sourceRef:
kind: GitRepository
name: flux-system
timeout: 5m0s
wait: true
--- tests/testdata/cluster/clusters/prod Kustomization: flux-system/flux-system ConfigMap: flux-system/cluster-config
+++ tests/testdata/cluster/clusters/prod Kustomization: flux-system/flux-system ConfigMap: flux-system/cluster-config
@@ -0,0 +1,12 @@
+---
+apiVersion: v1
+data:
+ cluster_label: example-value
+kind: ConfigMap
+metadata:
+ labels:
+ kustomize.toolkit.fluxcd.io/name: flux-system
+ kustomize.toolkit.fluxcd.io/namespace: flux-system
+ name: cluster-config
+ namespace: flux-system
+
--- tests/testdata/cluster/apps/prod Kustomization: flux-system/apps HelmRelease: podinfo/podinfo
+++ tests/testdata/cluster/apps/prod Kustomization: flux-system/apps HelmRelease: podinfo/podinfo
@@ -20,12 +20,14 @@
remediation:
retries: 3
interval: 50m
releaseName: podinfo
values:
ingress:
+ additionalLabels:
+ cluster_label: example-value
className: nginx
enabled: true
hosts:
- host: podinfo.production
paths:
- path: / |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#617