Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pipeline compiler should not alter specified image #1005

Merged
merged 4 commits into from
Aug 26, 2022
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions pipeline/frontend/yaml/compiler/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ func (c *Compiler) createProcess(name string, container *yaml.Container, section
privileged = container.Privileged
entrypoint = container.Entrypoint
command = container.Command
image = expandImage(container.Image)
networkMode = container.NetworkMode
ipcMode = container.IpcMode
// network = container.Network
Expand Down Expand Up @@ -105,7 +104,7 @@ func (c *Compiler) createProcess(name string, container *yaml.Container, section
Email: container.AuthConfig.Email,
}
for _, registry := range c.registries {
if matchHostname(image, registry.Hostname) {
if matchHostname(container.Image, registry.Hostname) {
authConfig.Username = registry.Username
authConfig.Password = registry.Password
authConfig.Email = registry.Email
Expand All @@ -115,7 +114,7 @@ func (c *Compiler) createProcess(name string, container *yaml.Container, section

for _, requested := range container.Secrets.Secrets {
secret, ok := c.secrets[strings.ToLower(requested.Source)]
if ok && (len(secret.Match) == 0 || matchImage(image, secret.Match...)) {
if ok && (len(secret.Match) == 0 || matchImage(container.Image, secret.Match...)) {
environment[strings.ToUpper(requested.Target)] = secret.Value
}
}
Expand Down Expand Up @@ -154,7 +153,7 @@ func (c *Compiler) createProcess(name string, container *yaml.Container, section
return &backend.Step{
Name: name,
Alias: container.Name,
Image: image,
Image: container.Image,
Pull: container.Pull,
Detached: detached,
Privileged: privileged,
Expand Down