Skip to content
This repository was archived by the owner on May 24, 2023. It is now read-only.

Commit 5fbb599

Browse files
authored
Replave v1beta1 with v1 and remove uses of flag 'use-ingress-class (#151)
1 parent c752b93 commit 5fbb599

10 files changed

+13
-54
lines changed

api/v1alpha1/nginxingresscontroller_types.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ type NginxIngressControllerSpec struct {
6464
// +operator-sdk:csv:customresourcedefinitions:type=spec
6565
EnablePreviewPolicies bool `json:"enablePreviewPolicies"`
6666
// A class of the Ingress controller. The Ingress controller only processes Ingress resources that belong to its
67-
// class (in other words, have the annotation “kubernetes.io/ingress.class”).
68-
// Additionally, the Ingress controller processes Ingress resources that do not have that annotation,
69-
// which can be disabled by setting UseIngressClassOnly to true. Default is `nginx`.
67+
// class (in other words, have the annotation “kubernetes.io/ingress.class”). Default is `nginx`.
7068
// +kubebuilder:validation:Optional
7169
// +operator-sdk:csv:customresourcedefinitions:type=spec
7270
IngressClass string `json:"ingressClass"`
@@ -75,10 +73,6 @@ type NginxIngressControllerSpec struct {
7573
// +nullable
7674
// +operator-sdk:csv:customresourcedefinitions:type=spec
7775
Service *Service `json:"service"`
78-
// Ignore Ingress resources without the “kubernetes.io/ingress.class” annotation.
79-
// +kubebuilder:validation:Optional
80-
// +operator-sdk:csv:customresourcedefinitions:type=spec
81-
UseIngressClassOnly bool `json:"useIngressClassOnly"`
8276
// Namespace to watch for Ingress resources. By default the Ingress controller watches all namespaces.
8377
// +kubebuilder:validation:Optional
8478
// +operator-sdk:csv:customresourcedefinitions:type=spec

bundle/manifests/k8s.nginx.org_nginxingresscontrollers.yaml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,7 @@ spec:
135135
ingressClass:
136136
description: A class of the Ingress controller. The Ingress controller
137137
only processes Ingress resources that belong to its class (in other
138-
words, have the annotation “kubernetes.io/ingress.class”). Additionally,
139-
the Ingress controller processes Ingress resources that do not have
140-
that annotation, which can be disabled by setting UseIngressClassOnly
141-
to true. Default is `nginx`.
138+
words, have the annotation “kubernetes.io/ingress.class”). Default is `nginx`.
142139
type: string
143140
logLevel:
144141
description: Log level for V logs. Format is 0 - 3
@@ -263,10 +260,6 @@ spec:
263260
- deployment
264261
- daemonset
265262
type: string
266-
useIngressClassOnly:
267-
description: Ignore Ingress resources without the “kubernetes.io/ingress.class”
268-
annotation.
269-
type: boolean
270263
watchNamespace:
271264
description: Namespace to watch for Ingress resources. By default
272265
the Ingress controller watches all namespaces.

bundle/manifests/nginx-ingress-operator.clusterserviceversion.yaml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,7 @@ spec:
104104
path: image
105105
- description: A class of the Ingress controller. The Ingress controller only
106106
processes Ingress resources that belong to its class (in other words, have
107-
the annotation “kubernetes.io/ingress.class”). Additionally, the Ingress
108-
controller processes Ingress resources that do not have that annotation,
109-
which can be disabled by setting UseIngressClassOnly to true. Default is
110-
`nginx`.
107+
the annotation “kubernetes.io/ingress.class”). Default is `nginx`.
111108
displayName: Ingress Class
112109
path: ingressClass
113110
- description: Log level for V logs. Format is 0 - 3
@@ -157,10 +154,6 @@ spec:
157154
or daemonset.
158155
displayName: Type
159156
path: type
160-
- description: Ignore Ingress resources without the “kubernetes.io/ingress.class”
161-
annotation.
162-
displayName: Use Ingress Class Only
163-
path: useIngressClassOnly
164157
- description: Namespace to watch for Ingress resources. By default the Ingress
165158
controller watches all namespaces.
166159
displayName: Watch Namespace

