Skip to content

Commit

Permalink
fix: local repository is hard-coded as centos7
Browse files Browse the repository at this point in the history
Signed-off-by: pixiake <[email protected]>
  • Loading branch information
pixiake committed Apr 25, 2023
1 parent 5ce93a4 commit 055afb8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/kk/pkg/bootstrap/os/repository/repository_rpm.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ func (r *RedhatPackageManager) Add(runtime connector.Runtime, path string) error

content := fmt.Sprintf(`cat << EOF > /etc/yum.repos.d/CentOS-local.repo
[base-local]
name=CentOS7.6-local
name=rpms-local
baseurl=file://%s
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
gpgcheck=0
EOF
`, path)
if _, err := runtime.GetRunner().SudoCmd(content, false); err != nil {
Expand Down
4 changes: 4 additions & 0 deletions cmd/kk/pkg/bootstrap/os/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,10 @@ func (i *InstallPackage) Execute(runtime connector.Runtime) error {
pkg = i.KubeConf.Cluster.System.Rpms
}

if installErr := r.Update(runtime); installErr != nil {
return errors.Wrap(errors.WithStack(installErr), "update repository failed")
}

if installErr := r.Install(runtime, pkg...); installErr != nil {
return errors.Wrap(errors.WithStack(installErr), "install repository package failed")
}
Expand Down

0 comments on commit 055afb8

Please sign in to comment.