Skip to content

Commit

Permalink
Merge pull request #744 from njhale/update-group-manifests
Browse files Browse the repository at this point in the history
chore(manifests): regenerate manifests to include new anyOf validation
  • Loading branch information
openshift-merge-robot authored Mar 7, 2019
2 parents 8d22327 + 20739d3 commit a9736f0
Show file tree
Hide file tree
Showing 11 changed files with 166 additions and 137 deletions.
64 changes: 35 additions & 29 deletions deploy/ocp/manifests/0.8.1/0000_50_olm_09-operatorgroup.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,35 +32,41 @@ spec:
selector:
type: object
description: Optional label selector to find resources associated with or managed by the operator
properties:
matchLabels:
type: object
description: Label key:value pairs to match directly
matchExpressions:
type: array
description: A set of expressions to match against the resource.
items:
allOf:
- type: object
required:
- key
- operator
- values
properties:
key:
type: string
description: the key to match
operator:
type: string
description: the operator for the expression
enum:
- In
- NotIn
- Exists
- DoesNotExist
values:
type: array
description: set of values for the expression
anyOf:
- properties:
matchLabels:
type: object
description: Label key:value pairs to match directly
required:
- matchLabels
- properties:
matchExpressions:
type: array
description: A set of expressions to match against the resource.
items:
allOf:
- type: object
required:
- key
- operator
- values
properties:
key:
type: string
description: the key to match
operator:
type: string
description: the operator for the expression
enum:
- In
- NotIn
- Exists
- DoesNotExist
values:
type: array
description: set of values for the expression
required:
- matchExpressions
targetNamespaces:
type: array
description: Optional list of target namespaces. If set, OLM will ignore selector.
Expand Down
2 changes: 1 addition & 1 deletion deploy/ocp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ package:
beta.kubernetes.io/os: linux
node-role.kubernetes.io/master: ""
tolerations:
- operator: Exists
- operator: Exists
64 changes: 35 additions & 29 deletions deploy/okd/manifests/0.8.1/0000_50_olm_09-operatorgroup.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,35 +32,41 @@ spec:
selector:
type: object
description: Optional label selector to find resources associated with or managed by the operator
properties:
matchLabels:
type: object
description: Label key:value pairs to match directly
matchExpressions:
type: array
description: A set of expressions to match against the resource.
items:
allOf:
- type: object
required:
- key
- operator
- values
properties:
key:
type: string
description: the key to match
operator:
type: string
description: the operator for the expression
enum:
- In
- NotIn
- Exists
- DoesNotExist
values:
type: array
description: set of values for the expression
anyOf:
- properties:
matchLabels:
type: object
description: Label key:value pairs to match directly
required:
- matchLabels
- properties:
matchExpressions:
type: array
description: A set of expressions to match against the resource.
items:
allOf:
- type: object
required:
- key
- operator
- values
properties:
key:
type: string
description: the key to match
operator:
type: string
description: the operator for the expression
enum:
- In
- NotIn
- Exists
- DoesNotExist
values:
type: array
description: set of values for the expression
required:
- matchExpressions
targetNamespaces:
type: array
description: Optional list of target namespaces. If set, OLM will ignore selector.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,35 +32,41 @@ spec:
selector:
type: object
description: Optional label selector to find resources associated with or managed by the operator
properties:
matchLabels:
type: object
description: Label key:value pairs to match directly
matchExpressions:
type: array
description: A set of expressions to match against the resource.
items:
allOf:
- type: object
required:
- key
- operator
- values
properties:
key:
type: string
description: the key to match
operator:
type: string
description: the operator for the expression
enum:
- In
- NotIn
- Exists
- DoesNotExist
values:
type: array
description: set of values for the expression
anyOf:
- properties:
matchLabels:
type: object
description: Label key:value pairs to match directly
required:
- matchLabels
- properties:
matchExpressions:
type: array
description: A set of expressions to match against the resource.
items:
allOf:
- type: object
required:
- key
- operator
- values
properties:
key:
type: string
description: the key to match
operator:
type: string
description: the operator for the expression
enum:
- In
- NotIn
- Exists
- DoesNotExist
values:
type: array
description: set of values for the expression
required:
- matchExpressions
targetNamespaces:
type: array
description: Optional list of target namespaces. If set, OLM will ignore selector.
Expand Down
6 changes: 3 additions & 3 deletions deploy/upstream/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ writeStatusName: '""'
olm:
replicaCount: 1
image:
ref: quay.io/openshift/origin-operator-lifecycle-manager:latest
ref: quay.io/coreos/olm@sha256:995a181839f301585a0e115c083619b6d73812c58a8444d7b13b8e407010325f
pullPolicy: IfNotPresent
service:
internalPort: 8080
catalog:
replicaCount: 1
image:
ref: quay.io/openshift/origin-operator-lifecycle-manager:latest
ref: quay.io/coreos/olm@sha256:995a181839f301585a0e115c083619b6d73812c58a8444d7b13b8e407010325f
pullPolicy: IfNotPresent
service:
internalPort: 8080
package:
replicaCount: 2
image:
ref: quay.io/openshift/origin-operator-lifecycle-manager:latest
ref: quay.io/coreos/olm@sha256:995a181839f301585a0e115c083619b6d73812c58a8444d7b13b8e407010325f
pullPolicy: Always
service:
internalPort: 5443
Expand Down
66 changes: 36 additions & 30 deletions manifests/0000_50_olm_09-operatorgroup.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,35 +30,41 @@ spec:
selector:
type: object
description: Optional label selector to find resources associated with or managed by the operator
properties:
matchLabels:
type: object
description: Label key:value pairs to match directly
matchExpressions:
type: array
description: A set of expressions to match against the resource.
items:
allOf:
- type: object
required:
- key
- operator
- values
properties:
key:
type: string
description: the key to match
operator:
type: string
description: the operator for the expression
enum:
- In
- NotIn
- Exists
- DoesNotExist
values:
type: array
description: set of values for the expression
anyOf:
- properties:
matchLabels:
type: object
description: Label key:value pairs to match directly
required:
- matchLabels
- properties:
matchExpressions:
type: array
description: A set of expressions to match against the resource.
items:
allOf:
- type: object
required:
- key
- operator
- values
properties:
key:
type: string
description: the key to match
operator:
type: string
description: the operator for the expression
enum:
- In
- NotIn
- Exists
- DoesNotExist
values:
type: array
description: set of values for the expression
required:
- matchExpressions
targetNamespaces:
type: array
description: Optional list of target namespaces. If set, OLM will ignore selector.
Expand All @@ -85,4 +91,4 @@ spec:
- lastUpdated
type: object
required:
- metadata
- metadata
2 changes: 1 addition & 1 deletion pkg/api/apis/operators/v1alpha2/operatorgroup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
type OperatorGroupSpec struct {
// Selector selects the OperatorGroup's target namespaces.
// +optional
Selector metav1.LabelSelector `json:"selector,omitempty"`
Selector *metav1.LabelSelector `json:"selector,omitempty"`

// TargetNamespaces is an explicit set of namespaces to target.
// If it is set, Selector is ignored.
Expand Down
7 changes: 6 additions & 1 deletion pkg/api/apis/operators/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pkg/controller/operators/olm/operator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2970,7 +2970,7 @@ func TestSyncOperatorGroups(t *testing.T) {
Namespace: operatorNamespace,
},
Spec: v1alpha2.OperatorGroupSpec{
Selector: metav1.LabelSelector{
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{"a": "app-a"},
},
},
Expand Down Expand Up @@ -3000,7 +3000,7 @@ func TestSyncOperatorGroups(t *testing.T) {
Namespace: operatorNamespace,
},
Spec: v1alpha2.OperatorGroupSpec{
Selector: metav1.LabelSelector{
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{"app": "app-a"},
},
},
Expand Down Expand Up @@ -3034,7 +3034,7 @@ func TestSyncOperatorGroups(t *testing.T) {
Namespace: operatorNamespace,
},
Spec: v1alpha2.OperatorGroupSpec{
Selector: metav1.LabelSelector{
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{"app": "app-a"},
},
},
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/operators/olm/operatorgroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ func namespacesChanged(clusterNamespaces []string, statusNamespaces []string) bo
}

func (a *Operator) getOperatorGroupTargets(op *v1alpha2.OperatorGroup) ([]string, error) {
selector, err := metav1.LabelSelectorAsSelector(&op.Spec.Selector)
selector, err := metav1.LabelSelectorAsSelector(op.Spec.Selector)
if err != nil {
return nil, err
}
Expand All @@ -573,7 +573,7 @@ func (a *Operator) getOperatorGroupTargets(op *v1alpha2.OperatorGroup) ([]string
}
namespaceSet[ns] = struct{}{}
}
} else if selector == nil || selector.Empty() {
} else if selector == nil || selector.Empty() || selector == labels.Nothing() {
namespaceSet[corev1.NamespaceAll] = struct{}{}
} else {
matchedNamespaces, err := a.lister.CoreV1().NamespaceLister().List(selector)
Expand Down
Loading

0 comments on commit a9736f0

Please sign in to comment.