1
0
mirror of synced 2026-03-13 15:26:55 +00:00

Add links to status docs in flux debug commands

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
Stefan Prodan
2024-12-18 00:50:02 +02:00
parent 9b1b5e8a51
commit 928ea24bcb
4 changed files with 12 additions and 0 deletions

View File

@@ -86,6 +86,7 @@ func debugHelmReleaseCmdRun(cmd *cobra.Command, args []string) error {
if err != nil { if err != nil {
return err return err
} }
rootCmd.Println("# Status documentation: https://fluxcd.io/flux/components/helm/helmreleases/#helmrelease-status")
rootCmd.Print(string(status)) rootCmd.Print(string(status))
if debugHelmReleaseArgs.showValues { if debugHelmReleaseArgs.showValues {
rootCmd.Println("---") rootCmd.Println("---")

View File

@@ -18,6 +18,7 @@ package main
import ( import (
"context" "context"
"errors"
"fmt" "fmt"
"sort" "sort"
"strings" "strings"
@@ -89,11 +90,16 @@ func debugKustomizationCmdRun(cmd *cobra.Command, args []string) error {
if err != nil { if err != nil {
return err return err
} }
rootCmd.Println("# Status documentation: https://fluxcd.io/flux/components/kustomize/kustomizations/#kustomization-status")
rootCmd.Print(string(status)) rootCmd.Print(string(status))
return nil return nil
} }
if debugKustomizationArgs.showVars { if debugKustomizationArgs.showVars {
if ks.Spec.PostBuild == nil {
return errors.New("no post build substitutions found")
}
ksObj, err := runtime.DefaultUnstructuredConverter.ToUnstructured(ks) ksObj, err := runtime.DefaultUnstructuredConverter.ToUnstructured(ks)
if err != nil { if err != nil {
return err return err
@@ -106,6 +112,9 @@ func debugKustomizationCmdRun(cmd *cobra.Command, args []string) error {
if len(ks.Spec.PostBuild.Substitute) > 0 { if len(ks.Spec.PostBuild.Substitute) > 0 {
for k, v := range ks.Spec.PostBuild.Substitute { for k, v := range ks.Spec.PostBuild.Substitute {
// Remove new lines from the values as they are not supported.
// Replicates the controller behavior from
// https://github.com/fluxcd/pkg/blob/main/kustomize/kustomize_varsub.go
finalVars[k] = strings.ReplaceAll(v, "\n", "") finalVars[k] = strings.ReplaceAll(v, "\n", "")
} }
} }

View File

@@ -1 +1,2 @@
# Status documentation: https://fluxcd.io/flux/components/helm/helmreleases/#helmrelease-status
observedGeneration: -1 observedGeneration: -1

View File

@@ -1 +1,2 @@
# Status documentation: https://fluxcd.io/flux/components/kustomize/kustomizations/#kustomization-status
observedGeneration: -1 observedGeneration: -1