Skip to content

Commit

Permalink
fix: disable rendering of subchart notes by default
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksei Igrychev <aleksei.igrychev@palark.com>
  • Loading branch information
alexey-igrychev committed Sep 26, 2024
1 parent fbd5b5a commit 38f39c6
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 10 deletions.
3 changes: 3 additions & 0 deletions cmd/werf/bundle/apply/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ func NewCmd(ctx context.Context) *cobra.Command {
common.SetupDeployGraphPath(&commonCmdData, cmd)
common.SetupRollbackGraphPath(&commonCmdData, cmd)

common.SetupRenderSubchartNotes(&commonCmdData, cmd)

defaultTag := os.Getenv("WERF_TAG")
if defaultTag == "" {
defaultTag = "latest"
Expand Down Expand Up @@ -388,6 +390,7 @@ func runApply(ctx context.Context) error {
SetValues: common.GetSet(&commonCmdData),
FileValues: common.GetSetFile(&commonCmdData),
ValuesFiles: common.GetValues(&commonCmdData),
SubNotes: *commonCmdData.RenderSubchartNotes,
Mapper: clientFactory.Mapper(),
DiscoveryClient: clientFactory.Discovery(),
},
Expand Down
2 changes: 2 additions & 0 deletions cmd/werf/common/cmd_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ type CmdData struct {
DeployGraphPath *string
RollbackGraphPath *string

RenderSubchartNotes *bool

VirtualMerge *bool

ScanContextNamespaceOnly *bool
Expand Down
6 changes: 6 additions & 0 deletions cmd/werf/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,12 @@ func SetupRollbackGraphPath(cmdData *CmdData, cmd *cobra.Command) {
cmd.Flags().StringVarP(cmdData.RollbackGraphPath, "rollback-graph-path", "", os.Getenv("WERF_ROLLBACK_GRAPH_PATH"), "Save rollback graph path to the specified file (by default $WERF_ROLLBACK_GRAPH_PATH). Extension must be .dot or not specified. If extension not specified, then .dot is used")
}

func SetupRenderSubchartNotes(cmdData *CmdData, cmd *cobra.Command) {
cmdData.RenderSubchartNotes = new(bool)

cmd.Flags().BoolVarP(cmdData.RenderSubchartNotes, "render-subchart-notes", "", util.GetBoolEnvironmentDefaultFalse("WERF_RENDER_SUBCHART_NOTES"), "If set, render subchart notes along with the parent (by default $WERF_RENDER_SUBCHART_NOTES or false)")
}

func GetDeployGraphPath(cmdData *CmdData) string {
if strings.TrimSpace(*cmdData.DeployGraphPath) == "" {
return ""
Expand Down
3 changes: 3 additions & 0 deletions cmd/werf/converge/converge.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ werf converge --repo registry.mydomain.com/web --env production`,
common.SetupDeployGraphPath(&commonCmdData, cmd)
common.SetupRollbackGraphPath(&commonCmdData, cmd)

common.SetupRenderSubchartNotes(&commonCmdData, cmd)

defaultTimeout, err := util.GetIntEnvVar("WERF_TIMEOUT")
if err != nil || defaultTimeout == nil {
defaultTimeout = new(int64)
Expand Down Expand Up @@ -487,6 +489,7 @@ func run(
ValuesFilesPaths: common.GetValues(&commonCmdData),
ValuesSets: common.GetSet(&commonCmdData),
ValuesStringSets: common.GetSetString(&commonCmdData),
SubNotes: *commonCmdData.RenderSubchartNotes,
LegacyPreDeployHook: func(
ctx context.Context,
releaseNamespace string,
Expand Down
3 changes: 3 additions & 0 deletions docs/_includes/reference/cli/werf_bundle_apply.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ werf bundle apply [options]
Use specified Helm release name (default $WERF_RELEASE)
--releases-history-max=5
Max releases to keep in release storage ($WERF_RELEASES_HISTORY_MAX or 5 by default)
--render-subchart-notes=false
If set, render subchart notes along with the parent (by default
$WERF_RENDER_SUBCHART_NOTES or false)
--repo=''
Container registry storage address (default $WERF_REPO)
--repo-container-registry=''
Expand Down
3 changes: 3 additions & 0 deletions docs/_includes/reference/cli/werf_converge.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ werf converge --repo registry.mydomain.com/web --env production
deploy.helmRelease custom template from werf.yaml or $WERF_RELEASE)
--releases-history-max=5
Max releases to keep in release storage ($WERF_RELEASES_HISTORY_MAX or 5 by default)
--render-subchart-notes=false
If set, render subchart notes along with the parent (by default
$WERF_RENDER_SUBCHART_NOTES or false)
--repo=''
Container registry storage address (default $WERF_REPO)
--repo-container-registry=''
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ go 1.21.1
toolchain go1.21.6

require (
bou.ke/monkey v1.0.2
github.com/Masterminds/goutils v1.1.1
github.com/Masterminds/semver v1.5.0
github.com/Masterminds/sprig/v3 v3.2.3
Expand Down Expand Up @@ -65,7 +64,7 @@ require (
github.com/werf/kubedog v0.12.4-0.20240625172905-6d4f29eae23b
github.com/werf/lockgate v0.1.1
github.com/werf/logboek v0.6.1
github.com/werf/nelm v0.0.0-20240815172253-215b579edc81
github.com/werf/nelm v0.0.0-20240926131349-14c2fa9d0e25
go.opentelemetry.io/otel v1.24.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0
Expand Down
10 changes: 2 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
bazil.org/fuse v0.0.0-20180421153158-65cc252bf669/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8=
bitbucket.org/creachadair/shell v0.0.6/go.mod h1:8Qqi/cYk7vPnsOePHroKXDJYmb5x7ENhtiFtfZq8K+M=
bitbucket.org/liamstask/goose v0.0.0-20150115234039-8488cc47d90c/go.mod h1:hSVuE3qU7grINVSwrmzHfpg9k87ALBk+XaualNyUzI4=
bou.ke/monkey v1.0.2 h1:kWcnsrCNUatbxncxR/ThdYqbytgOIArtYWqcQLQzKLI=
bou.ke/monkey v1.0.2/go.mod h1:OqickVX3tNx6t33n1xvtTtu85YN5s6cKwVug+oHMaIA=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
Expand Down Expand Up @@ -1402,12 +1400,8 @@ github.com/werf/lockgate v0.1.1 h1:S400JFYjtWfE4i4LY9FA8zx0fMdfui9DPrBiTciCrx4=
github.com/werf/lockgate v0.1.1/go.mod h1:0yIFSLq9ausy6ejNxF5uUBf/Ib6daMAfXuCaTMZJzIE=
github.com/werf/logboek v0.6.1 h1:oEe6FkmlKg0z0n80oZjLplj6sXcBeLleCkjfOOZEL2g=
github.com/werf/logboek v0.6.1/go.mod h1:Gez5J4bxekyr6MxTmIJyId1F61rpO+0/V4vjCIEIZmk=
github.com/werf/nelm v0.0.0-20240806151008-21c317bee888 h1:TDYUPstcaY7qz4ktcjjSrD96SNMufuWWIyBfhuAfVC4=
github.com/werf/nelm v0.0.0-20240806151008-21c317bee888/go.mod h1:rJQpFmToqj6twEeTcV7NtXACXqzuobvzjVocuCtIAms=
github.com/werf/nelm v0.0.0-20240806160049-119410ac7901 h1:U2SD4nItf8s9LDGBqo4c/vDon571JcQnAK8YRmKBE1Y=
github.com/werf/nelm v0.0.0-20240806160049-119410ac7901/go.mod h1:rJQpFmToqj6twEeTcV7NtXACXqzuobvzjVocuCtIAms=
github.com/werf/nelm v0.0.0-20240815172253-215b579edc81 h1:604Cj5zZ/pdXpAtRgEJCvnaNO7BZNcJ90UYAnINB1cM=
github.com/werf/nelm v0.0.0-20240815172253-215b579edc81/go.mod h1:rJQpFmToqj6twEeTcV7NtXACXqzuobvzjVocuCtIAms=
github.com/werf/nelm v0.0.0-20240926131349-14c2fa9d0e25 h1:JKFbl0Uv3pBlDi5tXCBNh4S2upHy0An+kqE87Ilvg1g=
github.com/werf/nelm v0.0.0-20240926131349-14c2fa9d0e25/go.mod h1:rJQpFmToqj6twEeTcV7NtXACXqzuobvzjVocuCtIAms=
github.com/xanzy/go-gitlab v0.31.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug=
github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4=
github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM=
Expand Down

0 comments on commit 38f39c6

Please sign in to comment.