File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,9 @@ const (
15
15
InventoryPolicyStrict = "strict"
16
16
InventoryPolicyAdopt = "adopt"
17
17
InventoryPolicyForceAdopt = "force-adopt"
18
+ StatusPolicyFlag = "status-policy"
19
+ StatusPolicyAll = "all"
20
+ StatusPolicyNone = "none"
18
21
)
19
22
20
23
// ConvertPropagationPolicy converts a propagationPolicy described as a
@@ -47,6 +50,19 @@ func ConvertInventoryPolicy(policy string) (inventory.Policy, error) {
47
50
}
48
51
}
49
52
53
+ // ConvertStatusPolicy converts as status policy described as a string to a
54
+ // StatusPolicy type that is passed into the Applier.
55
+ func ConvertStatusPolicy (policy string ) (inventory.StatusPolicy , error ) {
56
+ switch policy {
57
+ case StatusPolicyNone :
58
+ return inventory .StatusPolicyNone , nil
59
+ case StatusPolicyAll :
60
+ return inventory .StatusPolicyAll , nil
61
+ default :
62
+ return inventory .StatusPolicyAll , fmt .Errorf ("status policy must be one of none, all" )
63
+ }
64
+ }
65
+
50
66
// PathFromArgs returns the path which is a positional arg from args list
51
67
// returns "-" if there is length of args is 0, which implies no path is provided
52
68
func PathFromArgs (args []string ) string {
You can’t perform that action at this time.
0 commit comments