Skip to content

Commit de436d2

Browse files
committed
fix(agentctl): set exit code 1 on non-runnable command
Signed-off-by: François Gouteroux <[email protected]>
1 parent 54b5e78 commit de436d2

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ Main (unreleased)
100100

101101
### Bugfixes
102102

103+
- Set exit code 1 on grafana-agentctl non-runnable command. (@fgouteroux)
104+
103105
- Fixed an issue where `loki.process` validation for stage `metric.counter` was
104106
allowing invalid combination of configuration options. (@thampiotr)
105107

cmd/grafana-agentctl/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ func main() {
6464
testLogs(),
6565
)
6666

67-
_ = cmd.Execute()
67+
if err := cmd.Execute(); err != nil {
68+
os.Exit(1)
69+
}
6870
}
6971

7072
func configSyncCmd() *cobra.Command {

0 commit comments

Comments
 (0)