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

7.4.5 过滤调谐事件Owns-Service部分代码写错了吧,UpdateFunc部分应该是Service对象,不是Application吧 #8

Open
tanlay opened this issue Feb 3, 2023 · 1 comment

Comments

@tanlay
Copy link

tanlay commented Feb 3, 2023

UpdateFunc部分应该是Service对象,不是Application吧

Owns(&corev1.Service{}, builder.WithPredicates(predicate.Funcs{
			...
			UpdateFunc: func(event event.UpdateEvent) bool {
				if event.ObjectNew.GetResourceVersion() == event.ObjectOld.GetResourceVersion() {
					return false
				}
				if reflect.DeepEqual(event.ObjectNew.(*v1.Application).Spec, event.ObjectOld.(*v1.Application).Spec) {
					return false
				}
				return true
			},
		})).
Owns(&corev1.Service{}, builder.WithPredicates(predicate.Funcs{
			...
			UpdateFunc: func(event event.UpdateEvent) bool {
				if event.ObjectNew.GetResourceVersion() == event.ObjectOld.GetResourceVersion() {
					return false
				}
				if reflect.DeepEqual(event.ObjectNew.(*corev1.Service).Spec, event.ObjectOld.(*corev1.Service).Spec) {
					return false
				}
				return true
			},
		})).
@guligulu
Copy link

我也觉得是,按照你这个修改了就不报错了!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants