Update module github.com/openshift/imagebuilder to v1.2.15

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This commit is contained in:
renovate[bot]
2024-08-22 15:57:06 +00:00
committed by GitHub
parent 77f5b4d678
commit 215af114ab
43 changed files with 1378 additions and 371 deletions

View File

@ -6,7 +6,7 @@ services:
- docker
go:
- "1.20"
- "1.21.13"
before_install:
- sudo systemctl stop docker.service && sudo systemctl stop docker.socket

View File

@ -18,9 +18,10 @@ import (
docker "github.com/fsouza/go-dockerclient"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/platforms"
"github.com/containerd/errdefs"
"github.com/containerd/platforms"
"github.com/containers/storage/pkg/regexp"
"github.com/openshift/imagebuilder/internal"
"github.com/openshift/imagebuilder/signal"
"github.com/openshift/imagebuilder/strslice"
@ -143,7 +144,7 @@ func processHereDocs(instruction, originalInstruction string, heredocs []buildki
shlex := buildkitshell.NewLex('\\')
shlex.RawQuotes = true
shlex.RawEscapes = true
content, err = shlex.ProcessWord(content, args)
content, _, err = shlex.ProcessWord(content, internal.EnvironmentSlice(args))
if err != nil {
return nil, err
}

View File

@ -18,6 +18,7 @@ import (
buildkitparser "github.com/moby/buildkit/frontend/dockerfile/parser"
buildkitshell "github.com/moby/buildkit/frontend/dockerfile/shell"
"github.com/openshift/imagebuilder/dockerfile/command"
"github.com/openshift/imagebuilder/internal"
)
// Node is a structure used to represent a parse tree.
@ -408,7 +409,7 @@ func heredocsFromLine(line string) ([]buildkitparser.Heredoc, error) {
shlex.RawQuotes = true
shlex.RawEscapes = true
shlex.SkipUnsetEnv = true
words, _ := shlex.ProcessWords(line, []string{})
words, _ := shlex.ProcessWords(line, internal.EnvironmentSlice([]string{}))
var docs []buildkitparser.Heredoc
for _, word := range words {

View File

@ -12,7 +12,7 @@
#
%global golang_version 1.19
%{!?version: %global version 1.2.14}
%{!?version: %global version 1.2.15}
%{!?release: %global release 1}
%global package_name imagebuilder
%global product_name Container Image Builder

View File

@ -0,0 +1,23 @@
package internal
import "strings"
type EnvironmentSlice []string
func (e EnvironmentSlice) Keys() []string {
keys := make([]string, 0, len(e))
for _, kv := range e {
k, _, _ := strings.Cut(kv, "=")
keys = append(keys, k)
}
return keys
}
func (e EnvironmentSlice) Get(key string) (string, bool) {
for _, kv := range e {
if k, v, ok := strings.Cut(kv, "="); ok && k == key {
return v, true
}
}
return "", false
}