Add dns config option to official feature set (#4418)

Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
This commit is contained in:
6543
2024-11-25 17:59:00 +01:00
committed by GitHub
parent 5d750322bc
commit ebf9f9ccbb
4 changed files with 81 additions and 56 deletions

View File

@@ -162,6 +162,16 @@ func podSpec(step *types.Step, config *config, options BackendOptions, nsp nativ
return spec, err
}
if len(step.DNS) != 0 || len(step.DNSSearch) != 0 {
spec.DNSConfig = &v1.PodDNSConfig{}
if len(step.DNS) != 0 {
spec.DNSConfig.Nameservers = step.DNS
}
if len(step.DNSSearch) != 0 {
spec.DNSConfig.Searches = step.DNSSearch
}
}
log.Trace().Msgf("using the image pull secrets: %v", config.ImagePullSecretNames)
spec.ImagePullSecrets = secretsReferences(config.ImagePullSecretNames)
if needsRegistrySecret(step) {