1
0
mirror of synced 2026-02-13 13:06:56 +00:00

Fix stringData Secret issue

This commit migrate to the last version of pkg/ssa v0.14.1 that contains a fix
for stringData secrets. The test case was changed accordingly to
    validate a stringData drift.

A progress-bar flag option has also been added in order to be able to
disable it.

Signed-off-by: Soule BA <soule@weave.works>
This commit is contained in:
Soule BA
2022-02-18 16:41:16 +01:00
parent 1ff8c2806c
commit 32ad462ebe
11 changed files with 302 additions and 135 deletions

View File

@@ -40,13 +40,15 @@ flux diff kustomization my-app --path ./path/to/local/manifests`,
}
type diffKsFlags struct {
path string
path string
progressBar bool
}
var diffKsArgs diffKsFlags
func init() {
diffKsCmd.Flags().StringVar(&diffKsArgs.path, "path", "", "Path to a local directory that matches the specified Kustomization.spec.path.)")
diffKsCmd.Flags().BoolVar(&diffKsArgs.progressBar, "progress-bar", true, "Boolean to set the progress bar. The default value is true.")
diffCmd.AddCommand(diffKsCmd)
}
@@ -64,7 +66,14 @@ func diffKsCmdRun(cmd *cobra.Command, args []string) error {
return &RequestError{StatusCode: 2, Err: fmt.Errorf("invalid resource path %q", diffKsArgs.path)}
}
builder, err := build.NewBuilder(kubeconfigArgs, name, diffKsArgs.path, build.WithTimeout(rootArgs.timeout))
var builder *build.Builder
var err error
if diffKsArgs.progressBar {
builder, err = build.NewBuilder(kubeconfigArgs, name, diffKsArgs.path, build.WithTimeout(rootArgs.timeout), build.WithProgressBar())
} else {
builder, err = build.NewBuilder(kubeconfigArgs, name, diffKsArgs.path, build.WithTimeout(rootArgs.timeout))
}
if err != nil {
return &RequestError{StatusCode: 2, Err: err}
}