-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.go
More file actions
43 lines (37 loc) · 1.24 KB
/
main.go
File metadata and controls
43 lines (37 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package main
import (
"os"
"upgrade-all-services-cli-plugin/internal/config"
"code.cloudfoundry.org/cli/v8/plugin"
)
func main() {
plugin.Start(&UpgradePlugin{})
}
type UpgradePlugin struct{}
// Run implements a required method of the code.cloudfoundry.org/cli/plugin.Plugin interface.
// It is the entry point for running the plugin.
func (p *UpgradePlugin) Run(cliConnection plugin.CliConnection, args []string) {
if args[0] == "upgrade-all-services" {
exitCode := upgradeAllServices(cliConnection, args[1:])
os.Exit(exitCode)
}
}
// GetMetadata implements a required method of the code.cloudfoundry.org/cli/plugin.Plugin interface.
// It provides the CF CLI with information about this plugin.
func (p *UpgradePlugin) GetMetadata() plugin.PluginMetadata {
return plugin.PluginMetadata{
Name: "UpgradeAllServices",
Version: pluginVersion(),
MinCliVersion: plugin.VersionType{Major: 6, Minor: 53, Build: 0},
Commands: []plugin.Command{
{
Name: "upgrade-all-services",
HelpText: "Upgrade all service instances from a broker to the latest available version of their current service plans.",
UsageDetails: plugin.Usage{
Usage: config.Usage,
Options: config.UsageOptions(),
},
},
},
}
}