Skip to content

Commit c43f4f8

Browse files
author
Michael Tewoldemedhin
committed
Added tests to event_source_mapping and alias_ref for namespace reference check
1 parent 9c894c2 commit c43f4f8

28 files changed

+399
-41
lines changed

apis/v1alpha1/ack-generate-metadata.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
ack_generate_info:
2-
build_date: "2024-07-19T23:01:33Z"
3-
build_hash: f0a0f42d507c550c2b063a192b3b43e4522bdd9c
2+
build_date: "2024-07-30T00:06:18Z"
3+
build_hash: 49afe38983d285f926b51b6d34e39a4d9aeffb85
44
go_version: go1.22.5
5-
version: v0.35.0
5+
version: v0.35.0-2-g49afe38
66
api_directory_checksum: 93229b2f11a89ef43fc0ef07ea1beb425e9aaf17
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.44.181

config/crd/bases/lambda.services.k8s.aws_aliases.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ spec:
127127
properties:
128128
name:
129129
type: string
130+
namespace:
131+
type: string
130132
type: object
131133
type: object
132134
functionVersion:

config/crd/bases/lambda.services.k8s.aws_eventsourcemappings.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ spec:
138138
properties:
139139
name:
140140
type: string
141+
namespace:
142+
type: string
141143
type: object
142144
type: object
143145
filterCriteria:
@@ -193,6 +195,8 @@ spec:
193195
properties:
194196
name:
195197
type: string
198+
namespace:
199+
type: string
196200
type: object
197201
type: object
198202
functionResponseTypes:
@@ -255,6 +259,8 @@ spec:
255259
properties:
256260
name:
257261
type: string
262+
namespace:
263+
type: string
258264
type: object
259265
type: object
260266
type: array

config/crd/bases/lambda.services.k8s.aws_functions.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ spec:
6464
properties:
6565
name:
6666
type: string
67+
namespace:
68+
type: string
6769
type: object
6870
type: object
6971
s3Key:
@@ -221,6 +223,8 @@ spec:
221223
properties:
222224
name:
223225
type: string
226+
namespace:
227+
type: string
224228
type: object
225229
type: object
226230
layers:
@@ -289,6 +293,8 @@ spec:
289293
properties:
290294
name:
291295
type: string
296+
namespace:
297+
type: string
292298
type: object
293299
type: object
294300
runtime:
@@ -353,6 +359,8 @@ spec:
353359
properties:
354360
name:
355361
type: string
362+
namespace:
363+
type: string
356364
type: object
357365
type: object
358366
type: array
@@ -375,6 +383,8 @@ spec:
375383
properties:
376384
name:
377385
type: string
386+
namespace:
387+
type: string
378388
type: object
379389
type: object
380390
type: array

config/crd/bases/lambda.services.k8s.aws_functionurlconfigs.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ spec:
110110
properties:
111111
name:
112112
type: string
113+
namespace:
114+
type: string
113115
type: object
114116
type: object
115117
qualifier:

config/crd/bases/lambda.services.k8s.aws_versions.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ spec:
115115
properties:
116116
name:
117117
type: string
118+
namespace:
119+
type: string
118120
type: object
119121
type: object
120122
provisionedConcurrencyConfig:

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
github.com/aws-controllers-k8s/kafka-controller v0.0.0-20230615185632-102279061de1
1111
github.com/aws-controllers-k8s/kms-controller v0.1.2
1212
github.com/aws-controllers-k8s/mq-controller v0.0.22
13-
github.com/aws-controllers-k8s/runtime v0.35.0
13+
github.com/aws-controllers-k8s/runtime v0.35.1-0.20240719172343-a132c887e8d4
1414
github.com/aws-controllers-k8s/s3-controller v0.1.5
1515
github.com/aws/aws-sdk-go v1.49.0
1616
github.com/go-logr/logr v1.4.1

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ github.com/aws-controllers-k8s/kms-controller v0.1.2 h1:9lb98jspqOpFpmIFHOJ6pRnO
88
github.com/aws-controllers-k8s/kms-controller v0.1.2/go.mod h1:6CoV0UMFd03EUF9dXgOTTScGdBhJzsWn9W0dw2n0kA4=
99
github.com/aws-controllers-k8s/mq-controller v0.0.22 h1:XxFSQL9yaaiiuZ6E/fh/+Y9C+3DG2c5oXWG/4ZNwd1w=
1010
github.com/aws-controllers-k8s/mq-controller v0.0.22/go.mod h1:p+YVFjpwlgRC+1cPeCabk1xTB1hTCU+RwYtFzrTnJmE=
11-
github.com/aws-controllers-k8s/runtime v0.35.0 h1:kLRLFOAcaFJRv/aEiWtb0qhlxFpwvmx6shCWNc1Tuas=
12-
github.com/aws-controllers-k8s/runtime v0.35.0/go.mod h1:gI2pWb20UGLP2SnHf1a1VzTd7iVVy+/I9VAzT0Y+Dew=
11+
github.com/aws-controllers-k8s/runtime v0.35.1-0.20240719172343-a132c887e8d4 h1:CW58T4qFJpoF37hCPlV1NHCc6mdxNf6jdvLobVolSY0=
12+
github.com/aws-controllers-k8s/runtime v0.35.1-0.20240719172343-a132c887e8d4/go.mod h1:gI2pWb20UGLP2SnHf1a1VzTd7iVVy+/I9VAzT0Y+Dew=
1313
github.com/aws-controllers-k8s/s3-controller v0.1.5 h1:5zb7jsh0fgbPM8cIvcsuH1dta1dKzaAnlwgvb6u3hOc=
1414
github.com/aws-controllers-k8s/s3-controller v0.1.5/go.mod h1:8Z8JlO5Hc1dZX2YELu94+lnOgKM0FioAHJBsyaWvtx8=
1515
github.com/aws/aws-sdk-go v1.49.0 h1:g9BkW1fo9GqKfwg2+zCD+TW/D36Ux+vtfJ8guF4AYmY=

