Skip to content
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

📝 Update example with realistic annotation using the '.' character. #48

Merged
merged 1 commit into from
Nov 16, 2024
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
2 changes: 1 addition & 1 deletion examples/aws-auth/input/configmaps/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: aws-auth-base
namespace: kube-system
annotations:
aggregate: aws-auth
aggregate.auth.annotation: aws-auth
data:
mapRoles: |
- rolearn: arn:aws:iam::111122223333:role/admin-role
Expand Down
2 changes: 1 addition & 1 deletion examples/aws-auth/input/configmaps/tenant-acme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: aws-auth-tenant-acme
namespace: kube-system
annotations:
aggregate: aws-auth
aggregate.auth.annotation: aws-auth
data:
mapRoles: |
- rolearn: arn:aws:iam::111122223333:role/tenant-acme-role
Expand Down
2 changes: 1 addition & 1 deletion examples/aws-auth/input/configmaps/tenant-umbrella.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: aws-auth-tenant-umbrella
namespace: kube-system
annotations:
aggregate: aws-auth
aggregate.auth.annotation: aws-auth
data:
mapRoles: |
- rolearn: arn:aws:iam::111122223333:role/tenant-umbrella-role
Expand Down
2 changes: 1 addition & 1 deletion examples/aws-auth/input/templates/aws-auth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
SELECT cm.data AS cm
FROM "ConfigMap.core" AS cm
WHERE cm.namespace = 'kube-system' AND
json_extract(cm.data, '$.metadata.annotations.aggregate') = 'aws-auth'
json_extract(cm.data, '$.metadata.annotations."aggregate.auth.annotation"') = 'aws-auth'
template:
language: cue
batchModeProcessing: true
Expand Down
6 changes: 3 additions & 3 deletions examples/aws-auth/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ input `ConfigMap` instances, so each piece of Terraform code can own its own
resource. Kumquat is the only thing that owns `aws-auth`.

The following template does just that. It also check for the presence of the
`aggregate` annotation on the inputs, and ensures the value is `aws-auth`.
This ensure that the template only merges `ConfigMap` instances that belong
`aggregate.auth.annotation` annotation on the inputs, and ensures the value is `aws-auth`.
This ensures that the template only merges `ConfigMap` instances that belong
in `aws-auth`. The choice of aggregation name and value was arbitrary.

```yaml
Expand All @@ -69,7 +69,7 @@ spec:
SELECT cm.data AS cm
FROM "ConfigMap.core" AS cm
WHERE cm.namespace = 'kube-system' AND
json_extract(cm.data, '$.metadata.annotations.aggregate') = 'aws-auth'
json_extract(cm.data, '$.metadata.annotations."aggregate.auth.annotation"') = 'aws-auth'
template:
language: cue
batchModeProcessing: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: aws-auth-base
namespace: kube-system
annotations:
aggregate: aws-auth
aggregate.auth.annotation: aws-auth
data:
mapRoles: |
- rolearn: arn:aws:iam::111122223333:role/admin-role
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: aws-auth-tenant-acme
namespace: kube-system
annotations:
aggregate: aws-auth
aggregate.auth.annotation: aws-auth
data:
mapRoles: |
- rolearn: arn:aws:iam::111122223333:role/tenant-acme-role
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: aws-auth-tenant-umbrella
namespace: kube-system
annotations:
aggregate: aws-auth
aggregate.auth.annotation: aws-auth
data:
mapRoles: |
- rolearn: arn:aws:iam::111122223333:role/tenant-umbrella-role
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
SELECT cm.data AS cm
FROM "ConfigMap.core" AS cm
WHERE cm.namespace = 'kube-system' AND
json_extract(cm.data, '$.metadata.annotations.aggregate') = 'aws-auth'
json_extract(cm.data, '$.metadata.annotations."aggregate.auth.annotation"') = 'aws-auth'
template:
language: cue
batchModeProcessing: false
Expand Down