Skip to content

Commit

Permalink
move --dangerous-disable-gk-scoping flag to kapp deploy (#752)
Browse files Browse the repository at this point in the history
Signed-off-by: Hernan Garcia <[email protected]>
Co-authored-by: Hernan Garcia <[email protected]>
  • Loading branch information
hernandanielg and Hernan Garcia authored May 12, 2023
1 parent 5770b80 commit 3e2edfa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/kapp/cmd/app/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
5 changes: 5 additions & 0 deletions pkg/kapp/cmd/app/deploy_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ type DeployFlags struct {
Logs bool
LogsAll bool
AppMetadataFile string

DisableGKScoping bool
}

func (s *DeployFlags) Set(cmd *cobra.Command) {
Expand Down Expand Up @@ -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")
}
5 changes: 0 additions & 5 deletions pkg/kapp/cmd/app/resource_types_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ type ResourceTypesFlags struct {
CanIgnoreFailingAPIService func(schema.GroupVersion) bool

ScopeToFallbackAllowedNamespaces bool

DisableGKScoping bool
}

func (s *ResourceTypesFlags) Set(cmd *cobra.Command) {
Expand All @@ -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 {
Expand Down

0 comments on commit 3e2edfa

Please sign in to comment.