github.com/sleungcy/cli@v7.1.0+incompatible/command/translatableerror/trigger_legacy_push_error.go (about) 1 package translatableerror 2 3 import ( 4 "fmt" 5 "strings" 6 ) 7 8 type TriggerLegacyPushError struct { 9 DomainHostRelated []string 10 GlobalRelated []string 11 InheritanceRelated bool 12 RandomRouteRelated bool 13 } 14 15 func (TriggerLegacyPushError) LegacyMain() {} 16 17 func (e TriggerLegacyPushError) Error() string { 18 switch { 19 case len(e.DomainHostRelated) > 0: 20 return fmt.Sprintf(`Deprecation warning: Route component attributes 'domain', 'domains', 'host', 'hosts' and 'no-hostname' are deprecated. Found: %s. 21 Please see https://docs.cloudfoundry.org/devguide/deploy-apps/manifest-attributes.html#deprecated for the currently supported syntax and other app manifest deprecations. This feature will be removed in the future. 22 `, strings.Join(e.DomainHostRelated, ", ")) 23 case len(e.GlobalRelated) > 0: 24 return fmt.Sprintf(`Deprecation warning: Specifying app manifest attributes at the top level is deprecated. Found: %s. 25 Please see https://docs.cloudfoundry.org/devguide/deploy-apps/manifest-attributes.html#deprecated for alternatives and other app manifest deprecations. This feature will be removed in the future. 26 `, strings.Join(e.GlobalRelated, ", ")) 27 28 case e.InheritanceRelated: 29 return `Deprecation warning: App manifest inheritance is deprecated. 30 Please see https://docs.cloudfoundry.org/devguide/deploy-apps/manifest-attributes.html#deprecated for alternatives and other app manifest deprecations. This feature will be removed in the future. 31 ` 32 33 default: 34 return "" 35 } 36 } 37 38 func (e TriggerLegacyPushError) Translate(translate func(string, ...interface{}) string) string { 39 return translate(e.Error()) 40 }