-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds the ability to set custom ports for Webhook.
This commit also adds helm unittest and updates integration-test to run K3s without Rancher.
- Loading branch information
1 parent
2f10923
commit 851f4cb
Showing
18 changed files
with
336 additions
and
38 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
## local dev testing instructions | ||
|
||
Option 1: Full chart CI run with a live cluster | ||
|
||
```bash | ||
./scripts/charts/ci | ||
``` | ||
|
||
Option 2: Test runs against the chart only | ||
|
||
```bash | ||
# install the helm plugin first - helm plugin install https://github.com/helm-unittest/helm-unittest.git | ||
bash dev-scripts/helm-unittest.sh | ||
``` | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
suite: Test Service | ||
templates: | ||
- charts/capi/templates/service.yaml | ||
tests: | ||
- it: should set webhook default port values | ||
set: | ||
capi.enabled: true | ||
asserts: | ||
- equal: | ||
path: spec.ports[0].targetPort | ||
value: 8777 | ||
|
||
- it: should set updated target port | ||
set: | ||
capi.port: 2319 | ||
capi.enabled: true | ||
asserts: | ||
- equal: | ||
path: spec.ports[0].targetPort | ||
value: 2319 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
suite: Test Deployment | ||
templates: | ||
- deployment.yaml | ||
|
||
tests: | ||
- it: should set webhook default port values | ||
asserts: | ||
- equal: | ||
path: spec.template.spec.containers[0].ports[0].containerPort | ||
value: 9443 | ||
- equal: | ||
path: spec.template.spec.containers[0].ports[1].containerPort | ||
value: 8777 | ||
- contains: | ||
path: spec.template.spec.containers[0].env | ||
content: | ||
name: CATTLE_PORT | ||
value: "9443" | ||
- contains: | ||
path: spec.template.spec.containers[0].env | ||
content: | ||
name: CATTLE_CAPI_PORT | ||
value: "8777" | ||
|
||
- it: should set updated webhook port | ||
set: | ||
port: 2319 | ||
asserts: | ||
- equal: | ||
path: spec.template.spec.containers[0].ports[0].containerPort | ||
value: 2319 | ||
- contains: | ||
path: spec.template.spec.containers[0].env | ||
content: | ||
name: CATTLE_PORT | ||
value: "2319" | ||
|
||
- it: should set updated capi port | ||
set: | ||
capi.port: 2319 | ||
asserts: | ||
- equal: | ||
path: spec.template.spec.containers[0].ports[1].containerPort | ||
value: 2319 | ||
- contains: | ||
path: spec.template.spec.containers[0].env | ||
content: | ||
name: CATTLE_CAPI_PORT | ||
value: "2319" | ||
|
||
- it: should not set capabilities by default. | ||
asserts: | ||
- isNull: | ||
path: spec.template.spec.containers[0].securityContext | ||
|
||
- it: should set net capabilities when capNetBindService is true. | ||
set: | ||
capNetBindService: true | ||
asserts: | ||
- contains: | ||
path: spec.template.spec.containers[0].securityContext.capabilities.add | ||
content: NET_BIND_SERVICE |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
suite: Test Service | ||
templates: | ||
- service.yaml | ||
|
||
tests: | ||
- it: should set webhook default port values | ||
asserts: | ||
- equal: | ||
path: spec.ports[0].targetPort | ||
value: 9443 | ||
|
||
- it: should set updated target port | ||
set: | ||
port: 2319 | ||
asserts: | ||
- equal: | ||
path: spec.ports[0].targetPort | ||
value: 2319 |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
cd $(dirname $0)/.. | ||
./scripts/package-helm | ||
./scripts/test-helm |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ cd $(dirname $0) | |
./validate | ||
./validate-ci | ||
./package | ||
./test-helm |
Oops, something went wrong.