jenkinsci / jenkinsci/gitlab-plugin

CasC issue with gitLabConnectionConfig : empty connection created

Open
#1,643 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
1.4k
Forks
615
Avg merge
4h 32m
Merged PRs (30d)
10

Description

### Jenkins and plugins versions report

Environment


```text
Paste the output here
```

### What Operating System are you using (both controller, and any agents involved in the problem)?

GitLab Plugin Version 1.8.0

### Reproduction steps

When applying this casc :

```
gitLabConnectionConfig:
connections:
- apiTokenId: {{ .Values.envVars.gitlabId | quote }}
clientBuilderId: "autodetect"
connectionTimeout: 10
ignoreCertificateErrors: false
name: "gitlab"
readTimeout: 10
url: {{ printf "http://%s" .Values.global.principalScmHost | quote }}
useAuthenticatedEndpoint: true
```

an empty connection appears in the configuration .
When exporting the conf-as-code, I can see an added bloc causing the empty connection :

```
gitLabConnectionConfig:
connections:
- apiTokenId: "xxx"
clientBuilderId: "autodetect"
connectionTimeout: 10
ignoreCertificateErrors: false
name: "gitlab"
readTimeout: 10
url: "http://xxxx"
- clientBuilderId: "autodetect"
connectionTimeout: 10
ignoreCertificateErrors: false
readTimeout: 10
useAuthenticatedEndpoint: true
```

### Expected Results

i don't want this added :

```
- clientBuilderId: "autodetect"
connectionTimeout: 10
ignoreCertificateErrors: false
readTimeout: 10
useAuthenticatedEndpoint: true
```

### Actual Results

```
gitLabConnectionConfig:
connections:
- apiTokenId: "xxx"
clientBuilderId: "autodetect"
connectionTimeout: 10
ignoreCertificateErrors: false
name: "gitlab"
readTimeout: 10
url: "http://xxxx"
- clientBuilderId: "autodetect"
connectionTimeout: 10
ignoreCertificateErrors: false
readTimeout: 10
useAuthenticatedEndpoint: true
```

### Anything else?

_No response_

### Are you interested in contributing a fix?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.