Skip to content

Commit 96da8f9

Browse files
authored
refactor(constraint): update none compound constraint to be not (#221)
Signed-off-by: Tyler Slaton <[email protected]>
1 parent 82aa2d4 commit 96da8f9

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

pkg/constraints/constraint.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@ type Constraint struct {
2525
// GVK defines a constraint for a GVK.
2626
GVK *GVKConstraint `json:"gvk,omitempty" yaml:"gvk,omitempty"`
2727

28-
// All, Any, and None are compound constraints. See this enhancement for details:
28+
// All, Any, and Not are compound constraints. See this enhancement for details:
2929
// https://github.com/operator-framework/enhancements/blob/master/enhancements/compound-bundle-constraints.md
3030
All *CompoundConstraint `json:"all,omitempty" yaml:"all,omitempty"`
3131
Any *CompoundConstraint `json:"any,omitempty" yaml:"any,omitempty"`
32-
// A note on None: this constraint is not particularly useful by itself.
32+
// A note on Not: this constraint isn't particularly useful by itself.
3333
// It should be used within an All constraint alongside some other constraint type
34-
// since saying "none of these GVKs/packages/etc." without an alternative doesn't make sense.
35-
None *CompoundConstraint `json:"none,omitempty" yaml:"none,omitempty"`
34+
// since saying "do not use any of these GVKs/packages/etc." without an alternative
35+
// doesn't make sense.
36+
Not *CompoundConstraint `json:"not,omitempty" yaml:"not,omitempty"`
3637
}
3738

3839
// CompoundConstraint holds a list of potentially nested constraints

pkg/constraints/constraint_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ func TestParse(t *testing.T) {
6565
},
6666
},
6767
{
68-
name: "Valid/BasicNone",
69-
input: json.RawMessage(fmt.Sprintf(inputBasicCompoundTmpl, "none")),
68+
name: "Valid/BasicNot",
69+
input: json.RawMessage(fmt.Sprintf(inputBasicCompoundTmpl, "not")),
7070
expConstraint: Constraint{
7171
FailureMessage: "blah",
72-
None: &CompoundConstraint{
72+
Not: &CompoundConstraint{
7373
Constraints: []Constraint{
7474
{
7575
FailureMessage: "blah blah",
@@ -109,7 +109,7 @@ func TestParse(t *testing.T) {
109109
},
110110
},
111111
{
112-
None: &CompoundConstraint{
112+
Not: &CompoundConstraint{
113113
Constraints: []Constraint{
114114
{GVK: &GVKConstraint{Group: "bazs.example.com", Kind: "Baz", Version: "v1alpha1"}},
115115
},
@@ -256,7 +256,7 @@ const (
256256
}
257257
},
258258
{
259-
"none": {
259+
"not": {
260260
"constraints": [
261261
{
262262
"gvk": {

0 commit comments

Comments
 (0)