mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-04-28 03:30:58 +00:00
Replace illegal characters in Kubernetes labels (#5013)
Co-authored-by: Robert Kaussow <xoxys@rknet.org>
This commit is contained in:
parent
d05b1287aa
commit
c392250384
@ -108,7 +108,10 @@ func podLabels(step *types.Step, config *config, options BackendOptions) (map[st
|
||||
// Only copy user labels if allowed by agent config.
|
||||
// Internal labels are filtered on the server-side.
|
||||
if config.PodLabelsAllowFromStep || strings.HasPrefix(k, pipeline.InternalLabelPrefix) {
|
||||
labels[k] = v
|
||||
labels[k], err = toDNSName(v)
|
||||
if err != nil {
|
||||
return labels, err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -260,7 +260,10 @@ func registrySecretLabels(step *types.Step, config *config) (map[string]string,
|
||||
// Only copy user labels if allowed by agent config.
|
||||
// Internal labels are filtered on the server-side.
|
||||
if config.PodLabelsAllowFromStep || strings.HasPrefix(k, pipeline.InternalLabelPrefix) {
|
||||
labels[k] = v
|
||||
labels[k], err = toDNSName(v)
|
||||
if err != nil {
|
||||
return labels, err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user