Skip to content

Commit b9d295d

Browse files
committed
manageStatus from watches.yaml should be *bool
1 parent 00cd1a5 commit b9d295d

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

@@ -56,7 +55,7 @@ type watch struct {
5655
Playbook string `yaml:"playbook"`
5756
Role string `yaml:"role"`
5857
ReconcilePeriod string `yaml:"reconcilePeriod"`
59-
ManagedStatus string `yaml:"managedStatus"`
58+
ManagedStatus *bool `yaml:"manageStatus"`
6059
Finalizer *Finalizer `yaml:"finalizer"`
6160
}
6261

@@ -98,12 +97,8 @@ func NewFromWatches(path string) (map[schema.GroupVersionKind]Runner, error) {
9897
reconcilePeriod = &d
9998
}
10099
var managedStatus *bool
101-
if w.ManagedStatus != "" {
102-
stat, err := strconv.ParseBool(w.ManagedStatus)
103-
if err != nil {
104-
return nil, fmt.Errorf("unable to parse managedStatus: %v - %v, setting to default", w.ManagedStatus, err)
105-
}
106-
managedStatus = &stat
100+
if w.ManagedStatus != nil {
101+
managedStatus = w.ManagedStatus
107102
}
108103

109104
// 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)