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

feat: added annotations support for route trait #4662

Closed
wants to merge 6 commits into from

Conversation

realMartinez
Copy link
Contributor

@realMartinez realMartinez commented Aug 10, 2023

  • Added route annotations implementation
  • Added unit tests
  • Added documentation

CLI parameter usage example for clarity:
-t "haproxy.router.openshift.io/balance'=true"

Release Note

feat: added annotations support for route trait

@github-actions
Copy link
Contributor

🐫 Thank you for contributing!

Code Coverage Report ✔️ - Coverage unchanged.

1 similar comment
@github-actions
Copy link
Contributor

🐫 Thank you for contributing!

Code Coverage Report ✔️ - Coverage unchanged.

@squakez squakez changed the title Chore: Added annotations support for route trait feat: added annotations support for route trait Aug 10, 2023
@squakez squakez added the kind/feature New feature or request label Aug 10, 2023
func TestRouteAnnotation(t *testing.T) {
annotationsTest := map[string]string{"haproxy.router.openshift.io/balance": "true"}
name := xid.New().String()
environment := createTestRouteEnvironment(t, name)
Copy link
Contributor

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.


}

func createTestRoute(e *Environment) *routev1.Route {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@realMartinez realMartinez deleted the feat/cmlk-865 branch August 10, 2023 12:45
@github-actions
Copy link
Contributor

🐫 Thank you for contributing!

Code Coverage Report ✔️ - Coverage unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants