Skip to content

Commit 765c6d9

Browse files
author
Niklas Simons
committed
Bump client-go, controller-runtime and related dependencies
Signed-off-by: Niklas Simons <[email protected]>
1 parent b28dae1 commit 765c6d9

37 files changed

+240
-220
lines changed

cmd/contour/ingressstatus.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func (isw *loadBalancerStatusWriter) Start(ctx context.Context) error {
125125
isw.log.WithError(err).WithField("kind", "Ingress").Error("failed to list objects")
126126
} else {
127127
for i := range ingressList.Items {
128-
u.OnAdd(&ingressList.Items[i])
128+
u.OnAdd(&ingressList.Items[i], false)
129129
}
130130
}
131131

@@ -134,7 +134,7 @@ func (isw *loadBalancerStatusWriter) Start(ctx context.Context) error {
134134
isw.log.WithError(err).WithField("kind", "HTTPProxy").Error("failed to list objects")
135135
} else {
136136
for i := range proxyList.Items {
137-
u.OnAdd(&proxyList.Items[i])
137+
u.OnAdd(&proxyList.Items[i], false)
138138
}
139139
}
140140

@@ -146,7 +146,7 @@ func (isw *loadBalancerStatusWriter) Start(ctx context.Context) error {
146146
isw.log.WithError(err).WithField("kind", "Gateway").Error("failed to list objects")
147147
} else {
148148
for i := range gatewayList.Items {
149-
u.OnAdd(&gatewayList.Items[i])
149+
u.OnAdd(&gatewayList.Items[i], false)
150150
}
151151
}
152152
}

