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

Update quickstart to support arm hardware(ex: M1) #4457

Merged
merged 4 commits into from
Jun 30, 2023
Merged
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
2 changes: 1 addition & 1 deletion manifests/pipecd/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ spec:
{{- end }}
containers:
- name: mysql
image: mysql:{{ .Values.mysql.imageTag }}
image: {{ .Values.mysql.image }}:{{ .Values.mysql.imageTag }}
imagePullPolicy: IfNotPresent
env:
- name: MYSQL_ROOT_PASSWORD
Expand Down
3 changes: 2 additions & 1 deletion manifests/pipecd/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ cloudSQLProxy:
resources: {}

mysql:
imageTag: "8.0.23"
image: mysql
imageTag: 8.0.33
resources: {}
port: 3306

Expand Down
21 changes: 18 additions & 3 deletions pkg/app/pipectl/cmd/quickstart/quickstart.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ func (c *command) installControlPlane(ctx context.Context, helm string, input cl
"--create-namespace",
"--values",
fmt.Sprintf(helmQuickstartValueRemotePath, c.version),
"--set",
fmt.Sprintf("mysql.image=%s", selectMySQLImage()),
}

var stderr, stdout bytes.Buffer
Expand Down Expand Up @@ -312,6 +314,19 @@ func openbrowser(url string) error {
return err
}

func selectMySQLImage() string {
var mysqlImage string
switch runtime.GOARCH {
case "amd64":
mysqlImage = "mysql"
case "arm64":
mysqlImage = "arm64v8/mysql"
default:
mysqlImage = "mysql"
}
return mysqlImage
}

func (c *command) uninstallAll(ctx context.Context, helm string, input cli.Input) error {
input.Logger.Info("Uninstalling PipeCD components...")

Expand Down Expand Up @@ -380,9 +395,9 @@ func (c *command) getKubectl() (string, error) {
}

// getHelm finds and returns helm executable binary in the following priority:
// 1. pre-installed in command specified toolsDir (default is $HOME/.pipectl/tools)
// 2. $PATH
// 3. install new helm to command specified toolsDir
// 1. pre-installed in command specified toolsDir (default is $HOME/.pipectl/tools)
// 2. $PATH
// 3. install new helm to command specified toolsDir
func (c *command) getHelm(ctx context.Context) (string, error) {
binName := "helm"

Expand Down