-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(common): ensure no loadbalancer reservation is made and ingress i…
…s not connected to ingresscontroller with Stop-All set (#652) **Description** Currently ingress and loadbalancer reservations are still being made for stopped charts. With this change we set services to clusterip, to prevent external connections. We also set ingress to a special `stopped` ingressClass, this ensures we don't nuke things like certificates when stopping **⚙️ Type of change** - [x] ⚙️ Feature/App addition - [x] 🪛 Bugfix - [ ]⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 🔃 Refactor of current code **🧪 How Has This Been Tested?** <!-- Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration --> **📃 Notes:** <!-- Please enter any other relevant information here --> **✔️ Checklist:** - [ ] ⚖️ My code follows the style guidelines of this project - [ ] 👀 I have performed a self-review of my own code - [ ] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made corresponding changes to the documentation - [ ]⚠️ My changes generate no new warnings - [ ] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [ ] ⬆️ I increased versions for any altered app according to semantic versioning **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🪞 I have opened a PR on [truecharts/containers](https://github.com/truecharts/containers) adding the container to TrueCharts mirror repo. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --------- Co-authored-by: Stavros kois <[email protected]>
- Loading branch information
Showing
7 changed files
with
254 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
suite: ingress - stop test | ||
templates: | ||
- common.yaml | ||
chart: | ||
appVersion: &appVer v9.9.9 | ||
release: | ||
name: test-release-name | ||
namespace: test-release-namespace | ||
tests: | ||
- it: should pass with stopAll | ||
set: | ||
operator: &operator | ||
verify: | ||
enabled: false | ||
global: | ||
stopAll: true | ||
service: &service | ||
my-service: | ||
enabled: true | ||
primary: true | ||
ports: | ||
main: | ||
enabled: true | ||
primary: true | ||
port: 80 | ||
ingress: &ingress | ||
my-ingress: | ||
enabled: true | ||
primary: true | ||
hosts: | ||
- host: test-host | ||
paths: | ||
- path: /test-path | ||
integrations: | ||
traefik: | ||
enabled: false | ||
asserts: | ||
- documentIndex: &ingressDoc 1 | ||
isKind: | ||
of: Ingress | ||
- documentIndex: *ingressDoc | ||
equal: | ||
path: metadata.name | ||
value: test-release-name-common-test | ||
- documentIndex: *ingressDoc | ||
equal: | ||
path: spec.ingressClassName | ||
value: tc-stopped | ||
|
||
- it: should pass with ixChartContext - isStopped (true) | ||
set: | ||
operator: *operator | ||
global: | ||
namespace: ix-something | ||
ixChartContext: | ||
storageClassName: some-storage-class | ||
isStopped: true | ||
service: *service | ||
ingress: *ingress | ||
asserts: | ||
- documentIndex: &ingressDoc 1 | ||
isKind: | ||
of: Ingress | ||
- documentIndex: *ingressDoc | ||
equal: | ||
path: metadata.name | ||
value: test-release-name-common-test | ||
- documentIndex: *ingressDoc | ||
equal: | ||
path: spec.ingressClassName | ||
value: tc-stopped | ||
|
||
- it: should pass with ixChartContext - isStopped (false) | ||
set: | ||
operator: *operator | ||
global: | ||
namespace: ix-something | ||
ixChartContext: | ||
storageClassName: some-storage-class | ||
isStopped: false | ||
service: *service | ||
ingress: *ingress | ||
asserts: | ||
- documentIndex: &ingressDoc 1 | ||
isKind: | ||
of: Ingress | ||
- documentIndex: *ingressDoc | ||
equal: | ||
path: metadata.name | ||
value: test-release-name-common-test | ||
- documentIndex: *ingressDoc | ||
isNull: | ||
path: spec.ingressClassName |
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,120 @@ | ||
suite: service stop test | ||
templates: | ||
- common.yaml | ||
release: | ||
name: test-release-name | ||
namespace: test-release-namespace | ||
tests: | ||
- it: should pass with stopAll | ||
set: | ||
global: | ||
stopAll: true | ||
service: &service | ||
my-service1: | ||
enabled: true | ||
primary: true | ||
type: LoadBalancer | ||
ports: | ||
port-name: | ||
enabled: true | ||
primary: true | ||
port: 12344 | ||
workload: &workload | ||
my-workload: | ||
enabled: true | ||
primary: true | ||
type: Deployment | ||
podSpec: {} | ||
asserts: | ||
- documentIndex: &serviceDoc 1 | ||
isKind: | ||
of: Service | ||
- documentIndex: *serviceDoc | ||
isAPIVersion: | ||
of: v1 | ||
- documentIndex: *serviceDoc | ||
equal: | ||
path: metadata.name | ||
value: test-release-name-common-test | ||
- documentIndex: *serviceDoc | ||
equal: | ||
path: spec.type | ||
value: ClusterIP | ||
|
||
- it: should pass with isStopped (true) | ||
set: | ||
global: | ||
namespace: ix-something | ||
ixChartContext: | ||
storageClassName: some-storage-class | ||
isStopped: true | ||
service: &service | ||
my-service1: | ||
enabled: true | ||
primary: true | ||
type: LoadBalancer | ||
ports: | ||
port-name: | ||
enabled: true | ||
primary: true | ||
port: 12344 | ||
workload: &workload | ||
my-workload: | ||
enabled: true | ||
primary: true | ||
type: Deployment | ||
podSpec: {} | ||
asserts: | ||
- documentIndex: &serviceDoc 1 | ||
isKind: | ||
of: Service | ||
- documentIndex: *serviceDoc | ||
isAPIVersion: | ||
of: v1 | ||
- documentIndex: *serviceDoc | ||
equal: | ||
path: metadata.name | ||
value: test-release-name-common-test | ||
- documentIndex: *serviceDoc | ||
equal: | ||
path: spec.type | ||
value: ClusterIP | ||
|
||
- it: should pass with isStopped (false) | ||
set: | ||
global: | ||
namespace: ix-something | ||
ixChartContext: | ||
storageClassName: some-storage-class | ||
isStopped: false | ||
service: &service | ||
my-service1: | ||
enabled: true | ||
primary: true | ||
type: LoadBalancer | ||
ports: | ||
port-name: | ||
enabled: true | ||
primary: true | ||
port: 12344 | ||
workload: &workload | ||
my-workload: | ||
enabled: true | ||
primary: true | ||
type: Deployment | ||
podSpec: {} | ||
asserts: | ||
- documentIndex: &serviceDoc 1 | ||
isKind: | ||
of: Service | ||
- documentIndex: *serviceDoc | ||
isAPIVersion: | ||
of: v1 | ||
- documentIndex: *serviceDoc | ||
equal: | ||
path: metadata.name | ||
value: test-release-name-common-test | ||
- documentIndex: *serviceDoc | ||
equal: | ||
path: spec.type | ||
value: LoadBalancer |
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 |
---|---|---|
|
@@ -15,4 +15,4 @@ maintainers: | |
name: common | ||
sources: null | ||
type: library | ||
version: 16.2.21 | ||
version: 16.2.22 |
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