diff --git a/pkg/kapp/cmd/app/deploy.go b/pkg/kapp/cmd/app/deploy.go index 8463597e7..314544845 100644 --- a/pkg/kapp/cmd/app/deploy.go +++ b/pkg/kapp/cmd/app/deploy.go @@ -245,7 +245,7 @@ func (o *DeployOptions) Run() error { } func (o *DeployOptions) newAndUsedGKs(newGKs []schema.GroupKind, app ctlapp.App) ([]schema.GroupKind, error) { - if o.ResourceTypesFlags.DisableGKScoping { + if o.DeployFlags.DisableGKScoping { return []schema.GroupKind{}, nil } diff --git a/pkg/kapp/cmd/app/deploy_flags.go b/pkg/kapp/cmd/app/deploy_flags.go index 533df5cc8..ba9a2ed9f 100644 --- a/pkg/kapp/cmd/app/deploy_flags.go +++ b/pkg/kapp/cmd/app/deploy_flags.go @@ -26,6 +26,8 @@ type DeployFlags struct { Logs bool LogsAll bool AppMetadataFile string + + DisableGKScoping bool } func (s *DeployFlags) Set(cmd *cobra.Command) { @@ -55,4 +57,7 @@ func (s *DeployFlags) Set(cmd *cobra.Command) { cmd.Flags().BoolVar(&s.Logs, "logs", true, fmt.Sprintf("Show logs from Pods annotated as '%s'", deployLogsAnnKey)) cmd.Flags().BoolVar(&s.LogsAll, "logs-all", false, "Show logs from all Pods") cmd.Flags().StringVar(&s.AppMetadataFile, "app-metadata-file-output", "", "Set filename to write app metadata") + + cmd.Flags().BoolVar(&s.DisableGKScoping, "dangerous-disable-gk-scoping", + false, "Disable scoping of resource searching to used GroupKinds") } diff --git a/pkg/kapp/cmd/app/resource_types_flags.go b/pkg/kapp/cmd/app/resource_types_flags.go index 31f0a9553..2b261f998 100644 --- a/pkg/kapp/cmd/app/resource_types_flags.go +++ b/pkg/kapp/cmd/app/resource_types_flags.go @@ -13,8 +13,6 @@ type ResourceTypesFlags struct { CanIgnoreFailingAPIService func(schema.GroupVersion) bool ScopeToFallbackAllowedNamespaces bool - - DisableGKScoping bool } func (s *ResourceTypesFlags) Set(cmd *cobra.Command) { @@ -23,9 +21,6 @@ func (s *ResourceTypesFlags) Set(cmd *cobra.Command) { cmd.Flags().BoolVar(&s.ScopeToFallbackAllowedNamespaces, "dangerous-scope-to-fallback-allowed-namespaces", false, "Scope resource searching to fallback allowed namespaces") - - cmd.Flags().BoolVar(&s.DisableGKScoping, "dangerous-disable-gk-scoping", - false, "Disable scoping of resource searching to used GroupKinds") } func (s *ResourceTypesFlags) FailingAPIServicePolicy() *FailingAPIServicesPolicy {