Skip to content

Add cli flag to supply namespace for capa controller to watch for capi objects#607

Merged
k8s-ci-robot merged 3 commits intokubernetes-sigs:masterfrom
ashish-amarnath:reconcile-single-ns
Feb 26, 2019
Merged

Add cli flag to supply namespace for capa controller to watch for capi objects#607
k8s-ci-robot merged 3 commits intokubernetes-sigs:masterfrom
ashish-amarnath:reconcile-single-ns

Conversation

@ashish-amarnath
Copy link
Copy Markdown
Contributor

@ashish-amarnath ashish-amarnath commented Feb 25, 2019

Add cli flag to supply namespace for capa controller to watch for capi objects

What this PR does / why we need it:
This PR adds a CLI flag to restrict the namespace that capa controllers watch for capi objects to reconcile

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #581

Special notes for your reviewer:

Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

Release note:


@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 25, 2019
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 25, 2019
@ashish-amarnath ashish-amarnath changed the title [WIP] Add cli flag to supply namespace for capa controller to watch for cap… [WIP] Add cli flag to supply namespace for capa controller to watch for capi objects Feb 25, 2019
Comment thread cmd/manager/main.go Outdated
Comment thread cmd/manager/main.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we define this outside the main function instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If we had more cli flags, it would make sense to create a CliFlags struct and parse the flags in a separate function that would return the CliFlags struct. Considering we have just one flag other than the logtostderr this should be good.

Comment thread cmd/manager/main.go Outdated
Comment thread cmd/manager/main.go Outdated
Comment thread cmd/manager/main.go Outdated
@ashish-amarnath ashish-amarnath changed the title [WIP] Add cli flag to supply namespace for capa controller to watch for capi objects Add cli flag to supply namespace for capa controller to watch for capi objects Feb 26, 2019
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 26, 2019
Comment thread cmd/manager/main.go Outdated
@detiber
Copy link
Copy Markdown
Contributor

detiber commented Feb 26, 2019

/approve

leaving lgtm to @vincepri

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ashish-amarnath, detiber

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 26, 2019
Copy link
Copy Markdown
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 26, 2019
@k8s-ci-robot k8s-ci-robot merged commit 60789ed into kubernetes-sigs:master Feb 26, 2019
@ashish-amarnath ashish-amarnath deleted the reconcile-single-ns branch February 26, 2019 22:16
ashish-amarnath added a commit to ashish-amarnath/cluster-api-provider-aws that referenced this pull request Feb 27, 2019
k8s-ci-robot pushed a commit that referenced this pull request Feb 27, 2019
* document the 'namespace' cli flag to capa controller

#607

* fixes

* Update docs/reconcile-in-custom-namespace.md

Co-Authored-By: ashish-amarnath <ashish.amarnath@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optional ability to restrict to a single namespace

4 participants