#552 Seed Jobs: Don't Validate "external" Credential Type (#556)

* Don't validate external credential type

The operator shouldn't try to fetch credentials that have their types
defined as `external` - that means that credentials are supplied
externally, without using k8s secrets.

* Docs: Add example of `external` credential type
This commit is contained in:
Piotr Ryba
2021-05-05 09:27:43 +02:00
committed by GitHub
parent 332c08ccf2
commit 41dac85ea1
3 changed files with 43 additions and 2 deletions
+1 -2
View File
@@ -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)