Skip to content

Commit 25a1907

Browse files
gsquared94tejal29
authored andcommitted
fix: apply cmd should run kubectl create --dry-run to get the ManifestList (#6875)
1 parent e9c900f commit 25a1907

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

integration/apply_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ func TestApplyStatusCheckFailure(t *testing.T) {
9595
description: "status check for config connector resources",
9696
profile: "configconnector",
9797
},
98+
{
99+
description: "status check for standalone pods",
100+
profile: "pod",
101+
},
98102
}
99103
for _, test := range tests {
100104
testutil.Run(t, test.description, func(t *testutil.T) {

integration/testdata/apply/pod.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: zz-image-doesnt-exist
5+
spec:
6+
containers:
7+
- image: zz-image-doesnt-exist
8+
name: apply-status-check-failure

integration/testdata/apply/skaffold.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@ profiles:
1414
kubectl:
1515
statusCheckDeadlineSeconds: 10
1616
manifests: ["configconnector.yaml"]
17+
- name: pod
18+
deploy:
19+
kubectl:
20+
manifests: ["pod.yaml"]

pkg/skaffold/deploy/kubectl/kubectl.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ func (k *Deployer) Deploy(ctx context.Context, out io.Writer, builds []graph.Art
180180
// also, manually set the labels to ensure the runID is added
181181
switch {
182182
case len(k.hydratedManifests) > 0:
183-
_, endTrace = instrumentation.StartTrace(ctx, "Deploy_createManifestList")
184-
manifests, err = createManifestList(k.hydratedManifests)
183+
_, endTrace = instrumentation.StartTrace(ctx, "Deploy_readHydratedManifests")
184+
manifests, err = k.kubectl.ReadManifests(ctx, k.hydratedManifests)
185185
if err != nil {
186186
endTrace(instrumentation.TraceEndError(err))
187187
return err

0 commit comments

Comments
 (0)