-
Notifications
You must be signed in to change notification settings - Fork 344
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
feat: added annotations support for route trait #4662
Conversation
🐫 Thank you for contributing! Code Coverage Report ✔️ - Coverage unchanged. |
1 similar comment
🐫 Thank you for contributing! Code Coverage Report ✔️ - Coverage unchanged. |
func TestRouteAnnotation(t *testing.T) { | ||
annotationsTest := map[string]string{"haproxy.router.openshift.io/balance": "true"} | ||
name := xid.New().String() | ||
environment := createTestRouteEnvironment(t, name) |
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.
You're missing to set the trait here. It has to be something like
environment.Integration.Spec.Traits = v1.Traits{
Route: &traitv1.RouteTrait{
Annotations...,
},
}
This would simulate the execution of the trait on the operator side. Once that is applied, then, you need to verify that a Route object was created. And on this object we need to check it contains the expected annotations.
pkg/trait/route_test.go
Outdated
|
||
} | ||
|
||
func createTestRoute(e *Environment) *routev1.Route { |
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.
This one is probably not needed. It's the logic of the operator that has to create a Route object as explained in the previous comment.
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.
Yes I agree, this one is not necessary.
🐫 Thank you for contributing! Code Coverage Report ✔️ - Coverage unchanged. |
CLI parameter usage example for clarity:
-t "haproxy.router.openshift.io/balance'=true"
Release Note