Additional review fixes from PR

Signed-off-by: Evans Mungai <mbuevans@gmail.com>
This commit is contained in:
Evans Mungai
2024-11-25 12:01:18 +00:00
committed by Scott Rigby
parent 461197f9c6
commit 483ebf915d
3 changed files with 20 additions and 6 deletions

View File

@@ -1,4 +1,18 @@
// Profile CPU and memory usage of Helm commands
/*
Copyright The Helm Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main

View File

@@ -95,7 +95,7 @@ func newRootCmd(actionConfig *action.Configuration, out io.Writer, args []string
Short: "The Helm package manager for Kubernetes.",
Long: globalUsage,
SilenceUsage: true,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
PersistentPreRun: func(cmd *cobra.Command, _ []string) {
cpuprof, err := cmd.Flags().GetString("cpuprofile")
if err != nil {
log.Printf("Warning: Failed to get cpuprofile flag: %v", err)
@@ -105,7 +105,7 @@ func newRootCmd(actionConfig *action.Configuration, out io.Writer, args []string
log.Printf("Warning: Failed to start profiling: %v", err)
}
},
PersistentPostRun: func(cmd *cobra.Command, args []string) {
PersistentPostRun: func(cmd *cobra.Command, _ []string) {
memprof, err := cmd.Flags().GetString("memprofile")
if err != nil {
log.Printf("Warning: Failed to get memprofile flag: %v", err)