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

cloud-provider-e2e: Use test image-reflector build #287

Merged
merged 1 commit into from
Jul 25, 2022

Conversation

darkowlzz
Copy link
Contributor

Update the cloud provider e2e test suite to take the image-reflector-controller
build to be tested using the variable TEST_IMG. This test image must be
built locally before running the e2e tests. In the e2e tests, this local image
is re-tagged and pushed into a remote registry and is used in flux deployment.

For Google Artifact Registry and Azure Container Registry, the
previously created test registries are reused to push the
image-reflector image. But for ECR, a new repository is created due to
lack of support for dynamic repositories.

@pjbgf pjbgf added this to the GA milestone Jul 21, 2022
Run the test with `make test-*`:
Ensure the image-reflector-controller container image to be tested is built and
ready for testing.

Copy link
Member

@somtochiama somtochiama Jul 22, 2022

Choose a reason for hiding this comment

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

Should we add a small note here on how to build the image-controller-image and what extra steps to make it ready for testing?

We might also add (for those who don't want to build the image) that they can pull the fluxcd one to their local machine and use it.

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 think a brief pointer to the Makefile at the root of the repo would be good.

I was also thinking of adding a check if the given TEST_IMG exists in the local docker image store and if not, fail. If we do that, I think then we can put a default value for TEST_IMG, and print a message that it doesn't exist when it's not explicitly set.

Sure, we can also add some instructions about testing a stable release image.

Copy link
Member

Choose a reason for hiding this comment

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

I was also thinking of adding a check if the given TEST_IMG exists in the local docker image store and if not, fail.

This is a good idea. Right now, it fails after the terraform infrastructure has already been created. We can add the check much earlier.

Copy link
Contributor Author

@darkowlzz darkowlzz Jul 25, 2022

Choose a reason for hiding this comment

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

Added a docker image inspect command to check if the image already exists.

$ make test-gcp
# Check if the image exists locally.
docker image inspect fluxcd/image-reflector-controller:dev >/dev/null
Error: No such image: fluxcd/image-reflector-controller:dev
make[1]: *** [Makefile:22: test] Error 1

@@ -38,10 +38,14 @@ deleted manually.
Copy `.env.sample` to `.env`, put the respective provider configurations in the
environment variables and source it, `source .env`.

Copy link
Member

Choose a reason for hiding this comment

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

The different variables for each provider in .env.sample are commented out.
We can remind users here to uncomment it (or change the .env.sample so that they aren't commented).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

put the respective provider configurations in the environment variables and source it

should mean the same as it's talking about sourcing env vars.

Update the test suite to take the image-reflector-controller build to be
tested using the variable TEST_IMG. This test image must be built
locally before running the e2e tests. In the e2e tests, this local image
is retagged and pushed into a remote registry and is used in flux
deployment.

For Google Artifact Registry and Azure Container Registry, the
previously created test registries are reused to push the
image-reflector image. But for ECR, a new repository is created due to
lack of support for dynamic repositories.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
Copy link
Member

@pjbgf pjbgf left a comment

Choose a reason for hiding this comment

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

LGTM

@darkowlzz darkowlzz merged commit 9f66452 into main Jul 25, 2022
@darkowlzz darkowlzz deleted the cloud-e2e-test-image branch July 25, 2022 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants