Skip to content

Commit

Permalink
action: omit logging on CRD apply no-op
Browse files Browse the repository at this point in the history
As it does not offer real value, and creates noise when the logs are
included in an emitted event.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
  • Loading branch information
hiddeco committed Nov 22, 2023
1 parent f56a10c commit c520a3e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions internal/action/crds.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,12 @@ func (*rootScoped) Name() apimeta.RESTScopeName {
}

func applyCRDs(cfg *helmaction.Configuration, policy v2.CRDsPolicy, chrt *helmchart.Chart, visitorFunc ...resource.VisitorFunc) error {
if policy == v2.Skip {
cfg.Log("skipping CustomResourceDefinition apply: policy is set to %s", policy)
if len(chrt.CRDObjects()) == 0 {
return nil
}

if len(chrt.CRDObjects()) == 0 {
cfg.Log("skipping CustomResourceDefinition apply: no CRD objects found in chart")
if policy == v2.Skip {
cfg.Log("skipping CustomResourceDefinition apply: policy is set to %s", policy)
return nil
}

Expand Down

0 comments on commit c520a3e

Please sign in to comment.