Skip to content

Commit 8046d36

Browse files
authored
Merge pull request #43 from cloudogu/feature/disable-yamllint
disable yamllint and updating docs
2 parents 4a5e0fb + 7d5b802 commit 8046d36

File tree

4 files changed

+18
-12
lines changed

4 files changed

+18
-12
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Changed
11+
- Disable yamllint image due to image is not longer maintained
12+
1013
## [0.6.0](https://github.com/cloudogu/gitops-build-lib/releases/tag/0.6.0) - 2024-08-26
1114

1215
### Changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -774,10 +774,10 @@ class GitHub extends SCMProvider {
774774
## Validators
775775

776776
The library itself provides three validators `yamllint`, `kubeval` and `helmKubeval` to validate the generated resources.
777-
You can disable the built-in operators and/or add your own.
777+
You can enable the built-in operators and/or add your own.
778778
The operators are processed sequentially in no particular order.
779779

780-
Example: Disable all built-ins and add a custom validator.
780+
Example: Enable `yamllint`, `kubeval` and add a custom validator.
781781

782782
```groovy
783783
node {
@@ -787,10 +787,10 @@ node {
787787
// ...
788788
validators : [
789789
yamllint: [
790-
enabled : false,
790+
enabled : enable,
791791
],
792792
kubeval: [
793-
enabled : false,
793+
enabled : enable,
794794
],
795795
myVali: [
796796
validator: new MyValidator(this),

test/com/cloudogu/gitopsbuildlib/DeployViaGitopsTest.groovy

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class DeployViaGitopsTest extends BasePipelineTest {
5959
validators : [
6060
kubeval : [
6161
validator: new Kubeval(deployViaGitops),
62-
enabled : true,
62+
enabled : false,
6363
config : [
6464
// We use the helm image (that also contains kubeval plugin) to speed up builds by allowing to reuse image
6565
image : 'ghcr.io/cloudogu/helm:3.4.1-1',
@@ -68,7 +68,7 @@ class DeployViaGitopsTest extends BasePipelineTest {
6868
],
6969
yamllint: [
7070
validator: new Yamllint(deployViaGitops),
71-
enabled : true,
71+
enabled : false,
7272
config : [
7373
image : 'cytopia/yamllint:1.25-0.9',
7474
// Default to relaxed profile because it's feasible for mere mortalYAML programmers.
@@ -221,10 +221,10 @@ spec:
221221

222222

223223
@Test
224-
void 'default validator can be disabled'() {
224+
void 'default validator can be enabled'() {
225225

226226
deployViaGitops.metaClass.validateConfig = { Map actualGitOpsConfig ->
227-
assertThat(actualGitOpsConfig.validators.kubeval.enabled).isEqualTo(false)
227+
assertThat(actualGitOpsConfig.validators.kubeval.enabled).isEqualTo(true)
228228
assertThat(actualGitOpsConfig.validators.kubeval.validator).isNotNull()
229229
assertThat(actualGitOpsConfig.validators.yamllint.enabled).isEqualTo(true)
230230
}
@@ -233,7 +233,10 @@ spec:
233233
deployViaGitops([
234234
validators: [
235235
kubeval: [
236-
enabled: false
236+
enabled: true
237+
],
238+
yamllint: [
239+
enabled: true
237240
]
238241
]
239242
])
@@ -244,8 +247,7 @@ spec:
244247

245248
deployViaGitops.metaClass.validateConfig = { Map actualGitOpsConfig ->
246249
assertThat(actualGitOpsConfig.validators.myVali.config.a).isEqualTo('b')
247-
assertThat(actualGitOpsConfig.validators.yamllint.enabled).isEqualTo(true)
248-
assertThat(actualGitOpsConfig.validators.yamllint.enabled).isEqualTo(true)
250+
assertThat(actualGitOpsConfig.validators.myVali.enabled).isEqualTo(true)
249251
}
250252
deployViaGitops.metaClass.deploy = {Map actualGitOpsConfig ->} // Stop after validation
251253

vars/deployViaGitops.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ Map createDefaultConfig(String k8sVersion) {
7878
],
7979
yamllint : [
8080
validator: new Yamllint(this),
81-
enabled : true,
81+
//disabled due to image is not longer maintained
82+
enabled : false,
8283
config : [
8384
imageRef : 'yamllint',
8485
// Default to relaxed profile because it's feasible for mere mortalYAML programmers.

0 commit comments

Comments
 (0)