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

feat: add optional flag to install airbyte with auth disabled #156

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
}
Expand All @@ -33,6 +33,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."`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
DisableAuth bool `help:"Disable Auth."`
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
Loading