Skip to content

Commit

Permalink
add no warnings handler to handle deprecation notices
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhelfand committed Jul 12, 2021
1 parent 88c5a64 commit f9c21df
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/kapp/cmd/core/deps_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ func (f *DepsFactoryImpl) DynamicClient() (dynamic.Interface, error) {
return nil, err
}

clientset, err := dynamic.NewForConfig(config)
// copy to avoid mutating the passed-in config
cpConfig := rest.CopyConfig(config)
// set the warning handler for this client to ignore warnings
cpConfig.WarningHandler = rest.NoWarnings{}

clientset, err := dynamic.NewForConfig(cpConfig)
if err != nil {
return nil, fmt.Errorf("Building Dynamic clientset: %s", err)
}
Expand Down

0 comments on commit f9c21df

Please sign in to comment.