diff --git a/pkg/configuration/user/seedjobs/validate.go b/pkg/configuration/user/seedjobs/validate.go index 7944cd6d..5e656bd3 100644 --- a/pkg/configuration/user/seedjobs/validate.go +++ b/pkg/configuration/user/seedjobs/validate.go @@ -55,8 +55,7 @@ func (s *seedJobs) ValidateSeedJobs(jenkins v1alpha2.Jenkins) ([]string, error) } if seedJob.JenkinsCredentialType == v1alpha2.BasicSSHCredentialType || - seedJob.JenkinsCredentialType == v1alpha2.UsernamePasswordCredentialType || - seedJob.JenkinsCredentialType == v1alpha2.ExternalCredentialType { + seedJob.JenkinsCredentialType == v1alpha2.UsernamePasswordCredentialType { secret := &v1.Secret{} namespaceName := types.NamespacedName{Namespace: jenkins.Namespace, Name: seedJob.CredentialID} err := s.Client.Get(context.TODO(), namespaceName, secret) diff --git a/website/content/en/docs/Getting Started/Preview/configuration.md b/website/content/en/docs/Getting Started/Preview/configuration.md index 19721edd..f3c4b8a7 100644 --- a/website/content/en/docs/Getting Started/Preview/configuration.md +++ b/website/content/en/docs/Getting Started/Preview/configuration.md @@ -221,6 +221,26 @@ stringData: ### External authentication You can use `external` credential type if you want to configure authentication using Configuration As Code or Groovy Script. +Example: +```yaml +apiVersion: jenkins.io/v1alpha2 +kind: Jenkins +metadata: + name: example +spec: + seedJobs: + - id: jenkins-operator-external + credentialType: external + credentialID: k8s-external + targets: "cicd/jobs/*.jenkins" + description: "Jenkins Operator repository" + repositoryBranch: master + repositoryUrl: https://github.com/jenkinsci/kubernetes-operator.git +``` + +Remember that `credentialID` must match the id of the credentials configured in Jenkins. Consult the +[Jenkins docs for using credentials][jenkins-using-credentials] for details. + ## HTTP Proxy for downloading plugins To use forwarding proxy with an operator to download plugins you need to add the following environment variable to Jenkins Custom Resource (CR), e.g.: @@ -313,3 +333,4 @@ Example config file to modify and use: [job-dsl]:https://github.com/jenkinsci/job-dsl-plugin [kubernetes-credentials-provider]:https://jenkinsci.github.io/kubernetes-credentials-provider-plugin/ +[jenkins-using-credentials]:https://www.jenkins.io/doc/book/using/using-credentials/ diff --git a/website/content/en/docs/Getting Started/latest/configuration.md b/website/content/en/docs/Getting Started/latest/configuration.md index fee5aeb9..439a0de8 100644 --- a/website/content/en/docs/Getting Started/latest/configuration.md +++ b/website/content/en/docs/Getting Started/latest/configuration.md @@ -221,6 +221,26 @@ stringData: ### External authentication You can use `external` credential type if you want to configure authentication using Configuration As Code or Groovy Script. +Example: +```yaml +apiVersion: jenkins.io/v1alpha2 +kind: Jenkins +metadata: + name: example +spec: + seedJobs: + - id: jenkins-operator-external + credentialType: external + credentialID: k8s-external + targets: "cicd/jobs/*.jenkins" + description: "Jenkins Operator repository" + repositoryBranch: master + repositoryUrl: https://github.com/jenkinsci/kubernetes-operator.git +``` + +Remember that `credentialID` must match the id of the credentials configured in Jenkins. Consult the +[Jenkins docs for using credentials][jenkins-using-credentials] for details. + ## HTTP Proxy for downloading plugins To use forwarding proxy with an operator to download plugins you need to add the following environment variable to Jenkins Custom Resource (CR), e.g.: @@ -313,3 +333,4 @@ Example config file to modify and use: [job-dsl]:https://github.com/jenkinsci/job-dsl-plugin [kubernetes-credentials-provider]:https://jenkinsci.github.io/kubernetes-credentials-provider-plugin/ +[jenkins-using-credentials]:https://www.jenkins.io/doc/book/using/using-credentials/