mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-01-05 10:20:36 +02:00
removed default image namespacing
This commit is contained in:
parent
778971eb68
commit
9f937e2425
@ -154,8 +154,6 @@ func (a *Agent) prep(w *model.Work) (*yaml.Config, error) {
|
|||||||
transform.CommandTransform(conf)
|
transform.CommandTransform(conf)
|
||||||
transform.ImagePull(conf, a.Pull)
|
transform.ImagePull(conf, a.Pull)
|
||||||
transform.ImageTag(conf)
|
transform.ImageTag(conf)
|
||||||
transform.ImageName(conf)
|
|
||||||
transform.ImageNamespace(conf, a.Namespace)
|
|
||||||
if err := transform.ImageEscalate(conf, a.Escalate); err != nil {
|
if err := transform.ImageEscalate(conf, a.Escalate); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ const clone = "clone"
|
|||||||
// Clone transforms the Yaml to include a clone step.
|
// Clone transforms the Yaml to include a clone step.
|
||||||
func Clone(c *yaml.Config, plugin string) error {
|
func Clone(c *yaml.Config, plugin string) error {
|
||||||
if plugin == "" {
|
if plugin == "" {
|
||||||
plugin = "git"
|
plugin = "plugins/git"
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, p := range c.Pipeline {
|
for _, p := range c.Pipeline {
|
||||||
|
@ -34,28 +34,6 @@ func ImageTag(conf *yaml.Config) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ImageName transforms the Yaml to replace underscores with dashes.
|
|
||||||
func ImageName(conf *yaml.Config) error {
|
|
||||||
for _, image := range conf.Pipeline {
|
|
||||||
image.Image = strings.Replace(image.Image, "_", "-", -1)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ImageNamespace transforms the Yaml to use a default namepsace for plugins.
|
|
||||||
func ImageNamespace(conf *yaml.Config, namespace string) error {
|
|
||||||
for _, image := range conf.Pipeline {
|
|
||||||
if strings.Contains(image.Image, "/") {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if !isPlugin(image) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
image.Image = filepath.Join(namespace, image.Image)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ImageEscalate transforms the Yaml to automatically enable privileged mode
|
// ImageEscalate transforms the Yaml to automatically enable privileged mode
|
||||||
// for a subset of white-listed plugins matching the given patterns.
|
// for a subset of white-listed plugins matching the given patterns.
|
||||||
func ImageEscalate(conf *yaml.Config, patterns []string) error {
|
func ImageEscalate(conf *yaml.Config, patterns []string) error {
|
||||||
|
Loading…
Reference in New Issue
Block a user