@@ -31,10 +31,10 @@ import (
31
31
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
32
32
)
33
33
34
- func (b * Builder ) run (ctx context.Context , out io.Writer , artifact * latest.Artifact , cfg * latest. KanikoBuild ) (string , error ) {
34
+ func (b * Builder ) run (ctx context.Context , out io.Writer , artifact * latest.Artifact ) (string , error ) {
35
35
initialTag := util .RandomID ()
36
36
37
- s := sources .Retrieve (cfg )
37
+ s := sources .Retrieve (b . KanikoBuild )
38
38
context , err := s .Setup (ctx , out , artifact , initialTag )
39
39
if err != nil {
40
40
return "" , errors .Wrap (err , "setting up build context" )
@@ -52,17 +52,17 @@ func (b *Builder) run(ctx context.Context, out io.Writer, artifact *latest.Artif
52
52
fmt .Sprintf ("--context=%s" , context ),
53
53
fmt .Sprintf ("--destination=%s" , imageDst ),
54
54
fmt .Sprintf ("-v=%s" , logLevel ().String ())}
55
- args = append (args , cfg .AdditionalFlags ... )
55
+ args = append (args , b .AdditionalFlags ... )
56
56
args = append (args , docker .GetBuildArgs (artifact .DockerArtifact )... )
57
57
58
- if cfg .Cache != nil {
58
+ if b .Cache != nil {
59
59
args = append (args , "--cache=true" )
60
- if cfg .Cache .Repo != "" {
61
- args = append (args , fmt .Sprintf ("--cache-repo=%s" , cfg .Cache .Repo ))
60
+ if b .Cache .Repo != "" {
61
+ args = append (args , fmt .Sprintf ("--cache-repo=%s" , b .Cache .Repo ))
62
62
}
63
63
}
64
64
65
- pods := client .CoreV1 ().Pods (cfg .Namespace )
65
+ pods := client .CoreV1 ().Pods (b .Namespace )
66
66
p , err := pods .Create (s .Pod (args ))
67
67
if err != nil {
68
68
return "" , errors .Wrap (err , "creating kaniko pod" )
0 commit comments