Skip to content

Commit

Permalink
mark deprecated --legacy-snapshot flag
Browse files Browse the repository at this point in the history
  • Loading branch information
jlandowner committed May 8, 2024
1 parent efaadd6 commit 200552d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type option struct {
FailFast bool
Parallelism int
ConfigFile string
LegacySnapshot bool
LegacySnapshot bool // deprecated
SnapshotVersion string

// Below properties are the same as helm global options
Expand Down Expand Up @@ -188,6 +188,7 @@ MIT 2023 jlandowner/helm-chartsnap
panic(err)
}
rootCmd.PersistentFlags().BoolVar(&o.LegacySnapshot, "legacy-snapshot", false, "use toml-based legacy snapshot format")
rootCmd.PersistentFlags().MarkDeprecated("legacy-snapshot", "use --snapshot-version=v1 instead")
rootCmd.PersistentFlags().StringVar(&o.SnapshotVersion, "snapshot-version", "", "use a specific snapshot format version. v1, v2, v3 are supported. (default: latest)")
}

Expand Down Expand Up @@ -215,7 +216,7 @@ func loadSnapshotConfig(file string, cfg *v1alpha1.SnapshotConfig) error {
if o.FailFast {
return fmt.Errorf("failed to load snapshot config: %w", err)
} else {
log.Error("WARNING: failed to load snapshot config", "path", file, "err", err)
log.Warn("failed to load snapshot config", "path", file, "err", err)
}
}
log.Debug("snapshot config", "cfg", cfg)
Expand Down

0 comments on commit 200552d

Please sign in to comment.