diff --git a/pkg/skaffold/sync/sync.go b/pkg/skaffold/sync/sync.go index f04d377ad88..b284f9c8400 100644 --- a/pkg/skaffold/sync/sync.go +++ b/pkg/skaffold/sync/sync.go @@ -161,6 +161,9 @@ func syncMapForArtifact(a *latest.Artifact, insecureRegistries map[string]bool) case a.DockerArtifact != nil: return docker.SyncMap(a.Workspace, a.DockerArtifact.DockerfilePath, a.DockerArtifact.BuildArgs, insecureRegistries) + case a.CustomArtifact != nil && a.CustomArtifact.Dependencies != nil && a.CustomArtifact.Dependencies.Dockerfile != nil: + return docker.SyncMap(a.Workspace, a.CustomArtifact.Dependencies.Dockerfile.Path, a.CustomArtifact.Dependencies.Dockerfile.BuildArgs, insecureRegistries) + case a.KanikoArtifact != nil: return docker.SyncMap(a.Workspace, a.KanikoArtifact.DockerfilePath, a.KanikoArtifact.BuildArgs, insecureRegistries) diff --git a/pkg/skaffold/sync/sync_test.go b/pkg/skaffold/sync/sync_test.go index d247b5e5c98..a31cb238464 100644 --- a/pkg/skaffold/sync/sync_test.go +++ b/pkg/skaffold/sync/sync_test.go @@ -930,6 +930,30 @@ func TestSyncMap(t *testing.T) { }, expectedMap: map[string][]string{"main.go": {"/app/main.go"}}, }, + { + description: "custom - supported", + artifactType: latest.ArtifactType{ + CustomArtifact: &latest.CustomArtifact{ + Dependencies: &latest.CustomDependencies{ + Dockerfile: &latest.DockerfileDependency{ + Path: "Dockerfile", + }, + }, + }, + }, + files: map[string]string{ + "Dockerfile": "FROM alpine\nCOPY *.go /app/", + "main.go": "", + }, + expectedMap: map[string][]string{"main.go": {"/app/main.go"}}, + }, + { + description: "custom, no dockerfile - not supported", + artifactType: latest.ArtifactType{ + CustomArtifact: &latest.CustomArtifact{}, + }, + shouldErr: true, + }, { description: "not supported", artifactType: latest.ArtifactType{},