Skip to content

Commit

Permalink
feat: add optional flag to install airbyte with auth disabled (#156)
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Buchanan <[email protected]>
  • Loading branch information
asafcyclops and abuchanan-airbyte authored Jan 22, 2025
1 parent 0414536 commit 25f9627
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 5 additions & 1 deletion internal/cmd/local/helm/airbyte_values.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ type ValuesOpts struct {
InsecureCookies bool
TelemetryUser string
ImagePullSecret string
DisableAuth bool
}

func BuildAirbyteValues(ctx context.Context, opts ValuesOpts) (string, error) {
span := trace.SpanFromContext(ctx)

vals := []string{
"global.env_vars.AIRBYTE_INSTALLATION_ID=" + opts.TelemetryUser,
"global.auth.enabled=true",
"global.jobs.resources.limits.cpu=3",
"global.jobs.resources.limits.memory=4Gi",
"airbyte-bootloader.env_vars.PLATFORM_LOG_FORMAT=json",
Expand All @@ -34,6 +34,10 @@ func BuildAirbyteValues(ctx context.Context, opts ValuesOpts) (string, error) {
attribute.Bool("image-pull-secret", opts.ImagePullSecret != ""),
)

if !opts.DisableAuth {
vals = append(vals, "global.auth.enabled=true")
}

if opts.LowResourceMode {
vals = append(vals,
"server.env_vars.JOB_RESOURCE_VARIANT_OVERRIDE=lowresource",
Expand Down
6 changes: 4 additions & 2 deletions internal/cmd/local/local_install.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
type InstallCmd struct {
Chart string `help:"Path to chart." xor:"chartver"`
ChartVersion string `help:"Version to install." xor:"chartver"`
DisableAuth bool `help:"Disable auth."`
DockerEmail string `group:"docker" help:"Docker email." env:"ABCTL_LOCAL_INSTALL_DOCKER_EMAIL"`
DockerPassword string `group:"docker" help:"Docker password." env:"ABCTL_LOCAL_INSTALL_DOCKER_PASSWORD"`
DockerServer string `group:"docker" default:"https://index.docker.io/v1/" help:"Docker server." env:"ABCTL_LOCAL_INSTALL_DOCKER_SERVER"`
Expand Down Expand Up @@ -68,6 +69,7 @@ func (i *InstallCmd) InstallOpts(ctx context.Context, user string) (*local.Insta
ValuesFile: i.Values,
InsecureCookies: i.InsecureCookies,
LowResourceMode: i.LowResourceMode,
DisableAuth: i.DisableAuth,
}

if opts.DockerAuth() {
Expand Down Expand Up @@ -166,9 +168,9 @@ func (i *InstallCmd) Run(ctx context.Context, provider k8s.Provider, telClient t
return fmt.Errorf("unable to initialize local command: %w", err)
}

spinner.UpdateText("Pulling images")
spinner.UpdateText("Pulling images")
lc.PrepImages(ctx, cluster, opts)

if err := lc.Install(ctx, opts); err != nil {
spinner.Fail("Unable to install Airbyte locally")
return err
Expand Down

0 comments on commit 25f9627

Please sign in to comment.