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

Enable restricted network builds #709

Merged
merged 4 commits into from
Mar 31, 2022
Merged

Enable restricted network builds #709

merged 4 commits into from
Mar 31, 2022

Conversation

smuda
Copy link
Contributor

@smuda smuda commented Mar 22, 2022

Description

When building the grafana operator from source within a network restricted environment, being able to use local images and GOPROXY/GOPRIVATE is a requirement.

Relevant issues/tickets

#707

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • This change requires a documentation update
  • I have added tests that prove my fix is effective or that my feature works
  • I have added a test case that will be used to verify my changes
  • Verified independently on a cluster by reviewer

Verification steps

@NissesSenap
Copy link
Collaborator

The error seems to be related to: hadolint/hadolint#339

This seems like a okay workaround to define it in
ARGS instead of in the definiton: hadolint/hadolint#339 (comment)

What do you think @smuda ?

@smuda
Copy link
Contributor Author

smuda commented Mar 22, 2022

@NissesSenap You are probably right, well found! I've moved the default values to the top which also makes it more readable. At the same time I also rebased on top of the current HEAD from master.

To make sure images can be replaced I ran the following command and verified the output contained the new images:

$ docker build \
  --build-arg BUILDER_IMAGE=golang:1.18 \
  --build-arg UBI_MINIMAL_IMAGE=registry.access.redhat.com/ubi8/ubi-minimal:8.5 \
  --build-arg UBI_MICRO_IMAGE=registry.access.redhat.com/ubi8/ubi-micro:8.5 . 

To make sure GOPROXY can be replaced I ran the following command and watched as the network traffic did go the direct route to the dependencies:

docker build --build-arg GOPROXY=direct --build-arg GOPRIVATE=github.com . 

@pb82
Copy link
Collaborator

pb82 commented Mar 29, 2022

@smuda this looks good, only needs a rebase

@smuda
Copy link
Contributor Author

smuda commented Mar 30, 2022

@pb82 I rebased on top of master.

Copy link
Collaborator

@NissesSenap NissesSenap left a comment

Choose a reason for hiding this comment

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

LGTM, sorry for the delay and thanks for the help @smuda

@NissesSenap NissesSenap merged commit 2ec2ce5 into grafana:master Mar 31, 2022
@smuda smuda deleted the feature/enable-restricted-network-builds branch March 31, 2022 09:35
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

Successfully merging this pull request may close these issues.

3 participants