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

chore: enhance KongPluginInstallation example and document tests #881

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

programmer04
Copy link
Member

@programmer04 programmer04 commented Nov 22, 2024

What this PR does / why we need it:

Tests for KongPluginInstallation rely on container registries configured in k8s-team's GCP project and images built according to specifications. This PR leaves some description for future us to learn how those were built and what they contain. Moreover, it simplifies and enhances examplar to make it more informative.

Which issue this PR fixes

Closes #465

Special notes for your reviewer:

Building some kind of machinery/scripts for auto bootstrap, etc. seems like an overkill because they won't change often (also, we've already used remote registers in our tests, e.g. KIC image, http-echo, etc.). Furthermore, building and uploading a container image according to the docs is not the hardest / most time-consuming job in the world - see the cost/saving ratio

Reviewer please check if you have access. As a member of k8s-team you should.

@programmer04 programmer04 added enhancement New feature or request area/tests labels Nov 22, 2024
@programmer04 programmer04 added this to the KGO v1.5.x milestone Nov 22, 2024
@programmer04 programmer04 self-assigned this Nov 22, 2024
@programmer04 programmer04 marked this pull request as ready for review November 22, 2024 15:32
@programmer04 programmer04 requested a review from a team as a code owner November 22, 2024 15:32
@programmer04 programmer04 enabled auto-merge (squash) November 22, 2024 15:32
@czeslavo
Copy link
Contributor

Building some kind of machinery/scripts for auto bootstrap, etc. seems like an overkill because they won't change often

I partially agree, but IMO it wouldn't be a huge cost to have source Dockerfiles for every image used in these tests stored in this repo just in case we delete those images by mistake or something. I don't expect an end-to-end automation that syncs the images with the remote registry but to have a living reference to what these images are underneath.

@programmer04
Copy link
Member Author

I thought about it @czeslavo. There is a manual in the official docs that are mentioned in the comment as baseline + each test case name and assertion shows what should be inside (but yep it may change). For each image we have to have a Dockerfile + plugin files (with dir structure) to copy inside this. So, for instance, to test exceeding size putting a 1MiB garbage file in the repository similar with two files of 512KiB, etc. when the whole repo currently is 8.6M. This is why I didn't put them. But ofc I may put some placeholder files for them. WDYT?

@czeslavo
Copy link
Contributor

czeslavo commented Nov 26, 2024

Yeah, I imagine there could be a directory dedicated to these images, e.g., under hack/plugin-images and a separate dir for every image. As for the huge files, we can generate these in the Dockerfile itself randomly and not store them in the repo. I believe RUN dd if=/dev/urandom of=random_file bs=1M count=2 should add a random 2MB file to the image.

Copy link
Contributor

@czeslavo czeslavo left a comment

Choose a reason for hiding this comment

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

Thank you for adding Dockerfiles 🎖️

@programmer04 programmer04 merged commit 94b0ccc into main Nov 26, 2024
21 checks passed
@programmer04 programmer04 deleted the better-docs branch November 26, 2024 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tests enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Streamline and automatize/document testing strategy for KongPluginInstallation CRDs
2 participants