-
Notifications
You must be signed in to change notification settings - Fork 1.7k
add command skaffold inspect build-env add local
#5944
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5944 +/- ##
==========================================
- Coverage 70.66% 70.65% -0.01%
==========================================
Files 454 455 +1
Lines 17403 17471 +68
==========================================
+ Hits 12297 12344 +47
- Misses 4197 4214 +17
- Partials 909 913 +4
Continue to review full report at Codecov.
|
WithDescription("Add a new Local build environment definition"). | ||
WithLongDescription(`Add a new Local build environment definition. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we use camel case elsewhere? Maybe a single quote would be better 'local'
to reflect what's actually added?
WithLongDescription(`Add a new Local build environment definition. | ||
Without the '--profile' flag the new environment definition is added to the default pipeline. With the '--profile' flag it will create a new profile with this build env definition. | ||
In these respective scenarios, it will fail if the build env definition for the default pipeline or the named profile already exists. To override an existing definition use 'skaffold inspect build-env modify' command instead. | ||
Use the '--module' filter to specify the individual module to target. Otherwise, it'll be applied to all modules defined in the target file. Also, with the '--profile' flag if the target config imports other configs as dependencies, then the new profile will be recursively created in all the imported configs also.`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The target file
isn't actually defined — and there's no option to provide (--filename
).
The recursive --profile
behaviour is surprising and feels like it should be controlled with a --recursive
flag?
Use the '--module' filter to specify the individual module to target. Otherwise, it'll be applied to all modules defined in the target file. Also, with the '--profile' flag if the target config imports other configs as dependencies, then the new profile will be recursively created in all the imported configs also.`). | |
Use the '--module' filter to target specific modules. Otherwise, it will be applied to all modules defined in the target file. Also, with the '--profile' flag if the target config imports other configs as dependencies, then the new profile will be recursively created in all the imported configs also.`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There actually is a --filename
flag. It seems like a bug (or I missed it) that flags added via cobra.Command.PersistentFlags
don't show up in the --help
text.
|
||
func AddLocalBuildEnv(ctx context.Context, out io.Writer, opts inspect.Options) error { | ||
formatter := inspect.OutputFormatter(out, opts.OutFormat) | ||
cfgs, err := inspect.ConfigSetFunc(config.SkaffoldOptions{ConfigurationFile: opts.Filename, ConfigurationFilter: opts.Modules, SkipConfigDefaults: true, MakePathsAbsolute: util.BoolPtr(false)}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ConfigSetFunc()
seems an odd name. Shouldn't it be ConfigSet
?
|
||
func localBuildEnvOptions() inspect.Options { | ||
return inspect.Options{ | ||
Filename: inspectFlags.fileName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Capitalization should be consistent: n
vs N
cfgs = cfgs.SelectRootConfigs() | ||
for _, cfg := range cfgs { | ||
if cfg.Build.LocalBuild != nil && (*cfg.Build.LocalBuild != latestV1.LocalBuild{}) { | ||
return formatter.WriteErr(inspect.BuildEnvAlreadyExists(inspect.BuildEnvs.Local, cfg.SourceFile, "")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, I thought To override an existing definition use 'skaffold inspect build-env modify' command instead
meant if there were GCB or Cluster builds set.
The |
Fixes: #5998
Related: #5758
Description
User facing changes (remove if N/A)