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

Add prompt for users to pick manifests to generate during skaffold init --generate-manifests #5312

Merged

Conversation

MarlonGamez
Copy link
Contributor

Fixes: #5310

Description
This adds a new prompt to let users select which kubernetes manifests they'd like to create when running skaffold init --generate-manifests

User facing changes (remove if N/A)
Users will see a new prompt when running init with --generate-manifests that looks like this

? Which builders would you like to create kubernetes resources for?  [Use arrows to move, space to select, <right> to all, <left> to none, type to filter]
> [ ]  Docker (base/Dockerfile)
  [ ]  Docker (leeroy-app/Dockerfile)
  [ ]  Docker (leeroy-web/Dockerfile)

@pull-request-size pull-request-size bot added size/M and removed size/S labels Jan 27, 2021
@codecov
Copy link

codecov bot commented Jan 27, 2021

Codecov Report

Merging #5312 (951abc1) into master (bb30c10) will increase coverage by 0.05%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5312      +/-   ##
==========================================
+ Coverage   71.79%   71.84%   +0.05%     
==========================================
  Files         390      390              
  Lines       14202    14213      +11     
==========================================
+ Hits        10196    10212      +16     
+ Misses       3255     3253       -2     
+ Partials      751      748       -3     
Impacted Files Coverage Δ
pkg/skaffold/initializer/build/resolve.go 77.33% <33.33%> (-1.84%) ⬇️
pkg/skaffold/initializer/prompt/prompt.go 71.18% <100.00%> (+4.51%) ⬆️
pkg/skaffold/docker/image.go 79.53% <0.00%> (+1.39%) ⬆️
pkg/skaffold/util/tar.go 56.00% <0.00%> (+5.33%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bb30c10...951abc1. Read the comment docs.

@MarlonGamez MarlonGamez marked this pull request as ready for review January 27, 2021 22:39
@MarlonGamez MarlonGamez requested a review from a team as a code owner January 27, 2021 22:39
@@ -76,11 +77,26 @@ func WriteSkaffoldConfig(out io.Writer, pipeline []byte, generatedManifests map[
return !response, nil
}

// chooseBuilders prompts the user to select which builders they'd like to create associated kubernetes manifests for
func chooseBuilders(builders []string) ([]string, error) {
chosen := []string{}
Copy link
Member

Choose a reason for hiding this comment

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

Is none-by-default the right default? Are you thinking that we will have many false positives to prompt from?

(The survey package does offer a <right> to select all so this isn't really that important.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can't say I have a good answer for if it's the right default, but I agree having the ability to select all and select none mean it shouldn't matter too much

@MarlonGamez MarlonGamez merged commit 1cdc543 into GoogleContainerTools:master Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

--generate-manifests should prompt users for which images they'd like to create kubernetes manifests for
2 participants