Skip to content

Commit 1107caa

Browse files
committed
fix: add policies on create
1 parent 7cc7071 commit 1107caa

File tree

6 files changed

+51
-4
lines changed

6 files changed

+51
-4
lines changed

apis/v1alpha1/ack-generate-metadata.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
ack_generate_info:
2-
build_date: "2025-05-02T16:46:04Z"
3-
build_hash: f8dc5330705b3752ce07dce0ac831161fd4cb14f
4-
go_version: go1.24.2
5-
version: v0.45.0
2+
build_date: "2025-05-08T19:50:19Z"
3+
build_hash: a82538df1333319f8ec1d603f6cf293aefc46e1b
4+
go_version: go1.24.1
5+
version: v0.45.0-3-ga82538d
66
api_directory_checksum: 7e1c19231d3275a1147157f6943a7391953f7001
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.32.6

helm/templates/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ spec:
5959
- "$(ACK_WATCH_NAMESPACE)"
6060
- --watch-selectors
6161
- "$(ACK_WATCH_SELECTORS)"
62+
- --reconcile-resources
63+
- "$(RECONCILE_RESOURCES)"
6264
- --deletion-policy
6365
- "$(DELETION_POLICY)"
6466
{{- if .Values.leaderElection.enabled }}
@@ -107,6 +109,8 @@ spec:
107109
value: {{ include "ack-iam-controller.watch-namespace" . }}
108110
- name: ACK_WATCH_SELECTORS
109111
value: {{ .Values.watchSelectors }}
112+
- name: RECONCILE_RESOURCES
113+
value: {{ join "," .Values.reconcile.resources | quote }}
110114
- name: DELETION_POLICY
111115
value: {{ .Values.deletionPolicy }}
112116
- name: LEADER_ELECTION_NAMESPACE

helm/values.schema.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,14 @@
239239
},
240240
"resourceMaxConcurrentSyncs": {
241241
"type": "object"
242+
},
243+
"resources": {
244+
"type": "array",
245+
"items": {
246+
"type": "string"
247+
},
248+
"description": "List of resource kinds to reconcile. If empty, all resources will be reconciled.",
249+
"default": []
242250
}
243251
},
244252
"type": "object"

helm/values.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,17 @@ reconcile:
137137
# An object representing the reconcile max concurrent syncs configuration for each specific
138138
# resource.
139139
resourceMaxConcurrentSyncs: {}
140+
141+
# Set the value of resources to specify which resource kinds to reconcile.
142+
# If empty, all resources will be reconciled.
143+
# If specified, only the listed resource kinds will be reconciled.
144+
resources:
145+
- Groups
146+
- Instanceprofiles
147+
- Openidconnectproviders
148+
- Policies
149+
- Roles
150+
- Users
140151

141152
serviceAccount:
142153
# Specifies whether a service account should be created

pkg/resource/role/sdk.go

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

templates/hooks/role/sdk_create_post_set_output.go.tpl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,16 @@
55
ko.Spec.AssumeRolePolicyDocument = &doc
66
}
77
}
8+
for _, p := range desired.ko.Spec.Policies {
9+
err := rm.addManagedPolicy(ctx, &resource{ko}, p)
10+
if err != nil {
11+
return &resource{ko}, err
12+
}
13+
}
14+
for n, p := range desired.ko.Spec.InlinePolicies {
15+
err := rm.addInlinePolicy(ctx, &resource{ko}, n, p)
16+
if err != nil {
17+
return &resource{ko}, err
18+
}
19+
}
820
ackcondition.SetSynced(&resource{ko}, corev1.ConditionFalse, nil, nil)

0 commit comments

Comments
 (0)