You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Validate that --orgs is only used with --use-live-connection
51
+
if!useLive&&len(orgs) >0 {
52
+
returnfmt.Errorf("--orgs flag can only be used with --use-live-connection. For local manifest discovery (--input), organization name defaults to 'local'")
53
+
}
54
+
48
55
ifuseLive {
49
-
iflen(spaces) ==0 {
50
-
returnfmt.Errorf("at least one space is required")
51
-
}
52
56
ifcfConfigPath!="" {
53
57
_, err:=os.Stat(cfConfigPath)
54
58
iferr!=nil {
55
59
returnfmt.Errorf("failed to retrieve Cloud Foundry configuration file at %s:%s", cfConfigPath, err)
56
60
}
57
61
}
62
+
// Orgs are required for all live discovery operations
63
+
iflen(orgs) ==0 {
64
+
returnfmt.Errorf("--orgs flag is required when using --use-live-connection")
cmd.Flags().BoolVar(&useLive, "use-live-connection", false, "Enable real-time discovery using live platform connections.")
88
96
cmd.Flags().StringVar(&pType, "platformType", "cloud-foundry", "Platform type for discovery. Allowed value is: \"cloud-foundry\" (default).")
89
97
cmd.Flags().StringVar(&cfConfigPath, "cf-config", "~/.cf/config", "Path to the Cloud Foundry CLI configuration file (default: ~/.cf/config).")
90
-
cmd.Flags().StringSliceVar(&spaces, "spaces", []string{}, "Comma-separated list of Cloud Foundry spaces to analyze (e.g., --spaces=\"space1,space2\"). At least one space is required when using live discovery.")
98
+
cmd.Flags().StringSliceVar(&spaces, "spaces", []string{}, "Comma-separated list of Cloud Foundry spaces to analyze (e.g., --spaces=\"space1,space2\"). If not provided, discovers all spaces in the specified organizations.")
99
+
cmd.Flags().StringSliceVar(&orgs, "orgs", []string{}, "Comma-separated list of Cloud Foundry organizations (e.g., --orgs=\"org1,org2\"). Required for live discovery.")
91
100
cmd.Flags().StringVar(&appName, "app-name", "", "Name of the Cloud Foundry application to discover.")
92
101
cmd.Flags().BoolVar(&skipSslValidation, "skip-ssl-validation", false, "Skip SSL certificate validation for API connections (default: false).")
93
102
94
103
cmd.Flags().BoolVar(&listApps, "list-apps", false, "List applications available for each space.")
0 commit comments