mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-26 20:01:02 +00:00
removed default image namespacing
This commit is contained in:
parent
778971eb68
commit
9f937e2425
3 changed files with 1 additions and 25 deletions
|
@ -154,8 +154,6 @@ func (a *Agent) prep(w *model.Work) (*yaml.Config, error) {
|
|||
transform.CommandTransform(conf)
|
||||
transform.ImagePull(conf, a.Pull)
|
||||
transform.ImageTag(conf)
|
||||
transform.ImageName(conf)
|
||||
transform.ImageNamespace(conf, a.Namespace)
|
||||
if err := transform.ImageEscalate(conf, a.Escalate); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ const clone = "clone"
|
|||
// Clone transforms the Yaml to include a clone step.
|
||||
func Clone(c *yaml.Config, plugin string) error {
|
||||
if plugin == "" {
|
||||
plugin = "git"
|
||||
plugin = "plugins/git"
|
||||
}
|
||||
|
||||
for _, p := range c.Pipeline {
|
||||
|
|
|
@ -34,28 +34,6 @@ func ImageTag(conf *yaml.Config) error {
|
|||
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
|
||||
// for a subset of white-listed plugins matching the given patterns.
|
||||
func ImageEscalate(conf *yaml.Config, patterns []string) error {
|
||||
|
|
Loading…
Reference in a new issue