MCPcopy Index your code
hub / github.com/cloudfoundry/cli / Execute

Method Execute

cf/requirements/min_api_version.go:30–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28}
29
30func (r MinAPIVersionRequirement) Execute() error {
31 if r.config.APIVersion() == "" {
32 return errors.New(T("Unable to determine CC API Version. Please log in again."))
33 }
34
35 apiVersion, err := semver.Make(r.config.APIVersion())
36 if err != nil {
37 return errors.New(T("Unable to parse CC API Version '{{.APIVersion}}'", map[string]interface{}{
38 "APIVersion": r.config.APIVersion(),
39 }))
40 }
41
42 if apiVersion.LT(r.requiredVersion) {
43 return errors.New(T(`{{.Feature}} requires CF API version {{.RequiredVersion}} or higher. Your target is {{.APIVersion}}.`,
44 map[string]interface{}{
45 "APIVersion": r.config.APIVersion(),
46 "Feature": r.feature,
47 "RequiredVersion": r.requiredVersion.String(),
48 }))
49 }
50
51 return nil
52}

Callers

nothing calls this directly

Calls 3

APIVersionMethod · 0.65
MakeMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected