Skip to content

Commit

Permalink
fix: apply cmd should run kubectl create --dry-run to get the `Mani…
Browse files Browse the repository at this point in the history
…festList` (#6875)
  • Loading branch information
gsquared94 authored and tejal29 committed Nov 18, 2021
1 parent e9c900f commit 25a1907
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions integration/apply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ func TestApplyStatusCheckFailure(t *testing.T) {
description: "status check for config connector resources",
profile: "configconnector",
},
{
description: "status check for standalone pods",
profile: "pod",
},
}
for _, test := range tests {
testutil.Run(t, test.description, func(t *testutil.T) {
Expand Down
8 changes: 8 additions & 0 deletions integration/testdata/apply/pod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: Pod
metadata:
name: zz-image-doesnt-exist
spec:
containers:
- image: zz-image-doesnt-exist
name: apply-status-check-failure
4 changes: 4 additions & 0 deletions integration/testdata/apply/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ profiles:
kubectl:
statusCheckDeadlineSeconds: 10
manifests: ["configconnector.yaml"]
- name: pod
deploy:
kubectl:
manifests: ["pod.yaml"]
4 changes: 2 additions & 2 deletions pkg/skaffold/deploy/kubectl/kubectl.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ func (k *Deployer) Deploy(ctx context.Context, out io.Writer, builds []graph.Art
// also, manually set the labels to ensure the runID is added
switch {
case len(k.hydratedManifests) > 0:
_, endTrace = instrumentation.StartTrace(ctx, "Deploy_createManifestList")
manifests, err = createManifestList(k.hydratedManifests)
_, endTrace = instrumentation.StartTrace(ctx, "Deploy_readHydratedManifests")
manifests, err = k.kubectl.ReadManifests(ctx, k.hydratedManifests)
if err != nil {
endTrace(instrumentation.TraceEndError(err))
return err
Expand Down

0 comments on commit 25a1907

Please sign in to comment.