Skip to content

Commit 6082910

Browse files
committed
manageStatus from watches.yaml should be *bool
1 parent efbf163 commit 6082910

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

pkg/ansible/runner/runner.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222
"os"
2323
"os/exec"
2424
"path/filepath"
25-
"strconv"
2625
"strings"
2726
"time"
2827

@@ -53,7 +52,7 @@ type watch struct {
5352
Playbook string `yaml:"playbook"`
5453
Role string `yaml:"role"`
5554
ReconcilePeriod string `yaml:"reconcilePeriod"`
56-
ManagedStatus string `yaml:"managedStatus"`
55+
ManagedStatus *bool `yaml:"manageStatus"`
5756
Finalizer *Finalizer `yaml:"finalizer"`
5857
}
5958

@@ -95,12 +94,8 @@ func NewFromWatches(path string) (map[schema.GroupVersionKind]Runner, error) {
9594
reconcilePeriod = &d
9695
}
9796
var managedStatus *bool
98-
if w.ManagedStatus != "" {
99-
stat, err := strconv.ParseBool(w.ManagedStatus)
100-
if err != nil {
101-
return nil, fmt.Errorf("unable to parse managedStatus: %v - %v, setting to default", w.ManagedStatus, err)
102-
}
103-
managedStatus = &stat
97+
if w.ManagedStatus != nil {
98+
managedStatus = w.ManagedStatus
10499
}
105100

106101
// Check if schema is a duplicate

pkg/ansible/runner/testdata/valid.yaml.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
group: app.example.com
2323
kind: DisableStatus
2424
playbook: {{ .ValidPlaybook }}
25-
managedStatus: False
25+
manageStatus: False
2626
- version: v1alpha1
2727
group: app.example.com
2828
kind: Role

0 commit comments

Comments
 (0)