Skip to content
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

Scaffold code in cmd/manager/main.go for Go operators and add logic to Ansible/Helm operators to handle [multinamespace caching] #2522

Merged
merged 5 commits into from
Feb 18, 2020

Conversation

camilamacedo86
Copy link
Contributor

@camilamacedo86 camilamacedo86 commented Feb 9, 2020

Description of the change:

Motivation for the change:

Closes #2361

@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 9, 2020
Copy link
Member

@estroz estroz left a comment

Choose a reason for hiding this comment

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

Overall a nice feature for users, needs work though.

@joelanford @fabianvf anything else we need to do for Helm/Ansible multinamespacing?

CHANGELOG.md Outdated Show resolved Hide resolved
internal/scaffold/cmd.go Outdated Show resolved Hide resolved
internal/scaffold/cmd.go Outdated Show resolved Hide resolved
internal/scaffold/cmd.go Outdated Show resolved Hide resolved
internal/scaffold/cmd.go Outdated Show resolved Hide resolved
internal/scaffold/cmd.go Outdated Show resolved Hide resolved
internal/scaffold/cmd.go Show resolved Hide resolved
pkg/ansible/run.go Show resolved Hide resolved
pkg/ansible/run.go Outdated Show resolved Hide resolved
pkg/ansible/run.go Outdated Show resolved Hide resolved
pkg/ansible/run.go Outdated Show resolved Hide resolved
@openshift-ci-robot openshift-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 10, 2020
@@ -6,6 +6,7 @@
- Added `pkg/status` with several new types and interfaces that can be used in `Status` structs to simplify handling of [status conditions](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties). ([#1143](https://github.com/operator-framework/operator-sdk/pull/1143))
- Added support for relative Ansible roles and playbooks paths in the Ansible operator's file. ([#2273](https://github.com/operator-framework/operator-sdk/pull/2273))
- Add Prometheus metrics support to Ansible-based operators. ([#2179](https://github.com/operator-framework/operator-sdk/pull/2179))
- Scaffold code in `cmd/manager/main.go` for Go operators and add logic to Ansible/Helm operators to handle [multinamespace caching](https://godoc.org/github.com/kubernetes-sigs/controller-runtime/pkg/cache#MultiNamespacedCacheBuilder) if `WATCH_NAMESPACE` contains multiple namespaces. ([#2522](https://github.com/operator-framework/operator-sdk/pull/2522))

Copy link
Contributor Author

@camilamacedo86 camilamacedo86 Feb 10, 2020

Choose a reason for hiding this comment

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

Hi @dmesser have you any objection to solve the scenario with?
It is also related to the option targetNamespaces that allows MultiNamespace via the OperatorGroup.

Example:

targetNamespaces:
- ns1
- ns2

The scenario is described in #2361
Also, please see that it address common scenarios such as: #2494
c/c @joelanford

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 13, 2020
@camilamacedo86 camilamacedo86 changed the title add native support to mutinamespaces Scaffold code in cmd/manager/main.go for Go operators and add logic to Ansible/Helm operators to handle [multinamespace caching] Feb 13, 2020
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 14, 2020
@asmacdo asmacdo removed their request for review February 17, 2020 17:45
Copy link
Member

@estroz estroz left a comment

Choose a reason for hiding this comment

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

/lgtm

Would like one more set of eyes on this first @hasbro17 @jmccormick2001.

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 17, 2020
options.NewCache = cache.MultiNamespacedCacheBuilder(strings.Split(namespace, ","))
}

// Create a new Cmd to provide shared dependencies and start components
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Create a new Cmd to provide shared dependencies and start components
// Create a new manager to provide shared dependencies and start components

Whats Cmd?

Copy link
Contributor

@hasbro17 hasbro17 left a comment

Choose a reason for hiding this comment

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

LGTM with a minor typo in the scaffold comments.

options.NewCache = cache.MultiNamespacedCacheBuilder(strings.Split(namespace, ","))
}

// Create a new Cmd to provide shared dependencies and start components
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Create a new Cmd to provide shared dependencies and start components
// Create a new manager to provide shared dependencies and start components

options.Namespace = metav1.NamespaceAll
}

// Create a new Cmd to provide shared dependencies and start components
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Create a new Cmd to provide shared dependencies and start components
// Create a new manager to provide shared dependencies and start components

@openshift-ci-robot
Copy link

New changes are detected. LGTM label has been removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Multinamespace mode in Ansible operator
6 participants