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

Fix sample test workflow for PRs from forks #646

Open
rynowak opened this issue Oct 19, 2023 · 0 comments
Open

Fix sample test workflow for PRs from forks #646

rynowak opened this issue Oct 19, 2023 · 0 comments
Assignees

Comments

@rynowak
Copy link
Contributor

rynowak commented Oct 19, 2023

Summary

The issue we have is that our sample containers get pushed to GHCR even when we're just doing testing. The problem is that a PR from a fork will not (and should not) have permission to push to our GHCR.

Ideal solution

PRs from a fork 'just work' without an approval step.

Non-ideal solution

PRs from a fork give the user permissions on our GHCR, and then require approval to run. This isn't great because now we have a manual approval step.

How we could do it

What if we didn't push the images to GHCR.

  • We need a container registry that doesn't require permissions to read from.
  • We need to be able to read from the container registry in the Github Agent as we run a k3d cluster in the agent.

We create the K3d cluster here.

Conveniently K3d has a built in feature-set for an internal container registry: https://k3d.io/v5.6.0/usage/registries/

Solution:

  • Use K3d to create a local container registry that can be used from tests.
  • Push images to local container registry.
  • Parameterize the samples so that we can pass in the image reference. Here's an example of a hardcoded sample.
    • Add a new parameter that sets the image version.
    • Set the parameter default value to the current value.

AB#9864

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

No branches or pull requests

2 participants