File tree 4 files changed +23
-3
lines changed
4 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -107,11 +107,20 @@ func main() {
107
107
for _, namespace := range namespaces {
108
108
watchNamespaces[namespace] = ctrlrtcache.Config{}
109
109
}
110
+ watchSelectors, err := ackCfg.ParseWatchSelectors()
111
+ if err != nil {
112
+ setupLog.Error(
113
+ err, " Unable to parse watch selectors." ,
114
+ " aws.service" , awsServiceAlias,
115
+ )
116
+ os.Exit(1)
117
+ }
110
118
mgr, err := ctrlrt.NewManager(ctrlrt.GetConfigOrDie(), ctrlrt.Options{
111
119
Scheme: scheme,
112
120
Cache: ctrlrtcache.Options{
113
- Scheme: scheme,
114
- DefaultNamespaces: watchNamespaces,
121
+ Scheme: scheme,
122
+ DefaultNamespaces: watchNamespaces,
123
+ DefaultLabelSelector: watchSelectors,
115
124
} ,
116
125
WebhookServer: &ctrlrtwebhook.DefaultServer{
117
126
Options: ctrlrtwebhook.Options{
Original file line number Diff line number Diff line change 57
57
- "$(ACK_RESOURCE_TAGS)"
58
58
- --watch-namespace
59
59
- "$(ACK_WATCH_NAMESPACE)"
60
+ - --watch-selectors
61
+ - "$(ACK_WATCH_SELECTORS)"
60
62
- --deletion-policy
61
63
- "$(DELETION_POLICY)"
62
64
{ { " {{- if .Values.leaderElection.enabled }}" } }
@@ -103,6 +105,8 @@ spec:
103
105
value: { { " {{ .Values.aws.endpoint_url | quote }}" } }
104
106
- name: ACK_WATCH_NAMESPACE
105
107
value: { { IncludeTemplate " watch-namespace" } }
108
+ - name: ACK_WATCH_SELECTORS
109
+ value: { { " {{ .Values.watchSelectors }}" } }
106
110
- name: DELETION_POLICY
107
111
value: { { " {{ .Values.deletionPolicy }}" } }
108
112
- name: LEADER_ELECTION_NAMESPACE
Original file line number Diff line number Diff line change 210
210
},
211
211
"watchNamespace" : {
212
212
"type" : " string"
213
- },
213
+ },
214
+ "watchSelectors" : {
215
+ "type" : " string"
216
+ },
214
217
"resourceTags" : {
215
218
"type" : " array" ,
216
219
"items" : {
Original file line number Diff line number Diff line change @@ -110,6 +110,10 @@ installScope: cluster
110
110
# You can set multiple namespaces by providing a comma separated list of namespaces. e.g "namespace1,namespace2"
111
111
watchNamespace: ""
112
112
113
+ # Set the value of labelsSelectors to be used by the controller to filter the resources to watch.
114
+ # You can set multiple labelsSelectors by providing a comma separated list of a=b arguments. e.g "label1=value1,label2=value2"
115
+ watchSelectors: ""
116
+
113
117
resourceTags:
114
118
# Configures the ACK service controller to always set key/value pairs tags on
115
119
# resources that it manages.
You can’t perform that action at this time.
0 commit comments