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

Add support for allowing network access during build #420

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

cpuguy83
Copy link
Member

Adds a field network_mode. The value of this field can be any of:

  • Unset
  • "none" - Disable networking (default)
  • "sandbox" - Networking enabled with its own network namespace

Buildkit supports host mode as well, but I have opted to not support that here for now.

@cpuguy83 cpuguy83 requested a review from a team as a code owner October 30, 2024 19:55
spec.go Outdated
@@ -401,6 +401,11 @@ type ArtifactBuild struct {
Steps []BuildStep `yaml:"steps" json:"steps" jsonschema:"required"`
// Env is the list of environment variables to set for all commands in this step group.
Env map[string]string `yaml:"env,omitempty" json:"env,omitempty"`

// NetworkMode sets the network mode to use during the build phase.
// Accepted values: none, sandboxed
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Accepted values: none, sandboxed
// Accepted values: none, sandbox

func testBuildNetworkMode(ctx context.Context, t *testing.T, cfg targetConfig) {
type testCase struct {
mode string
canHazInternetz bool // :)
Copy link
Member

Choose a reason for hiding this comment

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

😹

Copy link
Member

@sozercan sozercan left a comment

Choose a reason for hiding this comment

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

minor comment, otherwise LGTM

@cpuguy83 cpuguy83 added this to the v0.10.0 milestone Oct 30, 2024
Adds a field `network_mode`. The value of this field can be any of:

- Unset
- "none" - Disable networking (default)
- "sandbox" - Networking enabled with its own network namespace

Buildkit supports `host` mode as well, but I have opted to not support
that here for now.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
@cpuguy83 cpuguy83 merged commit 42775ee into Azure:main Oct 30, 2024
10 checks passed
@cpuguy83 cpuguy83 deleted the allow_networking branch October 30, 2024 22:15
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.

2 participants