Skip to content

Set cluster namespace #266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Nov 11, 2021
Merged

Set cluster namespace #266

merged 10 commits into from
Nov 11, 2021

Conversation

yiannistri
Copy link
Collaborator

@yiannistri yiannistri commented Nov 4, 2021

Set the namespace for all CAPI objects

Fixes #42

@yiannistri yiannistri added the enhancement New feature or request label Nov 4, 2021
@yiannistri yiannistri force-pushed the set-cluster-ns branch 3 times, most recently from 9bbf071 to edadc78 Compare November 4, 2021 17:32
@yiannistri yiannistri force-pushed the set-cluster-ns branch 2 times, most recently from 3eec906 to 46a9f3c Compare November 5, 2021 07:46
@yiannistri yiannistri self-assigned this Nov 5, 2021
@yiannistri yiannistri requested a review from bigkevmcd November 8, 2021 13:13
@yiannistri yiannistri marked this pull request as ready for review November 8, 2021 13:13
if os.Getenv("INJECT_PRUNE_ANNOTATION") != "disabled" {
opts = []capi.RenderOptFunc{capi.InjectPruneAnnotation()}
}
opts = append(opts, capi.InNamespace(os.Getenv("CAPI_CLUSTERS_NAMESPACE")))
Copy link
Contributor

Choose a reason for hiding this comment

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

You could do something like this:

opts := []capi.RenderOptFunc{
  capi.InNamespace(os.Getenv("CAPI_CLUSTERS_NAMESPACE"),
}
if os.Getenv("INJECT_PRUNE_ANNOTATION") != "disabled" {
    append(opts, capi.InjectPruneAnnotation())
}

But, I'd probably also make capi.InjectPruneAnnotation just be a func, rather than a func that returned a func.

Copy link
Collaborator

@foot foot left a comment

Choose a reason for hiding this comment

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

👌

@foot foot merged commit ed8f1ba into main Nov 11, 2021
@foot foot deleted the set-cluster-ns branch November 11, 2021 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When configuring the MCCP, specify a namespace that all CAPIClusters are created into.
3 participants