File tree Expand file tree Collapse file tree 4 files changed +23
-3
lines changed Expand file tree Collapse file tree 4 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -107,11 +107,20 @@ func main() {
107107 for _, namespace := range namespaces {
108108 watchNamespaces[namespace] = ctrlrtcache.Config{}
109109 }
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+ }
110118 mgr, err := ctrlrt.NewManager(ctrlrt.GetConfigOrDie(), ctrlrt.Options{
111119 Scheme: scheme,
112120 Cache: ctrlrtcache.Options{
113- Scheme: scheme,
114- DefaultNamespaces: watchNamespaces,
121+ Scheme: scheme,
122+ DefaultNamespaces: watchNamespaces,
123+ DefaultLabelSelector: watchSelectors,
115124 } ,
116125 WebhookServer: &ctrlrtwebhook.DefaultServer{
117126 Options: ctrlrtwebhook.Options{
Original file line number Diff line number Diff line change 5757 - "$(ACK_RESOURCE_TAGS)"
5858 - --watch-namespace
5959 - "$(ACK_WATCH_NAMESPACE)"
60+ - --watch-selectors
61+ - "$(ACK_WATCH_SELECTORS)"
6062 - --deletion-policy
6163 - "$(DELETION_POLICY)"
6264{ { " {{- if .Values.leaderElection.enabled }}" } }
@@ -103,6 +105,8 @@ spec:
103105 value: { { " {{ .Values.aws.endpoint_url | quote }}" } }
104106 - name: ACK_WATCH_NAMESPACE
105107 value: { { IncludeTemplate " watch-namespace" } }
108+ - name: ACK_WATCH_SELECTORS
109+ value: { { " {{ .Values.watchSelectors }}" } }
106110 - name: DELETION_POLICY
107111 value: { { " {{ .Values.deletionPolicy }}" } }
108112 - name: LEADER_ELECTION_NAMESPACE
Original file line number Diff line number Diff line change 210210 },
211211 "watchNamespace" : {
212212 "type" : " string"
213- },
213+ },
214+ "watchSelectors" : {
215+ "type" : " string"
216+ },
214217 "resourceTags" : {
215218 "type" : " array" ,
216219 "items" : {
Original file line number Diff line number Diff line change @@ -110,6 +110,10 @@ installScope: cluster
110110# You can set multiple namespaces by providing a comma separated list of namespaces. e.g "namespace1,namespace2"
111111watchNamespace: ""
112112
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+
113117resourceTags:
114118 # Configures the ACK service controller to always set key/value pairs tags on
115119 # resources that it manages.
You can’t perform that action at this time.
0 commit comments