Skip to content

Commit

Permalink
Skip printing the details when no drifts identified
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilsbhat committed Apr 7, 2023
1 parent 140dda3 commit a381d58
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func getAllCommand() *cobra.Command {
Short: "Identifies drifts from all release from the cluster",
Long: "Lists all configuration drifts that are part of various releases present in the cluster.",
Example: ` helm drift all --kube-context k3d-sample
helm drift all --kube-context k3d-sample -n sample`,
helm drift all --kube-context k3d-sample -n sample`,
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
drifts.SetLogger(drifts.LogLevel)
Expand Down
2 changes: 1 addition & 1 deletion docs/doc/drift_all.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ drift all [flags]

```
helm drift all --kube-context k3d-sample
helm drift all --kube-context k3d-sample -n sample
helm drift all --kube-context k3d-sample -n sample
```

### Options
Expand Down
3 changes: 3 additions & 0 deletions pkg/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ func (drift *Drift) print(drifts []deviation.DriftedRelease) {
var hasDrift bool

for _, dft := range drifts {
if !dft.HasDrift {
continue
}
drift.write(addNewLine("------------------------------------------------------------------------------------"))
drift.write(addNewLine(fmt.Sprintf("Release : %s", dft.Release)))

Expand Down

0 comments on commit a381d58

Please sign in to comment.