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

refactor status conditions logic for Gateway API resources #860

Closed
arkodg opened this issue Jan 4, 2023 · 4 comments · Fixed by #2951
Closed

refactor status conditions logic for Gateway API resources #860

arkodg opened this issue Jan 4, 2023 · 4 comments · Fixed by #2951

Comments

@arkodg
Copy link
Contributor

arkodg commented Jan 4, 2023

Description:
The GatewayClass and Gateway logic for computing status conditions lives here
https://github.com/envoyproxy/gateway/blob/main/internal/status/conditions.go

and the logic for Routes lives here

func (l *ListenerContext) SetCondition(conditionType v1beta1.ListenerConditionType, status metav1.ConditionStatus, reason v1beta1.ListenerConditionReason, message string) {

These should be consolidated to one place for improving code reuse

@arkodg arkodg added good first issue Good for newcomers help wanted Extra attention is needed labels Jan 4, 2023
@Pawan-Bishnoi
Copy link

Pawan-Bishnoi commented Jan 21, 2023

Hi @arkodg
I would like to work on this.
Seems like we would be able to remove duplicate code by changing SetCondition to something like this:

func (l *ListenerContext) SetCondition(conditionType v1beta1.ListenerConditionType, status metav1.ConditionStatus, reason v1beta1.ListenerConditionReason, message string) {
	cond := statusPkg.NewCondition(...)

        l.gateway.Status.Listeners[l.listenerStatusIdx].Conditions = statusPkg.MergeConditions(l.gateway.Status.Listeners[l.listenerStatusIdx].Conditions, cond)
}

Does that sound ok? Any other ideas?

@Pawan-Bishnoi
Copy link

actually that would cause an import cycle. Let me think about this a bit more tomorrow.

@shawnh2
Copy link
Contributor

shawnh2 commented Mar 12, 2024

assign myself of this one since i've been working with #2631

Copy link

This issue has been automatically marked as stale because it has not had activity in the last 30 days.

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

Successfully merging a pull request may close this issue.

3 participants