cmd/contour/serve.go

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -216,33 +216,32 @@ func NewServer(log logrus.FieldLogger, ctx *serveContext) (*Server, error) {
216216
Scheme: scheme,
217217
MetricsBindAddress: "0",
218218
HealthProbeBindAddress: "0",
219-
NewCache: ctrl_cache.BuilderWithOptions(ctrl_cache.Options{
220-
// TransformByObject is a function that allows changing incoming objects before they are cached by the informer.
219+
Cache: ctrl_cache.Options{
220+
// ByObject is a function that allows changing incoming objects before they are cached by the informer.
221221
// This is useful for saving memory by removing fields that are not needed by Contour.
222-
TransformByObject: ctrl_cache.TransformByObject{
223-
&corev1.Secret{}: func(obj interface{}) (interface{}, error) {
224-
secret, ok := obj.(*corev1.Secret)
225-
// TransformFunc should handle the tombstone of type cache.DeletedFinalStateUnknown
226-
if !ok {
227-
return obj, nil
228-
}
229-
230-
// Do not touch Secrets that might be needed.
231-
if secret.Type == corev1.SecretTypeTLS || secret.Type == corev1.SecretTypeOpaque {
232-
return obj, nil
233-
}
234-
235-
// Other types of Secrets will never be referred to, so we can remove all data.
236-
// For example Secrets of type helm.sh/release.v1 can be quite large.
237-
// Last-applied-configuration annotation might contain a copy of the complete data.
238-
secret.Data = nil
239-
secret.SetManagedFields(nil)
240-
secret.SetAnnotations(nil)
241-
242-
// Returning error will avoid handlers from being called.
243-
// This does not avoid caching.
244-
return nil, fmt.Errorf("ignoring secret %s/%s of type %s", secret.Namespace, secret.Name, secret.Type)
245-
},
222+
ByObject: map[client.Object]ctrl_cache.ByObject{
223+
&corev1.Secret{}: {
224+
Transform: func(obj interface{}) (interface{}, error) {
225+
secret, ok := obj.(*corev1.Secret)
226+
// TransformFunc should handle the tombstone of type cache.DeletedFinalStateUnknown
227+
if !ok {
228+
return obj, nil
229+
}
230+
231+
// Do not touch Secrets that might be needed.
232+
if secret.Type == corev1.SecretTypeTLS || secret.Type == corev1.SecretTypeOpaque {
233+
return obj, nil
234+
}
235+
236+
// Other types of Secrets will never be referred to, so we can remove all data.
237+
// For example Secrets of type helm.sh/release.v1 can be quite large.
238+
// Last-applied-configuration annotation might contain a copy of the complete data.
239+
secret.Data = nil
240+
secret.SetManagedFields(nil)
241+
secret.SetAnnotations(nil)
242+
243+
return secret, nil
244+
}},
246245
},
247246
// DefaultTransform is called for objects that do not have a TransformByObject function.
248247
DefaultTransform: func(obj interface{}) (interface{}, error) {
@@ -255,7 +254,7 @@ func NewServer(log logrus.FieldLogger, ctx *serveContext) (*Server, error) {
255254
o.SetManagedFields(nil)
256255
return o, nil
257256
},
258-
}),
257+
},
259258
}
260259
if ctx.LeaderElection.Disable {
261260
log.Info("Leader election disabled")

examples/contour/01-crds.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,7 +1201,8 @@ spec:
12011201
description: 'Requests describes the minimum amount of compute
12021202
resources required. If Requests is omitted for a container,
12031203
it defaults to Limits if that is explicitly specified, otherwise
1204-
to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
1204+
to an implementation-defined value. Requests cannot exceed
1205+
Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
12051206
type: object
12061207
type: object
12071208
type: object
@@ -1793,7 +1794,7 @@ spec:
17931794
value between the SizeLimit specified here and the
17941795
sum of memory limits of all containers in a pod. The
17951796
default is nil which means that the limit is undefined.
1796-
More info: http://kubernetes.io/docs/user-guide/volumes#emptydir'
1797+
More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir'
17971798
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
17981799
x-kubernetes-int-or-string: true
17991800
type: object
@@ -2020,7 +2021,8 @@ spec:
20202021
If Requests is omitted for a container,
20212022
it defaults to Limits if that is explicitly
20222023
specified, otherwise to an implementation-defined
2023-
value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
2024+
value. Requests cannot exceed Limits.
2025+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
20242026
type: object
20252027
type: object
20262028
selector:
@@ -3177,7 +3179,8 @@ spec:
31773179
description: 'Requests describes the minimum amount of compute
31783180
resources required. If Requests is omitted for a container,
31793181
it defaults to Limits if that is explicitly specified, otherwise
3180-
to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
3182+
to an implementation-defined value. Requests cannot exceed
3183+
Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
31813184
type: object
31823185
type: object
31833186
workloadType:

examples/render/contour-deployment.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,7 +1414,8 @@ spec:
14141414
description: 'Requests describes the minimum amount of compute
14151415
resources required. If Requests is omitted for a container,
14161416
it defaults to Limits if that is explicitly specified, otherwise
1417-
to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
1417+
to an implementation-defined value. Requests cannot exceed
1418+
Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
14181419
type: object
14191420
type: object
14201421
type: object
@@ -2006,7 +2007,7 @@ spec:
20062007
value between the SizeLimit specified here and the
20072008
sum of memory limits of all containers in a pod. The
20082009
default is nil which means that the limit is undefined.
2009-
More info: http://kubernetes.io/docs/user-guide/volumes#emptydir'
2010+
More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir'
20102011
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
20112012
x-kubernetes-int-or-string: true
20122013
type: object
@@ -2233,7 +2234,8 @@ spec:
22332234
If Requests is omitted for a container,
22342235
it defaults to Limits if that is explicitly
22352236
specified, otherwise to an implementation-defined
2236-
value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
2237+
value. Requests cannot exceed Limits.
2238+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
22372239
type: object
22382240
type: object
22392241
selector:
@@ -3390,7 +3392,8 @@ spec:
33903392
description: 'Requests describes the minimum amount of compute
33913393
resources required. If Requests is omitted for a container,
33923394
it defaults to Limits if that is explicitly specified, otherwise
3393-
to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
3395+
to an implementation-defined value. Requests cannot exceed
3396+
Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
33943397
type: object
33953398
type: object
33963399
workloadType:

examples/render/contour-gateway-provisioner.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,7 +1215,8 @@ spec:
12151215
description: 'Requests describes the minimum amount of compute
12161216
resources required. If Requests is omitted for a container,
12171217
it defaults to Limits if that is explicitly specified, otherwise
1218-
to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
1218+
to an implementation-defined value. Requests cannot exceed
1219+
Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
12191220
type: object
12201221
type: object
12211222
type: object
@@ -1807,7 +1808,7 @@ spec:
18071808
value between the SizeLimit specified here and the
18081809
sum of memory limits of all containers in a pod. The
18091810
default is nil which means that the limit is undefined.
1810-
More info: http://kubernetes.io/docs/user-guide/volumes#emptydir'
1811+
More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir'
18111812
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
18121813
x-kubernetes-int-or-string: true
18131814
type: object
@@ -2034,7 +2035,8 @@ spec:
20342035
If Requests is omitted for a container,
20352036
it defaults to Limits if that is explicitly
20362037
specified, otherwise to an implementation-defined
2037-
value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
2038+
value. Requests cannot exceed Limits.
2039+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
20382040
type: object
20392041
type: object
20402042
selector:
@@ -3191,7 +3193,8 @@ spec:
31913193
description: 'Requests describes the minimum amount of compute
31923194
resources required. If Requests is omitted for a container,
31933195
it defaults to Limits if that is explicitly specified, otherwise
3194-
to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
3196+
to an implementation-defined value. Requests cannot exceed
3197+
Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
31953198
type: object
31963199
type: object
31973200
workloadType:

examples/render/contour-gateway.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,7 +1420,8 @@ spec:
14201420
description: 'Requests describes the minimum amount of compute
14211421
resources required. If Requests is omitted for a container,
14221422
it defaults to Limits if that is explicitly specified, otherwise
1423-
to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
1423+
to an implementation-defined value. Requests cannot exceed
1424+
Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
14241425
type: object
14251426
type: object
14261427
type: object
@@ -2012,7 +2013,7 @@ spec:
20122013
value between the SizeLimit specified here and the
20132014
sum of memory limits of all containers in a pod. The
20142015
default is nil which means that the limit is undefined.
2015-
More info: http://kubernetes.io/docs/user-guide/volumes#emptydir'
2016+
More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir'
20162017
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
20172018
x-kubernetes-int-or-string: true
20182019
type: object
@@ -2239,7 +2240,8 @@ spec:
22392240
If Requests is omitted for a container,
22402241
it defaults to Limits if that is explicitly
22412242
specified, otherwise to an implementation-defined
2242-
value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
2243+
value. Requests cannot exceed Limits.
2244+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
22432245
type: object
22442246
type: object
22452247
selector:
@@ -3396,7 +3398,8 @@ spec:
33963398
description: 'Requests describes the minimum amount of compute
33973399
resources required. If Requests is omitted for a container,
33983400
it defaults to Limits if that is explicitly specified, otherwise
3399-
to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
3401+
to an implementation-defined value. Requests cannot exceed
3402+
Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
34003403
type: object
34013404
type: object
34023405
workloadType:

examples/render/contour.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,7 +1414,8 @@ spec:
14141414
description: 'Requests describes the minimum amount of compute
14151415
resources required. If Requests is omitted for a container,
14161416
it defaults to Limits if that is explicitly specified, otherwise
1417-
to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
1417+
to an implementation-defined value. Requests cannot exceed
1418+
Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
14181419
type: object
14191420
type: object
14201421
type: object
@@ -2006,7 +2007,7 @@ spec:
20062007
value between the SizeLimit specified here and the
20072008
sum of memory limits of all containers in a pod. The
20082009
default is nil which means that the limit is undefined.
2009-
More info: http://kubernetes.io/docs/user-guide/volumes#emptydir'
2010+
More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir'
20102011
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
20112012
x-kubernetes-int-or-string: true
20122013
type: object
@@ -2233,7 +2234,8 @@ spec:
22332234
If Requests is omitted for a container,
22342235
it defaults to Limits if that is explicitly
22352236
specified, otherwise to an implementation-defined
2236-
value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
2237+
value. Requests cannot exceed Limits.
2238+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
22372239
type: object
22382240
type: object
22392241
selector:
@@ -3390,7 +3392,8 @@ spec:
33903392
description: 'Requests describes the minimum amount of compute
33913393
resources required. If Requests is omitted for a container,
33923394
it defaults to Limits if that is explicitly specified, otherwise
3393-
to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
3395+
to an implementation-defined value. Requests cannot exceed
3396+
Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
33943397
type: object
33953398
type: object
33963399
workloadType:

0 commit comments

Comments
 (0)