helm/crds/lambda.services.k8s.aws_aliases.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ spec:
127127
properties:
128128
name:
129129
type: string
130+
namespace:
131+
type: string
130132
type: object
131133
type: object
132134
functionVersion:

helm/crds/lambda.services.k8s.aws_eventsourcemappings.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ spec:
138138
properties:
139139
name:
140140
type: string
141+
namespace:
142+
type: string
141143
type: object
142144
type: object
143145
filterCriteria:
@@ -193,6 +195,8 @@ spec:
193195
properties:
194196
name:
195197
type: string
198+
namespace:
199+
type: string
196200
type: object
197201
type: object
198202
functionResponseTypes:
@@ -255,6 +259,8 @@ spec:
255259
properties:
256260
name:
257261
type: string
262+
namespace:
263+
type: string
258264
type: object
259265
type: object
260266
type: array

helm/crds/lambda.services.k8s.aws_functions.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ spec:
6464
properties:
6565
name:
6666
type: string
67+
namespace:
68+
type: string
6769
type: object
6870
type: object
6971
s3Key:
@@ -221,6 +223,8 @@ spec:
221223
properties:
222224
name:
223225
type: string
226+
namespace:
227+
type: string
224228
type: object
225229
type: object
226230
layers:
@@ -289,6 +293,8 @@ spec:
289293
properties:
290294
name:
291295
type: string
296+
namespace:
297+
type: string
292298
type: object
293299
type: object
294300
runtime:
@@ -353,6 +359,8 @@ spec:
353359
properties:
354360
name:
355361
type: string
362+
namespace:
363+
type: string
356364
type: object
357365
type: object
358366
type: array
@@ -375,6 +383,8 @@ spec:
375383
properties:
376384
name:
377385
type: string
386+
namespace:
387+
type: string
378388
type: object
379389
type: object
380390
type: array

helm/crds/lambda.services.k8s.aws_functionurlconfigs.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ spec:
110110
properties:
111111
name:
112112
type: string
113+
namespace:
114+
type: string
113115
type: object
114116
type: object
115117
qualifier:

helm/crds/lambda.services.k8s.aws_versions.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ spec:
115115
properties:
116116
name:
117117
type: string
118+
namespace:
119+
type: string
118120
type: object
119121
type: object
120122
provisionedConcurrencyConfig:

helm/templates/_helpers.tpl

+10-1
Original file line numberDiff line numberDiff line change
@@ -355,4 +355,13 @@ rules:
355355
- get
356356
- patch
357357
- update
358-
{{- end }}
358+
{{- end }}
359+
360+
{{/* Convert k/v map to string like: "key1=value1,key2=value2,..." */}}
361+
{{- define "ack-lambda-controller.feature-gates" -}}
362+
{{- $list := list -}}
363+
{{- range $k, $v := .Values.featureGates -}}
364+
{{- $list = append $list (printf "%s=%s" $k ( $v | toString)) -}}
365+
{{- end -}}
366+
{{ join "," $list }}
367+
{{- end -}}

helm/templates/deployment.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ spec:
7979
{{- range $key, $value := .Values.reconcile.resourceMaxConcurrentSyncs }}
8080
- --reconcile-resource-max-concurrent-syncs
8181
- "$(RECONCILE_RESOURCE_MAX_CONCURRENT_SYNCS_{{ $key | upper }})"
82+
{{- end }}
83+
{{- if .Values.featureGates}}
84+
- --feature-gates
85+
- "$(FEATURE_GATES)"
8286
{{- end }}
8387
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
8488
imagePullPolicy: {{ .Values.image.pullPolicy }}
@@ -122,6 +126,10 @@ spec:
122126
{{- range $key, $value := .Values.reconcile.resourceMaxConcurrentSyncs }}
123127
- name: RECONCILE_RESOURCE_MAX_CONCURRENT_SYNCS_{{ $key | upper }}
124128
value: {{ $key }}={{ $value }}
129+
{{- end }}
130+
{{- if .Values.featureGates}}
131+
- name: FEATURE_GATES
132+
value: {{ include "ack-lambda-controller.feature-gates" . }}
125133
{{- end }}
126134
{{- if .Values.aws.credentials.secretName }}
127135
- name: AWS_SHARED_CREDENTIALS_FILE

helm/values.schema.json

+7
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,13 @@
268268
"type": "object"
269269
}
270270
},
271+
"featureGates": {
272+
"description": "Feature gates settings",
273+
"type": "object",
274+
"additionalProperties": {
275+
"type": "boolean"
276+
}
277+
},
271278
"required": [
272279
"image",
273280
"deployment",

helm/values.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,10 @@ leaderElection:
153153
# will attempt to use the namespace of the service account mounted to the Controller
154154
# pod.
155155
namespace: ""
156+
157+
# Configuration for feature gates. These are optional controller features that
158+
# can be individually enabled ("true") or disabled ("false") by adding key/value
159+
# pairs below.
160+
featureGates: {}
161+
# featureGate1: true
162+
# featureGate2: false

pkg/resource/alias/references.go

+5-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)