Skip to content

Commit

Permalink
fix(common): networkPolicy template for linting (#72)
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Fuhrer <[email protected]>
  • Loading branch information
janfuhrer authored Mar 2, 2023
1 parent a5099fc commit 0a57ece
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 5 deletions.
1 change: 1 addition & 0 deletions charts/common/.helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@
# gitlab files
.gitlab-ci.yml
README.md.gotmpl
ci
4 changes: 2 additions & 2 deletions charts/common/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: common
description: "Bedag's common Helm chart to use for creating other Helm charts"
version: 9.0.0
version: 9.0.1
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
Expand All @@ -27,4 +27,4 @@ annotations:
artifacthub.io/prerelease: "false"
artifacthub.io/license: Apache-2.0
artifacthub.io/changes: |
- "[added]: Service Type LoadBalancer"
- "[Fixed]: Linting for NetworkPolicy"
2 changes: 1 addition & 1 deletion charts/common/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# common

![Version: 9.0.0](https://img.shields.io/badge/Version-9.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![Version: 9.0.1](https://img.shields.io/badge/Version-9.0.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

Bedag's common Helm chart to use for creating other Helm charts

Expand Down
10 changes: 10 additions & 0 deletions charts/common/ci/values.test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ components:
# start common.networkpolicy
networkpolicy:
deploy: true
podSelector:
- matchLabels:
app.kubernetes.io/component: component-2
# end common.networkpolicy
controller:
deploy: true
Expand Down Expand Up @@ -124,6 +127,8 @@ components:
# start common.networkpolicy
networkpolicy:
deploy: true
ipBlock:
cidr: 0.0.0.0/0
# end common.networkpolicy
controller:
deploy: true
Expand Down Expand Up @@ -195,6 +200,11 @@ components:
# start common.networkpolicy
networkpolicy:
deploy: true
ingressPorts:
- protocol: TCP
port: "8080"
- protocol: TCP
port: "8081"
# end common.networkpolicy
controller:
deploy: true
Expand Down
2 changes: 1 addition & 1 deletion charts/common/templates/_networkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ spec:
- Ingress
ingress:
- from:
{{- if $networkpolicy.ipBlock.cidr }}
{{- if $networkpolicy.ipBlock }}
- ipBlock:
cidr: {{ $networkpolicy.ipBlock.cidr }}
{{- end }}
Expand Down
5 changes: 4 additions & 1 deletion charts/common/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,10 @@
],
"properties": {
"cidr": {
"type": "string"
"type": [
"number",
"string"
]
}
}
},
Expand Down

0 comments on commit 0a57ece

Please sign in to comment.