filter wach && list action

Signed-off-by: runzexia <runzexia@yunify.com>
This commit is contained in:
runzexia
2020-03-19 14:49:47 +08:00
parent 5dffb7305f
commit 7ffee72b1f
5 changed files with 11 additions and 15 deletions

View File

@@ -25,7 +25,7 @@ import (
)
/**
DevOps project controller is used to maintain the state of the DevOps project.
DevOps project controller is used to maintain the state of the DevOps project.
*/
type Controller struct {

View File

@@ -182,10 +182,8 @@ func filterInformerActions(actions []core.Action) []core.Action {
ret := []core.Action{}
for _, action := range actions {
if len(action.GetNamespace()) == 0 &&
(action.Matches("list", "foos") ||
action.Matches("watch", "foos") ||
action.Matches("list", "deployments") ||
action.Matches("watch", "deployments")) {
(action.Matches("list", devopsprojects.ResourcePluralDevOpsProject) ||
action.Matches("watch", devopsprojects.ResourcePluralDevOpsProject)) {
continue
}
ret = append(ret, action)

View File

@@ -184,10 +184,8 @@ func filterInformerActions(actions []core.Action) []core.Action {
ret := []core.Action{}
for _, action := range actions {
if len(action.GetNamespace()) == 0 &&
(action.Matches("list", "foos") ||
action.Matches("watch", "foos") ||
action.Matches("list", "deployments") ||
action.Matches("watch", "deployments")) {
(action.Matches("list", s2i.ResourcePluralS2iBinary) ||
action.Matches("watch", s2i.ResourcePluralS2iBinary)) {
continue
}
ret = append(ret, action)

View File

@@ -25,8 +25,8 @@ import (
)
/**
s2irun-controller used to handle s2irun's delete logic.
s2irun creation and operation provided by s2ioperator
s2irun-controller used to handle s2irun's delete logic.
s2irun creation and operation provided by s2ioperator
*/
type Controller struct {
client clientset.Interface

View File

@@ -226,10 +226,10 @@ func filterInformerActions(actions []core.Action) []core.Action {
ret := []core.Action{}
for _, action := range actions {
if len(action.GetNamespace()) == 0 &&
(action.Matches("list", "foos") ||
action.Matches("watch", "foos") ||
action.Matches("list", "deployments") ||
action.Matches("watch", "deployments")) {
(action.Matches("list", s2i.ResourcePluralS2iRun) ||
action.Matches("watch", s2i.ResourcePluralS2iRun) ||
action.Matches("list", s2i.ResourcePluralS2iBinary) ||
action.Matches("watch", s2i.ResourcePluralS2iBinary)) {
continue
}
ret = append(ret, action)