Skip to content

Commit

Permalink
feat: add support for usageRestricted and skipTlsVerify (#1159)
Browse files Browse the repository at this point in the history
Co-authored-by: l.tiozzo <[email protected]>
  • Loading branch information
sistemi-iungo and l.tiozzo authored Jul 30, 2024
1 parent b2a28e5 commit 46d447a
Show file tree
Hide file tree
Showing 7 changed files with 520 additions and 127 deletions.
5 changes: 5 additions & 0 deletions charts/jenkins/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ Use the following links to reference issues, PRs, and commits prior to v2.6.0.
The changelog until v1.5.7 was auto-generated based on git commits.
Those entries include a reference to the git commit to be able to get more details.

## 5.5.0

Introduce capability of set skipTlsVerify and usageRestricted flags in additionalClouds


## 5.4.4

Update CHANGELOG.md, README.md, and UPGRADING.md for linting
Expand Down
2 changes: 1 addition & 1 deletion charts/jenkins/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: jenkins
type: application
home: https://www.jenkins.io/
version: 5.4.4
version: 5.5.0
appVersion: 2.452.3
description: >
Jenkins - Build great things at any scale! As the leading open source automation server, Jenkins provides over 1800 plugins to support building, deploying and automating any project.
Expand Down
176 changes: 89 additions & 87 deletions charts/jenkins/VALUES.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions charts/jenkins/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ jenkins:
webSocket: true
{{- end }}
{{- end }}
skipTlsVerify: {{ .Values.agent.skipTlsVerify | default false}}
usageRestricted: {{ .Values.agent.usageRestricted | default false}}
maxRequestsPerHostStr: {{ .Values.agent.maxRequestsPerHostStr | quote }}
retentionTimeout: {{ .Values.agent.retentionTimeout | quote }}
waitForPodSec: {{ .Values.agent.waitForPodSec | quote }}
Expand Down Expand Up @@ -248,6 +250,8 @@ jenkins:
webSocket: true
{{- end }}
{{- end }}
skipTlsVerify: {{ .Values.agent.skipTlsVerify | default false}}
usageRestricted: {{ .Values.agent.usageRestricted | default false}}
maxRequestsPerHostStr: {{ .Values.agent.maxRequestsPerHostStr | quote }}
retentionTimeout: {{ .Values.agent.retentionTimeout | quote }}
waitForPodSec: {{ .Values.agent.waitForPodSec | quote }}
Expand Down
412 changes: 373 additions & 39 deletions charts/jenkins/unittests/__snapshot__/jcasc-config-test.yaml.snap

Large diffs are not rendered by default.

44 changes: 44 additions & 0 deletions charts/jenkins/unittests/jcasc-config-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -765,3 +765,47 @@ tests:
value:
jenkins.example.com/anno1: "custom-annotation"
jenkins.example.com/anno2: "another-annotation"
- it: additional clouds set skipTlsVerify
set:
additionalClouds:
remote-cloud-1:
kubernetesURL: https://api.remote-cloud.com
credentialsId: "remote-cloud-token"
agent:
skipTlsVerify: true
release:
namespace: default
asserts:
- isKind:
of: ConfigMap
- hasDocuments:
count: 1
- isNotEmpty:
path: data["jcasc-default-config.yaml"]
- matchRegex:
path: metadata.labels["helm.sh/chart"]
pattern: ^jenkins-
- matchSnapshot:
path: data["jcasc-default-config.yaml"]
- it: additional clouds set usageRestricted
set:
additionalClouds:
remote-cloud-1:
kubernetesURL: https://api.remote-cloud.com
credentialsId: "remote-cloud-token"
agent:
usageRestricted: true
release:
namespace: default
asserts:
- isKind:
of: ConfigMap
- hasDocuments:
count: 1
- isNotEmpty:
path: data["jcasc-default-config.yaml"]
- matchRegex:
path: metadata.labels["helm.sh/chart"]
pattern: ^jenkins-
- matchSnapshot:
path: data["jcasc-default-config.yaml"]
4 changes: 4 additions & 0 deletions charts/jenkins/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,10 @@ agent:
# connects to the specified host and port, instead of connecting directly to the Jenkins controller
# -- Overrides the Kubernetes Jenkins tunnel
jenkinsTunnel:
# -- Disables the verification of the controller certificate on remote connection. This flag correspond to the "Disable https certificate check" flag in kubernetes plugin UI
skipTlsVerify: false
# -- Enable the possibility to restrict the usage of this agent to specific folder. This flag correspond to the "Restrict pipeline support to authorized folders" flag in kubernetes plugin UI
usageRestricted: false
# -- The connection timeout in seconds for connections to Kubernetes API. The minimum value is 5
kubernetesConnectTimeout: 5
# -- The read timeout in seconds for connections to Kubernetes API. The minimum value is 15
Expand Down

0 comments on commit 46d447a

Please sign in to comment.