Skip to content

Commit c59a33a

Browse files
authored
fix bundle validate subcommand bug (#6274)
that would cause a 0 exit code even if there were validation failures fixes #6247 Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
1 parent 21b1770 commit c59a33a

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# entries is a list of entries to include in
2+
# release notes and/or the migration guide
3+
entries:
4+
- description: >
5+
For `operator-sdk bundle validate`: Fix a bug that would make the command exit with a 0 exit code even if there
6+
were validation failures.
7+
kind: "bugfix"
8+
breaking: false

internal/cmd/operator-sdk/bundle/validate/cmd.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,11 @@ func NewCmd() *cobra.Command {
159159
}
160160

161161
// if a test failed don't print that it was successful
162-
if !failed {
163-
logger.Info("All validation tests have completed successfully")
162+
if failed {
163+
os.Exit(1)
164164
}
165165

166+
logger.Info("All validation tests have completed successfully")
166167
return nil
167168
},
168169
}

0 commit comments

Comments
 (0)