-
Notifications
You must be signed in to change notification settings - Fork 15
option to ignore cluster-scoped resources #141
Conversation
When running an namespace-scoped instance of Faros in a shared cluster, listing and modifying cluster-scoped resources may not be allowed. As Faros begins by listing cluster-scoped resources, this prevents Faros from operating entirely. This changelist adds a new flag to the controller `--namespaced-only` which modifies the behavior of Faros: 1. Faros no longer lists ClusterGitTrackObjects at controller startup. Any previously created ClusterGitTrackObjects are abandoned and must be cleaned up by the operator. 2. Faros no longer manages any cluster-scoped resources it finds in a Git repository, instead adding them to the ignored objects list. Fixes: pusher#138
Hi @terinjokes. Thanks for your PR. I'm waiting for a pusher member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I'm having some difficulties adding tests to the controller suite due to the global nature of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the lack of tests, I think this is good! I will have a look at how we can reasonably add tests and get back to you
@@ -492,6 +497,11 @@ func (r *ReconcileGitTrack) ignoreObject(u *unstructured.Unstructured) (bool, st | |||
return false, "", err | |||
} | |||
|
|||
// Ignore namespaced objects in namespaced-only mode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this comment is not quite right?
// Ignore namespaced objects in namespaced-only mode | |
// Ignore non-namespaced objects in namespaced-only mode |
I've added a couple of tests as a start to a branch, might be worth cherry-picking those commits and adding some more tests, WDYT? |
/ok-to-test |
@terinjokes: The following test failed, say
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
@terinjokes: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
When running an namespace-scoped instance of Faros in a shared cluster,
listing and modifying cluster-scoped resources may not be allowed. As
Faros begins by listing cluster-scoped resources, this prevents Faros
from operating entirely.
This changelist adds a new flag to the controller
--namespaced-only
which modifies the behavior of Faros:
Any previously created ClusterGitTrackObjects are abandoned and must
be cleaned up by the operator.
a Git repository, instead adding them to the ignored objects list.
Fixes: #138