config/crd/bases/k8s.nginx.org_nginxingresscontrollers.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,8 @@ spec:
137137
ingressClass:
138138
description: A class of the Ingress controller. The Ingress controller
139139
only processes Ingress resources that belong to its class (in other
140-
words, have the annotation “kubernetes.io/ingress.class”). Additionally,
141-
the Ingress controller processes Ingress resources that do not have
142-
that annotation, which can be disabled by setting UseIngressClassOnly
143-
to true. Default is `nginx`.
140+
words, have the annotation “kubernetes.io/ingress.class”). Default
141+
is `nginx`.
144142
type: string
145143
logLevel:
146144
description: Log level for V logs. Format is 0 - 3
@@ -265,10 +263,6 @@ spec:
265263
- deployment
266264
- daemonset
267265
type: string
268-
useIngressClassOnly:
269-
description: Ignore Ingress resources without the “kubernetes.io/ingress.class”
270-
annotation.
271-
type: boolean
272266
watchNamespace:
273267
description: Namespace to watch for Ingress resources. By default
274268
the Ingress controller watches all namespaces.

config/manifests/bases/nginx-ingress-operator.clusterserviceversion.yaml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,7 @@ spec:
8282
path: image
8383
- description: A class of the Ingress controller. The Ingress controller only
8484
processes Ingress resources that belong to its class (in other words, have
85-
the annotation “kubernetes.io/ingress.class”). Additionally, the Ingress
86-
controller processes Ingress resources that do not have that annotation,
87-
which can be disabled by setting UseIngressClassOnly to true. Default is
88-
`nginx`.
85+
the annotation “kubernetes.io/ingress.class”). Default is `nginx`.
8986
displayName: Ingress Class
9087
path: ingressClass
9188
- description: Log level for V logs. Format is 0 - 3
@@ -135,10 +132,6 @@ spec:
135132
or daemonset.
136133
displayName: Type
137134
path: type
138-
- description: Ignore Ingress resources without the “kubernetes.io/ingress.class”
139-
annotation.
140-
displayName: Use Ingress Class Only
141-
path: useIngressClassOnly
142135
- description: Namespace to watch for Ingress resources. By default the Ingress
143136
controller watches all namespaces.
144137
displayName: Watch Namespace

controllers/ingressclass.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package controllers
22

33
import (
44
k8sv1alpha1 "github.com/nginxinc/nginx-ingress-operator/api/v1alpha1"
5-
networking "k8s.io/api/networking/v1beta1"
5+
networking "k8s.io/api/networking/v1"
66
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
77
)
88

controllers/ingressclass_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55

66
"github.com/google/go-cmp/cmp"
77
k8sv1alpha1 "github.com/nginxinc/nginx-ingress-operator/api/v1alpha1"
8-
networking "k8s.io/api/networking/v1beta1"
8+
networking "k8s.io/api/networking/v1"
99
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1010
)
1111

controllers/utils.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ func generatePodArgs(instance *k8sv1alpha1.NginxIngressController) []string {
4444
args = append(args, fmt.Sprintf("-ingress-class=%v", instance.Spec.IngressClass))
4545
}
4646

47-
if instance.Spec.UseIngressClassOnly {
48-
args = append(args, "-use-ingress-class-only")
49-
}
50-
5147
if instance.Spec.WatchNamespace != "" {
5248
args = append(args, fmt.Sprintf("-watch-namespace=%v", instance.Spec.WatchNamespace))
5349
}

