mirror of https://github.com/helm/helm
Fixes #7088 template command bug
The template command (and install/upgrade) will dump the content of the problematic yaml content if it cannot be unmarshalled. Signed-off-by: Laszlo Varadi <laszlo.varadi@gmail.com>pull/7094/head
parent
593ea3fb12
commit
6c001f53ea
@ -0,0 +1,39 @@
|
||||
/*
|
||||
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 logs
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"helm.sh/helm/v3/pkg/cli"
|
||||
)
|
||||
|
||||
var settings *cli.EnvSettings
|
||||
|
||||
//Init logs package with settings... used to get the Debug flag
|
||||
func Init(s *cli.EnvSettings) {
|
||||
settings = s
|
||||
}
|
||||
|
||||
//Debug log if Debug is set in HELM_DEBUG or with --debug
|
||||
func Debug(format string, v ...interface{}) {
|
||||
if settings.Debug {
|
||||
format = fmt.Sprintf("[debug] %s\n", format)
|
||||
log.Output(2, fmt.Sprintf(format, v...))
|
||||
}
|
||||
}
|
Loading…
Reference in new issue