Skip to content

Commit eea17a5

Browse files
authored
Merge pull request #181 from weaveworks/1507-gitsources
Define policy library source name in weave policy agent profile
2 parents 037aa3e + 26e4b3d commit eea17a5

File tree

4 files changed

+20
-11
lines changed

4 files changed

+20
-11
lines changed

charts/weave-policy-agent/Chart.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dependencies:
22
- name: policy-agent
33
repository: https://weaveworks.github.io/policy-agent
4-
version: 1.0.0
5-
digest: sha256:fcebc5474323b1f9bfb4c69aeca70df90a9195ed22716cfb7e918e82b5d575bb
6-
generated: "2022-08-18T14:32:41.175031628+02:00"
4+
version: 1.1.0
5+
digest: sha256:059e286d2d51653e6bd8bafe60538d2896d6ed62f9a66e7fe4288c912f7447db
6+
generated: "2022-09-20T15:05:23.605515697+02:00"

charts/weave-policy-agent/Chart.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apiVersion: v2
22
description: A Weaveworks Helm chart for Kubernetes to configure the policy agent
33
name: weave-policy-agent
4-
appVersion: "1.0.0"
5-
version: 0.6.0
4+
appVersion: "1.1.0"
5+
version: 0.6.1
66
kubeVersion: ">=1.16.0-0"
77
icon: https://www.magalix.com/hubfs/Imported%20images/logo-02.png%3Fwidth=560%26name=logo-02-Dec-18-2020-11-24-41-75-AM.png
88
type: application
@@ -28,5 +28,5 @@ annotations:
2828
2929
dependencies:
3030
- name: policy-agent
31-
version: "1.0.0"
31+
version: "1.1.0"
3232
repository: "https://weaveworks.github.io/policy-agent"

charts/weave-policy-agent/templates/policy-library.yaml

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{{- if .Values.policySource.enabled }}
2+
{{- if not .Values.policySource.sourceRef }}
23
apiVersion: source.toolkit.fluxcd.io/v1beta1
34
kind: GitRepository
45
metadata:
56
name: policy-library
6-
namespace: flux-system
7+
namespace: {{ .Release.Namespace }}
78
spec:
89
interval: 10s
910
url: {{ .Values.policySource.url }}
@@ -20,19 +21,24 @@ spec:
2021
secretRef:
2122
name: {{ .Values.policySource.secretRef }}
2223
{{- end }}
23-
24+
{{- end }}
2425
---
2526
apiVersion: kustomize.toolkit.fluxcd.io/v1beta1
2627
kind: Kustomization
2728
metadata:
2829
name: policy-library
29-
namespace: flux-system
30+
namespace: {{ .Release.Namespace }}
3031
spec:
3132
interval: 10m0s
33+
{{- if not .Values.policySource.sourceRef }}
3234
sourceRef:
3335
kind: GitRepository
3436
name: policy-library
35-
namespace: flux-system
37+
namespace: {{ .Release.Namespace }}
38+
{{- else }}
39+
sourceRef:
40+
{{- toYaml .Values.policySource.sourceRef | nindent 4 }}
41+
{{- end }}
3642
path: {{ .Values.policySource.path }}
3743
prune: true
3844
validation: client

charts/weave-policy-agent/values.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
policy-agent:
2-
image: magalixcorp/policy-agent
32
failurePolicy: Ignore
43

54
# If you don't want to use cert-manager, set useCertManager to false and provide your own certs
@@ -42,3 +41,7 @@ policySource:
4241
# branch:
4342
# path: ./ # Could be a path to the policies dir or a kustomization.yaml file
4443
# secretRef: policy-library-auth # (Optional): Name of the K8s secret with private repo auth credentials
44+
# sourceRef: # Could specify a name for an existing GitSource reference instead of creating a new one
45+
# kind: GitRepository
46+
# name: policy-library
47+
# namespace: flux-system

0 commit comments

Comments
 (0)