Skip to content
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
13 changes: 11 additions & 2 deletions templates/cmd/controller/main.go.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,20 @@ func main() {
for _, namespace := range namespaces {
watchNamespaces[namespace] = ctrlrtcache.Config{}
}
watchSelectors, err := ackCfg.ParseWatchSelectors()
if err != nil {
setupLog.Error(
err, "Unable to parse watch selectors.",
"aws.service", awsServiceAlias,
)
os.Exit(1)
}
mgr, err := ctrlrt.NewManager(ctrlrt.GetConfigOrDie(), ctrlrt.Options{
Scheme: scheme,
Cache: ctrlrtcache.Options{
Scheme: scheme,
DefaultNamespaces: watchNamespaces,
Scheme: scheme,
DefaultNamespaces: watchNamespaces,
DefaultLabelSelector: watchSelectors,
},
WebhookServer: &ctrlrtwebhook.DefaultServer{
Options: ctrlrtwebhook.Options{
Expand Down
4 changes: 4 additions & 0 deletions templates/helm/templates/deployment.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ spec:
- "$(ACK_RESOURCE_TAGS)"
- --watch-namespace
- "$(ACK_WATCH_NAMESPACE)"
- --watch-selectors
- "$(ACK_WATCH_SELECTORS)"
- --deletion-policy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

- "$(DELETION_POLICY)"
{{ "{{- if .Values.leaderElection.enabled }}" }}
Expand Down Expand Up @@ -103,6 +105,8 @@ spec:
value: {{ "{{ .Values.aws.endpoint_url | quote }}" }}
- name: ACK_WATCH_NAMESPACE
value: {{ IncludeTemplate "watch-namespace" }}
- name: ACK_WATCH_SELECTORS
value: {{ "{{ .Values.watchSelectors }}" }}
- name: DELETION_POLICY
value: {{ "{{ .Values.deletionPolicy }}" }}
- name: LEADER_ELECTION_NAMESPACE
Expand Down
5 changes: 4 additions & 1 deletion templates/helm/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,10 @@
},
"watchNamespace": {
"type": "string"
},
},
"watchSelectors": {
"type": "string"
},
"resourceTags": {
"type": "array",
"items": {
Expand Down
4 changes: 4 additions & 0 deletions templates/helm/values.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ installScope: cluster
# You can set multiple namespaces by providing a comma separated list of namespaces. e.g "namespace1,namespace2"
watchNamespace: ""

# Set the value of labelsSelectors to be used by the controller to filter the resources to watch.
# You can set multiple labelsSelectors by providing a comma separated list of a=b arguments. e.g "label1=value1,label2=value2"
watchSelectors: ""

resourceTags:
# Configures the ACK service controller to always set key/value pairs tags on
# resources that it manages.
Expand Down