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

Add AddLabel()/AddAnnotation() for Route #447

Merged

Conversation

elvgarrui
Copy link
Contributor

I think this might need testing, but looking at similar PR (#418) I did not fully understand how I should create something similar to what we see there in "modules/common/service/service_test.go" for the Route struct.

Copy link
Contributor

@stuggi stuggi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, this needs tests as in https://github.com/openstack-k8s-operators/lib-common/blob/main/modules/common/service/service_test.go#L479 . specify a default Route starting with no annotation, then:

  • add a annotation
  • add another annotation should have 2
  • override an annotation (first one remains)

you could just make a copy of service.TestOverrideSpecAddAnnotation and change it for the Route use case.

@elvgarrui elvgarrui force-pushed the add_annotations_route branch from 281df61 to 2c3756f Compare February 12, 2024 09:26
Signed-off-by: Elvira García <egarciar@redhat.com>
@elvgarrui elvgarrui force-pushed the add_annotations_route branch from 2c3756f to 0a18b4f Compare February 16, 2024 10:28
},
}

for _, tt := range tests {
Copy link
Contributor Author

@elvgarrui elvgarrui Feb 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest I'm aware this for on L71 might not needed yet, because I just described one route. However I thought I could leave this like that since we could expect this test to be expanded in a near future.

Copy link
Contributor

@stuggi stuggi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm thanks!

@stuggi stuggi merged commit 1c6e452 into openstack-k8s-operators:main Feb 19, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants