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

[RFR] Add support for apiPaths #869

Merged
merged 1 commit into from
Oct 11, 2023
Merged

[RFR] Add support for apiPaths #869

merged 1 commit into from
Oct 11, 2023

Conversation

bsquizz
Copy link
Contributor

@bsquizz bsquizz commented Sep 26, 2023

Some apps have a need to expose two API paths to the same back-end. This adds support for a new []string field called apiPaths -- in 'local' mode, Clowder will now configure the Ingress resource it creates with one or more paths. apiPath will now become deprecated.

@bsquizz bsquizz changed the title [WIP] Add support for apiPaths [RFR] Add support for apiPaths Sep 27, 2023
xxlhacker
xxlhacker previously approved these changes Oct 4, 2023
Copy link

@xxlhacker xxlhacker left a comment

Choose a reason for hiding this comment

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

👍

@wcmitchell
Copy link
Contributor

LGTM 👍

},
},
},
},
}

for _, apiPath := range apiPaths {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason not to turn this into a formatted list as you did above and then use that to iterate over?

Another question - should we take the opportunity here to make the apiPaths field require you to put the entire api path, not just the apiPath suffix?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just updated it to use the same approach and format the strings first.

Re the second question -- ok, yes we can do that here if you want to. I think I should just be able to use a +kubebuilder:validation:Pattern=<regex pattern> annotation on the field, correct? What type of patterns do we want to permit here to start with? Only /api/<text>/? Technically I think the regex for this will be something like:

//+kubuilder:validation:Pattern="^\/api\/[a-zA-Z-]+\/$"

@psav
Copy link
Collaborator

psav commented Oct 10, 2023

Looks good to me, there is a failing test - I didn't look , but let me know if you need anything in helping debug it.

@psav psav added pr-architectural-change Required architect sign-off enhancement New feature or request labels Oct 10, 2023
@bsquizz
Copy link
Contributor Author

bsquizz commented Oct 10, 2023

/retest

@bsquizz
Copy link
Contributor Author

bsquizz commented Oct 10, 2023

The assert in test-ephemeral-gateway keeps failing because we get a HTTP 403 back here: https://github.com/RedHatInsights/clowder/blob/master/tests/kuttl/test-ephemeral-gateway/test_creds.sh#L14

I'm not sure how my changes here would have impacted cert auth. We did modify test-ephemeral-gateway in both this PR and the cert auth PR, so I thought some oversights while rebasing and fixing the merge conflicts caused some problems for me, but I think I've sorted those out now and this assertion still fails for some reason, we might need to look at it together tomorrow.

@psav
Copy link
Collaborator

psav commented Oct 11, 2023

/retest

1 similar comment
@psav
Copy link
Collaborator

psav commented Oct 11, 2023

/retest

@bsquizz
Copy link
Contributor Author

bsquizz commented Oct 11, 2023

All checks passing now :)

@psav psav merged commit 4f58b5b into master Oct 11, 2023
5 checks passed
@gwenneg
Copy link
Member

gwenneg commented Oct 12, 2023

Thanks for this enhancement!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pr-architectural-change Required architect sign-off
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants