Skip to content

Add resource reference for Amazon MQ brokers in EventSourceMapping resource #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions apis/v1alpha1/ack-generate-metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
ack_generate_info:
build_date: "2022-10-25T17:58:30Z"
build_hash: 9727031b415481d9ac28bb94cac9f1e73336401d
build_date: "2022-11-04T23:25:04Z"
build_hash: 7cd74c3a855e38ea3fb5e1cf40b26fbe96283870
go_version: go1.19
version: v0.19.3-9-g9727031
api_directory_checksum: e2da75eafa3ab7fe7cc4c8c26ba01e495e31d494
version: v0.19.3-15-g7cd74c3-dirty
api_directory_checksum: f01a03847a7bb58e935fdca90ecfb910f645ea61
api_version: v1alpha1
aws_sdk_go_version: v1.44.93
generator_config_info:
file_checksum: 1328b65627cf7280ef4df6c1b0435653e99fe62f
file_checksum: 8c3d1a125902512d09de13f6ff4337e07a5518f0
original_file_name: generator.yaml
last_modification:
reason: API generation
3 changes: 2 additions & 1 deletion apis/v1alpha1/event_source_mapping.go

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

5 changes: 5 additions & 0 deletions apis/v1alpha1/generator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ resources:
ignore: true
EventSourceMapping:
fields:
Queues:
references:
resource: Broker
path: Status.BrokerID
service_name: mq
UUID:
is_primary_key: true
FunctionName:
Expand Down
11 changes: 11 additions & 0 deletions apis/v1alpha1/zz_generated.deepcopy.go

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

2 changes: 2 additions & 0 deletions cmd/controller/main.go

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

16 changes: 16 additions & 0 deletions config/crd/bases/lambda.services.k8s.aws_eventsourcemappings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,22 @@ spec:
each shard concurrently.
format: int64
type: integer
queueRefs:
items:
description: 'AWSResourceReferenceWrapper provides a wrapper around
*AWSResourceReference type to provide more user friendly syntax
for references using ''from'' field Ex: APIIDRef: from: name:
my-api'
properties:
from:
description: AWSResourceReference provides all the values necessary
to reference another k8s resource for finding the identifier(Id/ARN/Name)
properties:
name:
type: string
type: object
type: object
type: array
queues:
description: (MQ) The name of the Amazon MQ broker destination queue
to consume.
Expand Down
14 changes: 14 additions & 0 deletions config/rbac/cluster-role-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,20 @@ rules:
- get
- patch
- update
- apiGroups:
- mq.services.k8s.aws
resources:
- brokers
verbs:
- get
- list
- apiGroups:
- mq.services.k8s.aws
resources:
- brokers/status
verbs:
- get
- list
- apiGroups:
- s3.services.k8s.aws
resources:
Expand Down
5 changes: 5 additions & 0 deletions generator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ resources:
ignore: true
EventSourceMapping:
fields:
Queues:
references:
resource: Broker
path: Status.BrokerID
service_name: mq
UUID:
is_primary_key: true
FunctionName:
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.17
require (
github.com/aws-controllers-k8s/ec2-controller v0.0.21
github.com/aws-controllers-k8s/kms-controller v0.1.2
github.com/aws-controllers-k8s/mq-controller v0.0.22
github.com/aws-controllers-k8s/runtime v0.20.1
github.com/aws-controllers-k8s/s3-controller v0.1.5
github.com/aws/aws-sdk-go v1.44.93
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ github.com/aws-controllers-k8s/ec2-controller v0.0.21 h1:5O7/9aED2Tl9OT0TL2rWrc1
github.com/aws-controllers-k8s/ec2-controller v0.0.21/go.mod h1:OMsmJeJ3iQZ1sJgs3hqnjBRnJ3hmTzJUO38W5rxnB5M=
github.com/aws-controllers-k8s/kms-controller v0.1.2 h1:9lb98jspqOpFpmIFHOJ6pRnOkC8kDEPIgTAb5QnVGZo=
github.com/aws-controllers-k8s/kms-controller v0.1.2/go.mod h1:6CoV0UMFd03EUF9dXgOTTScGdBhJzsWn9W0dw2n0kA4=
github.com/aws-controllers-k8s/mq-controller v0.0.22 h1:XxFSQL9yaaiiuZ6E/fh/+Y9C+3DG2c5oXWG/4ZNwd1w=
github.com/aws-controllers-k8s/mq-controller v0.0.22/go.mod h1:p+YVFjpwlgRC+1cPeCabk1xTB1hTCU+RwYtFzrTnJmE=
github.com/aws-controllers-k8s/runtime v0.20.0/go.mod h1:oA8ML1/LL3chPn26P6SzBNu1CUI2nekB+PTqykNs0qU=
github.com/aws-controllers-k8s/runtime v0.20.1 h1:L/Huf1shRahx5BqJBCSS5u+vYg3f0Rotsq1jutORpdI=
github.com/aws-controllers-k8s/runtime v0.20.1/go.mod h1:k7z4qlf6aK1Kzd4ff49wzcyhDKHjWaUpqxrwgl4uS1o=
Expand Down
16 changes: 16 additions & 0 deletions helm/crds/lambda.services.k8s.aws_eventsourcemappings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,22 @@ spec:
each shard concurrently.
format: int64
type: integer
queueRefs:
items:
description: 'AWSResourceReferenceWrapper provides a wrapper around
*AWSResourceReference type to provide more user friendly syntax
for references using ''from'' field Ex: APIIDRef: from: name:
my-api'
properties:
from:
description: AWSResourceReference provides all the values necessary
to reference another k8s resource for finding the identifier(Id/ARN/Name)
properties:
name:
type: string
type: object
type: object
type: array
queues:
description: (MQ) The name of the Amazon MQ broker destination queue
to consume.
Expand Down
22 changes: 22 additions & 0 deletions helm/templates/cluster-role-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,19 @@ kind: ClusterRole
metadata:
creationTimestamp: null
name: ack-lambda-controller
labels:
{{- range $key, $value := .Values.role.labels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{ else }}
kind: Role
metadata:
creationTimestamp: null
name: ack-lambda-controller
labels:
{{- range $key, $value := .Values.role.labels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
namespace: {{ .Release.Namespace }}
{{ end }}
rules:
Expand Down Expand Up @@ -180,6 +188,20 @@ rules:
- get
- patch
- update
- apiGroups:
- mq.services.k8s.aws
resources:
- brokers
verbs:
- get
- list
- apiGroups:
- mq.services.k8s.aws
resources:
- brokers/status
verbs:
- get
- list
- apiGroups:
- s3.services.k8s.aws
resources:
Expand Down
8 changes: 8 additions & 0 deletions helm/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@
],
"type": "object"
},
"role": {
"description": "Role settings",
"properties": {
"labels": {
"type": "object"
}
}
},
"metrics": {
"description": "Metrics settings",
"properties": {
Expand Down
4 changes: 4 additions & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ deployment:
# Which priorityClassName to set?
# See: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#pod-priority
priorityClassName: ""

# If "installScope: cluster" then these labels will be applied to ClusterRole
role:
labels: {}

metrics:
service:
Expand Down
3 changes: 3 additions & 0 deletions pkg/resource/event_source_mapping/delta.go

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

73 changes: 72 additions & 1 deletion pkg/resource/event_source_mapping/references.go

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

1 change: 0 additions & 1 deletion pkg/resource/function/references.go

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