check all artifacts for kaniko dependency
@@ -76,9 +76,10 @@ func generateBuildTask(configFile *ConfigFile) (*tekton.Task, error) {
},
}
- // Add secret volume mounting for artifacts that need to be built with kaniko
+ // Add secret volume mounting if any artifacts in config need to be built with kaniko
var volumes []corev1.Volume
- if buildConfig.Artifacts[0].KanikoArtifact != nil {
+ for _, artifact := range buildConfig.Artifacts {
+ if artifact.KanikoArtifact != nil {
volumes = []corev1.Volume{
{
Name: kanikoSecretName,
@@ -102,6 +103,7 @@ func generateBuildTask(configFile *ConfigFile) (*tekton.Task, error) {
},
}
}
+ }
return pipeline.NewTask("skaffold-build", inputs, outputs, steps, volumes), nil
}
