Skip to content

Commit fc06ce4

Browse files
committed
fix: helm and kubectl debug info
Signed-off-by: Vladislav Sukhin <[email protected]>
1 parent 7510bab commit fc06ce4

File tree

1 file changed

+7
-7
lines changed
  • cmd/kubectl-testkube/commands/common

1 file changed

+7
-7
lines changed

cmd/kubectl-testkube/commands/common/helper.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,11 @@ func HelmUpgradeOrInstallTestkubeAgent(options HelmOptions, cfg config.Data, isM
101101
}
102102

103103
args := prepareTestkubeProHelmArgs(options, isMigration)
104-
output, err := runHelmCommand(helmPath, args, options.DryRun)
104+
_, err := runHelmCommand(helmPath, args, options.DryRun)
105105
if err != nil {
106106
return err
107107
}
108108

109-
ui.Debug("Helm command output:")
110-
ui.Debug(helmPath, args...)
111-
112-
ui.Debug("Helm install testkube output", output)
113-
114109
return nil
115110
}
116111

@@ -147,7 +142,7 @@ func lookupHelmPath() (string, *CLIError) {
147142
return helmPath, nil
148143
}
149144

150-
func updateHelmRepo(helmPath string, dryRun bool, isOnPrem bool) *CLIError {
145+
func updateHelmRepo(helmPath string, dryRun, isOnPrem bool) *CLIError {
151146
registryURL := "https://kubeshop.github.io/helm-charts"
152147
registryName := "kubeshop"
153148
if isOnPrem {
@@ -193,7 +188,10 @@ func CleanExistingCompletedMigrationJobs(namespace string) (cliErr *CLIError) {
193188
}
194189

195190
func runHelmCommand(helmPath string, args []string, dryRun bool) (commandOutput string, cliErr *CLIError) {
191+
ui.Debug("\nHelm command:\n" + strings.Join(append([]string{helmPath}, args...), " "))
192+
196193
output, err := process.ExecuteWithOptions(process.Options{Command: helmPath, Args: args, DryRun: dryRun})
194+
ui.Debug("\nHelm output:\n" + string(output))
197195
if err != nil {
198196
return "", NewCLIError(
199197
TKErrHelmCommandFailed,
@@ -719,7 +717,9 @@ func lookupKubectlPath() (string, *CLIError) {
719717
}
720718

721719
func runKubectlCommand(kubectlPath string, args []string) (output string, cliErr *CLIError) {
720+
ui.Debug("\nKubectl command:\n" + strings.Join(append([]string{kubectlPath}, args...), " "))
722721
out, err := process.Execute(kubectlPath, args...)
722+
ui.Debug("\nKubectl output:\n" + string(out))
723723
if err != nil {
724724
return "", NewCLIError(
725725
TKErrKubectlCommandFailed,

0 commit comments

Comments
 (0)