Skip to content

feat: allow specifying debug runtime in skaffold.yaml for artifact - #8295

Merged
gsquared94 merged 1 commit into
GoogleContainerTools:mainfrom
gsquared94:fix-2203
Jan 4, 2023
Merged

feat: allow specifying debug runtime in skaffold.yaml for artifact#8295
gsquared94 merged 1 commit into
GoogleContainerTools:mainfrom
gsquared94:fix-2203

Conversation

@gsquared94

Copy link
Copy Markdown
Contributor

Fixes: #2203

Description

Allow specifying the debug runtime for artifacts in skaffold.yaml.

Testing instructions
In the integration/examples/getting-started project:

  1. Modify the Dockerfile by deleting line 12 ( ENV GOTRACEBACK=single).
  2. Run skaffold debug -v DEBUG.
  3. Search the output for the text Image "getting-started" not configured for debugging: unable to determine runtime. This implies that Skaffold couldn't identify the language runtime for this artifact for debug.
  4. Now modify the skaffold.yaml file to:
apiVersion: skaffold/v4beta1
kind: Config
build:
  artifacts:
  - image: skaffold-example
    runtimeType: go     # added runtime type explicitly
manifests:
  rawYaml:
  - k8s-pod.yaml
  1. Run skaffold debug -v DEBUG again.
  2. Search the output for the text Artifact "skaffold-example" has Go runtime: specified by user in skaffold config. This implies that Skaffold was able to identify Golang as the language runtime for this artifact for debug.

@gsquared94
gsquared94 requested a review from a team as a code owner January 4, 2023 11:09
@gsquared94
gsquared94 requested review from aaron-prindle and removed request for briandealwis January 4, 2023 11:09
@codecov

codecov Bot commented Jan 4, 2023

Copy link
Copy Markdown

Codecov Report

Merging #8295 (ba56b71) into main (290280e) will decrease coverage by 4.42%.
The diff coverage is 54.96%.

@@            Coverage Diff             @@
##             main    #8295      +/-   ##
==========================================
- Coverage   70.48%   66.06%   -4.43%     
==========================================
  Files         515      603      +88     
  Lines       23150    29556    +6406     
==========================================
+ Hits        16317    19525    +3208     
- Misses       5776     8567    +2791     
- Partials     1057     1464     +407     
Impacted Files Coverage Δ
cmd/skaffold/app/cmd/completion.go 13.04% <0.00%> (-1.25%) ⬇️
cmd/skaffold/app/cmd/config/list.go 65.21% <ø> (ø)
cmd/skaffold/app/cmd/config/set.go 88.72% <ø> (ø)
cmd/skaffold/app/cmd/config/util.go 54.28% <ø> (ø)
cmd/skaffold/app/cmd/credits.go 100.00% <ø> (ø)
cmd/skaffold/app/cmd/credits/export.go 0.00% <0.00%> (ø)
cmd/skaffold/app/cmd/deploy.go 40.90% <0.00%> (-12.94%) ⬇️
cmd/skaffold/app/cmd/generate_pipeline.go 60.00% <ø> (ø)
cmd/skaffold/app/cmd/inspect_modules.go 65.00% <ø> (ø)
cmd/skaffold/app/cmd/inspect_profiles.go 66.66% <ø> (ø)
... and 413 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@aaron-prindle

Copy link
Copy Markdown
Contributor

Seems there is gofmt errors:

Gofmt errors in files:
./pkg/skaffold/runner/build.go
diff ./pkg/skaffold/runner/build.go.orig ./pkg/skaffold/runner/build.go
--- ./pkg/skaffold/runner/build.go.orig
+++ ./pkg/skaffold/runner/build.go
@@ -[13](https://github.com/GoogleContainerTools/skaffold/actions/runs/3837457153/jobs/6532785477#step:4:14)9,8 +139,8 @@
 	var bRes []graph.Artifact
 	for _, artifact := range artifacts {
 		bRes = append(bRes, graph.Artifact{
-			ImageName: artifact.ImageName,
-			Tag:       tags[artifact.ImageName],
+			ImageName:   artifact.ImageName,
+			Tag:         tags[artifact.ImageName],
 			RuntimeType: artifact.RuntimeType,
 		})
 	}
FAILED hack/gofmt.sh

@aaron-prindle aaron-prindle left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@gsquared94
gsquared94 merged commit bcb5945 into GoogleContainerTools:main Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide mechanism to indicate language runtime type for an artifact

2 participants