controllers/utils_test.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,10 @@ func TestGeneratePodArgs(t *testing.T) {
199199
Namespace: namespace,
200200
},
201201
Spec: k8sv1alpha1.NginxIngressControllerSpec{
202-
NginxPlus: true,
203-
DefaultSecret: "my-nginx-ingress/my-secret",
204-
IngressClass: "ingressClass",
205-
UseIngressClassOnly: true,
206-
WatchNamespace: "default",
202+
NginxPlus: true,
203+
DefaultSecret: "my-nginx-ingress/my-secret",
204+
IngressClass: "ingressClass",
205+
WatchNamespace: "default",
207206
HealthStatus: &k8sv1alpha1.HealthStatus{
208207
Enable: true,
209208
URI: "/healthz",
@@ -245,7 +244,6 @@ func TestGeneratePodArgs(t *testing.T) {
245244
"-nginx-plus",
246245
"-enable-app-protect",
247246
"-ingress-class=ingressClass",
248-
"-use-ingress-class-only",
249247
"-watch-namespace=default",
250248
"-health-status",
251249
"-health-status-uri=/healthz",

docs/nginx-ingress-controller.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ spec:
4646
enablePreviewPolicies: false
4747
defaultSecret: my-nginx-ingress/default-secret
4848
ingressClass: my-nginx-ingress
49-
useIngressClassOnly: true
5049
watchNamespace: default
5150
healthStatus:
5251
enable: true
@@ -87,9 +86,8 @@ spec:
8786
| `enableCRDs` | `boolean` | Enables the use of NGINX Ingress Resource Definitions (VirtualServer and VirtualServerRoute). Default is `true`. | No |
8887
| `enableSnippets` | `boolean` | Enable custom NGINX configuration snippets in VirtualServer, VirtualServerRoute and TransportServer resources. Requires `enableCRDs` set to `true`. | No |
8988
| `enablePreviewPolicies` | `boolean` | Enables preview policies. Requires `enableCRDs` set to `true`. | No |
90-
| `ingressClass` | `string` | A class of the Ingress controller. For Kubernetes >= 1.18, the Ingress controller only processes resources that belong to its class - i.e. have the "ingressClassName" field resource equal to the class. Additionally the Ingress Controller processes all the VirtualServer/VirtualServerRoute resources that do not have the "ingressClassName" field. For Kubernetes < 1.18, the Ingress Controller only processes resources that belong to its class - i.e have the annotation "kubernetes.io/ingress.class" (for Ingress resources) or field "ingressClassName" (for VirtualServer/VirtualServerRoute resources) equal to the class. Additionally, the Ingress Controller processes resources that do not have the class set, which can be disabled by setting `useIngressClassOnly` to `true`. Default is `nginx`. | No |
89+
| `ingressClass` | `string` | A class of the Ingress controller. The Ingress controller only processes resources that belong to its class - i.e. have the "ingressClassName" field resource equal to the class. Additionally the Ingress Controller processes all the VirtualServer/VirtualServerRoute resources that do not have the "ingressClassName" field. Additionally, the Ingress Controller processes resources that do not have the class set. Default is `nginx`. | No |
9190
| `service` | [service](#nginxingresscontrollerservice) | The service of the Ingress Controller. | No |
92-
| `useIngressClassOnly` | `boolean` | Ignore Ingress resources without the `"kubernetes.io/ingress.class"` annotation. For kubernetes versions >= 1.18 this flag will be IGNORED. | No |
9391
| `watchNamespace` | `boolean` | Namespace to watch for Ingress resources. By default the Ingress controller watches all namespaces. | No |
9492
| `healthStatus` | [healthStatus](#nginxingresscontrollerhealthstatus) | Adds a new location to the default server. The location responds with the 200 status code for any request. Useful for external health-checking of the Ingress Controller. | No |
9593
| `nginxDebug` | `boolean` | Enable debugging for NGINX. Uses the nginx-debug binary. Requires `error-log-level: debug` in the configMapData. | No |

0 commit comments

Comments
 (0)