From 3635738d06b4852b136906fb94873d7e081e60fc Mon Sep 17 00:00:00 2001 From: Grant Spence Date: Mon, 21 Mar 2022 15:59:45 -0400 Subject: [PATCH] Bug 1944851: Add selectors to ingress controller status for determining state --- ...ess-operator_00-ingresscontroller.crd.yaml | 89 +++++++++++++++++++ operator/v1/types_ingress.go | 8 ++ operator/v1/zz_generated.deepcopy.go | 10 +++ .../v1/zz_generated.swagger_doc_generated.go | 2 + 4 files changed, 109 insertions(+) diff --git a/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml b/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml index acb2c405878..babac6c3eb3 100644 --- a/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml +++ b/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml @@ -1418,10 +1418,99 @@ spec: required: - type type: object + namespaceSelector: + description: namespaceSelector is the actual namespaceSelector in + use. + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. + The requirements are ANDed. + items: + description: A label selector requirement is a selector that + contains values, a key, and an operator that relates the key + and values. + properties: + key: + description: key is the label key that the selector applies + to. + type: string + operator: + description: operator represents a key's relationship to + a set of values. Valid operators are In, NotIn, Exists + and DoesNotExist. + type: string + values: + description: values is an array of string values. If the + operator is In or NotIn, the values array must be non-empty. + If the operator is Exists or DoesNotExist, the values + array must be empty. This array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. A single + {key,value} in the matchLabels map is equivalent to an element + of matchExpressions, whose key field is "key", the operator + is "In", and the values array contains only "value". The requirements + are ANDed. + type: object + type: object observedGeneration: description: observedGeneration is the most recent generation observed. format: int64 type: integer + routeSelector: + description: routeSelector is the actual routeSelector in use. + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. + The requirements are ANDed. + items: + description: A label selector requirement is a selector that + contains values, a key, and an operator that relates the key + and values. + properties: + key: + description: key is the label key that the selector applies + to. + type: string + operator: + description: operator represents a key's relationship to + a set of values. Valid operators are In, NotIn, Exists + and DoesNotExist. + type: string + values: + description: values is an array of string values. If the + operator is In or NotIn, the values array must be non-empty. + If the operator is Exists or DoesNotExist, the values + array must be empty. This array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. A single + {key,value} in the matchLabels map is equivalent to an element + of matchExpressions, whose key field is "key", the operator + is "In", and the values array contains only "value". The requirements + are ANDed. + type: object + type: object selector: description: selector is a label selector, in string format, for ingress controller pods corresponding to the IngressController. The number diff --git a/operator/v1/types_ingress.go b/operator/v1/types_ingress.go index a50b2b78d25..c347e91fbea 100644 --- a/operator/v1/types_ingress.go +++ b/operator/v1/types_ingress.go @@ -1397,6 +1397,14 @@ type IngressControllerStatus struct { // observedGeneration is the most recent generation observed. // +optional ObservedGeneration int64 `json:"observedGeneration,omitempty"` + + // namespaceSelector is the actual namespaceSelector in use. + // +optional + NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty"` + + // routeSelector is the actual routeSelector in use. + // +optional + RouteSelector *metav1.LabelSelector `json:"routeSelector,omitempty"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/operator/v1/zz_generated.deepcopy.go b/operator/v1/zz_generated.deepcopy.go index 23859af6d2b..c146dc2e018 100644 --- a/operator/v1/zz_generated.deepcopy.go +++ b/operator/v1/zz_generated.deepcopy.go @@ -1703,6 +1703,16 @@ func (in *IngressControllerStatus) DeepCopyInto(out *IngressControllerStatus) { *out = new(configv1.TLSProfileSpec) (*in).DeepCopyInto(*out) } + if in.NamespaceSelector != nil { + in, out := &in.NamespaceSelector, &out.NamespaceSelector + *out = new(metav1.LabelSelector) + (*in).DeepCopyInto(*out) + } + if in.RouteSelector != nil { + in, out := &in.RouteSelector, &out.RouteSelector + *out = new(metav1.LabelSelector) + (*in).DeepCopyInto(*out) + } return } diff --git a/operator/v1/zz_generated.swagger_doc_generated.go b/operator/v1/zz_generated.swagger_doc_generated.go index e42c685eb9b..d62760ca58a 100644 --- a/operator/v1/zz_generated.swagger_doc_generated.go +++ b/operator/v1/zz_generated.swagger_doc_generated.go @@ -726,6 +726,8 @@ var map_IngressControllerStatus = map[string]string{ "conditions": "conditions is a list of conditions and their status.\n\nAvailable means the ingress controller deployment is available and servicing route and ingress resources (i.e, .status.availableReplicas equals .spec.replicas)\n\nThere are additional conditions which indicate the status of other ingress controller features and capabilities.\n\n * LoadBalancerManaged\n - True if the following conditions are met:\n * The endpoint publishing strategy requires a service load balancer.\n - False if any of those conditions are unsatisfied.\n\n * LoadBalancerReady\n - True if the following conditions are met:\n * A load balancer is managed.\n * The load balancer is ready.\n - False if any of those conditions are unsatisfied.\n\n * DNSManaged\n - True if the following conditions are met:\n * The endpoint publishing strategy and platform support DNS.\n * The ingress controller domain is set.\n * dns.config.openshift.io/cluster configures DNS zones.\n - False if any of those conditions are unsatisfied.\n\n * DNSReady\n - True if the following conditions are met:\n * DNS is managed.\n * DNS records have been successfully created.\n - False if any of those conditions are unsatisfied.", "tlsProfile": "tlsProfile is the TLS connection configuration that is in effect.", "observedGeneration": "observedGeneration is the most recent generation observed.", + "namespaceSelector": "namespaceSelector is the actual namespaceSelector in use.", + "routeSelector": "routeSelector is the actual routeSelector in use.", } func (IngressControllerStatus) SwaggerDoc() map[string]string {