Skip to content

Commit

Permalink
fix: a sha256 checking bug when downloading different versions of bin…
Browse files Browse the repository at this point in the history
…ary files

Signed-off-by: 24sama <[email protected]>
  • Loading branch information
24sama committed Dec 7, 2022
1 parent 736af43 commit ce9a04e
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pkg/service/operation/file/containerd.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func NewContainerd(sshClient ssh.Interface, rootFs rootfs.Interface, version, ar
RootFs: rootFs,
Type: FileBinary,
Name: fileName,
LocalFullPath: filepath.Join(rootFs.ClusterRootFsDir(), fileName),
LocalFullPath: filepath.Join(rootFs.ClusterRootFsDir(), ContainerdID, version, arch, fileName),
RemoteFullPath: filepath.Join(BinDir, fileName),
})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/service/operation/file/crictl.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func NewCrictl(sshClient ssh.Interface, rootFs rootfs.Interface, version, arch s
RootFs: rootFs,
Type: FileBinary,
Name: fileName,
LocalFullPath: filepath.Join(rootFs.ClusterRootFsDir(), fileName),
LocalFullPath: filepath.Join(rootFs.ClusterRootFsDir(), CrictlID, version, arch, fileName),
RemoteFullPath: filepath.Join(BinDir, fileName),
})
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/service/operation/file/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func NewDocker(sshClient ssh.Interface, rootFs rootfs.Interface, version, arch s
RootFs: rootFs,
Type: FileBinary,
Name: fileName,
LocalFullPath: filepath.Join(rootFs.ClusterRootFsDir(), fileName),
LocalFullPath: filepath.Join(rootFs.ClusterRootFsDir(), DockerID, version, arch, fileName),
RemoteFullPath: filepath.Join(directory.BinDir, fileName),
})
if err != nil {
Expand Down Expand Up @@ -100,7 +100,7 @@ func NewCRIDockerd(sshClient ssh.Interface, rootFs rootfs.Interface, version, ar
RootFs: rootFs,
Type: FileBinary,
Name: fileName,
LocalFullPath: filepath.Join(rootFs.ClusterRootFsDir(), fileName),
LocalFullPath: filepath.Join(rootFs.ClusterRootFsDir(), CRIDockerdID, version, arch, fileName),
RemoteFullPath: filepath.Join(directory.BinDir, fileName),
})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/service/operation/file/k3s.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func NewK3s(sshClient ssh.Interface, rootFs rootfs.Interface, version, arch stri
RootFs: rootFs,
Type: FileBinary,
Name: fileName,
LocalFullPath: filepath.Join(rootFs.ClusterRootFsDir(), fileName),
LocalFullPath: filepath.Join(rootFs.ClusterRootFsDir(), K3sID, version, arch, fileName),
RemoteFullPath: filepath.Join(BinDir, fileName),
})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/service/operation/file/kubeadm.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func NewKubeadm(sshClient ssh.Interface, rootFs rootfs.Interface, version, arch
RootFs: rootFs,
Type: FileBinary,
Name: fileName,
LocalFullPath: filepath.Join(rootFs.ClusterRootFsDir(), fileName),
LocalFullPath: filepath.Join(rootFs.ClusterRootFsDir(), KubeadmID, version, arch, fileName),
RemoteFullPath: filepath.Join(BinDir, fileName),
})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/service/operation/file/kubecni.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func NewKubecni(sshClient ssh.Interface, rootFs rootfs.Interface, version, arch
RootFs: rootFs,
Type: FileBinary,
Name: fileName,
LocalFullPath: filepath.Join(rootFs.ClusterRootFsDir(), fileName),
LocalFullPath: filepath.Join(rootFs.ClusterRootFsDir(), KubecniID, version, arch, fileName),
RemoteFullPath: filepath.Join(OptCniBinDir, fileName),
})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/service/operation/file/kubectl.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func NewKubectl(sshClient ssh.Interface, rootFs rootfs.Interface, version, arch
RootFs: rootFs,
Type: FileBinary,
Name: fileName,
LocalFullPath: filepath.Join(rootFs.ClusterRootFsDir(), fileName),
LocalFullPath: filepath.Join(rootFs.ClusterRootFsDir(), KubectlID, version, arch, fileName),
RemoteFullPath: filepath.Join(BinDir, fileName),
})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/service/operation/file/kubelet.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func NewKubelet(sshClient ssh.Interface, rootFs rootfs.Interface, version, arch
RootFs: rootFs,
Type: FileBinary,
Name: fileName,
LocalFullPath: filepath.Join(rootFs.ClusterRootFsDir(), fileName),
LocalFullPath: filepath.Join(rootFs.ClusterRootFsDir(), KubeletID, version, arch, fileName),
RemoteFullPath: filepath.Join(BinDir, fileName),
})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/service/operation/file/runc.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func NewRunc(sshClient ssh.Interface, rootFs rootfs.Interface, version, arch str
RootFs: rootFs,
Type: FileBinary,
Name: fileName,
LocalFullPath: filepath.Join(rootFs.ClusterRootFsDir(), fileName),
LocalFullPath: filepath.Join(rootFs.ClusterRootFsDir(), RuncID, version, arch, fileName),
RemoteFullPath: filepath.Join(BinDir, fileName),
})
if err != nil {
Expand Down

0 comments on commit ce9a04e

Please sign in to comment.