Skip to content

Commit

Permalink
update env type (istio#616)
Browse files Browse the repository at this point in the history
  • Loading branch information
richardwxn authored and istio-testing committed Nov 18, 2019
1 parent 6bba1cf commit cc6bc5d
Show file tree
Hide file tree
Showing 6 changed files with 604 additions and 846 deletions.
2 changes: 1 addition & 1 deletion cmd/mesh/manifest-generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func manifestGenerate(args *rootArgs, mgArgs *manifestGenerateArgs, l *logger) {
os.Exit(1)
}

overlayFromSet, err := makeTreeFromSetList(mgArgs.set, mgArgs.force)
overlayFromSet, err := makeTreeFromSetList(mgArgs.set, mgArgs.force, l)
if err != nil {
l.logAndFatal(err.Error())
}
Expand Down
5 changes: 3 additions & 2 deletions cmd/mesh/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func genManifests(inFilename string, setOverlayYAML string, force bool, l *logge

func genApplyManifests(setOverlay []string, inFilename string, force bool, dryRun bool, verbose bool,
kubeConfigPath string, context string, waitTimeout time.Duration, l *logger) error {
overlayFromSet, err := makeTreeFromSetList(setOverlay, force)
overlayFromSet, err := makeTreeFromSetList(setOverlay, force, l)
if err != nil {
return fmt.Errorf("failed to generate tree from the set overlay, error: %v", err)
}
Expand Down Expand Up @@ -182,7 +182,7 @@ func fetchInstallPackageFromURL(mergedICPS *v1alpha2.IstioControlPlaneSpec) erro
}

// makeTreeFromSetList creates a YAML tree from a string slice containing key-value pairs in the format key=value.
func makeTreeFromSetList(setOverlay []string, force bool) (string, error) {
func makeTreeFromSetList(setOverlay []string, force bool, l *logger) (string, error) {
if len(setOverlay) == 0 {
return "", nil
}
Expand Down Expand Up @@ -212,6 +212,7 @@ func makeTreeFromSetList(setOverlay []string, force bool) (string, error) {
}
if errs := validate.CheckIstioControlPlaneSpec(icps, true); len(errs) != 0 {
if !force {
l.logAndError("Run the command with the --force flag if you want to ignore the validation error and proceed.")
return "", fmt.Errorf("bad path=value (%s): %s", kv, errs)
}
}
Expand Down
10 changes: 5 additions & 5 deletions pkg/apis/istio/v1alpha1/v1alpha1.pb.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit cc6bc5d

Please sign in to comment.