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

fix: change error to warning for build platform mismatch with cluster node platform #7402

Merged
merged 1 commit into from
May 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/skaffold/platform/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func NewResolver(ctx context.Context, pipelines []latest.Pipeline, cliPlatformsS
} else if p := platforms.Intersect(fromClusterNodes); p.IsNotEmpty() {
platforms = p
} else {
return r, fmt.Errorf("build target platforms %q do not match active kubernetes cluster node platforms %q", platforms, fromClusterNodes)
log.Entry(ctx).Warnf("build target platforms %q do not match active kubernetes cluster node platforms %q", platforms, fromClusterNodes)
}
}
instrumentation.AddResolvedBuildTargetPlatforms(platforms.String())
Expand Down
7 changes: 5 additions & 2 deletions pkg/skaffold/platform/resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@ func TestResolver(t *testing.T) {
pipelines: []latest.Pipeline{{Build: latest.BuildConfig{
Platforms: []string{"windows/amd64"},
Artifacts: []*latest.Artifact{{ImageName: "img1"}, {ImageName: "img2"}}}}},
runMode: config.RunModes.Dev,
shouldErr: true,
runMode: config.RunModes.Dev,
expected: map[string]Matcher{
"img1": {Platforms: []v1.Platform{{OS: "linux", Architecture: "amd64"}, {OS: "linux", Architecture: "386"}}},
"img2": {Platforms: []v1.Platform{{OS: "linux", Architecture: "amd64"}, {OS: "linux", Architecture: "386"}}},
},
},
{
description: "cluster platform selected for `dev` mode",
Expand Down