mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-02 06:16:08 -04:00
versions: consolidate various types of Components
There used to be three definitions of a Component type, and conversion routines between the three. Since the use case is always the same, and the Component semantics are defined by versions.go and the installer, it seems appropriate to define the Component type there and import it in the necessary places.
This commit is contained in:
parent
a8fb6c5af0
commit
a1dbd13f95
25 changed files with 454 additions and 379 deletions
|
@ -133,8 +133,8 @@ func prepareUpdate(ctx context.Context, installer osInstaller, updateRequest *up
|
|||
}
|
||||
|
||||
// download & install the kubeadm binary
|
||||
return installer.Install(ctx, components.Component{
|
||||
URL: updateRequest.KubeadmUrl,
|
||||
return installer.Install(ctx, &components.Component{
|
||||
Url: updateRequest.KubeadmUrl,
|
||||
Hash: updateRequest.KubeadmHash,
|
||||
InstallPath: constants.KubeadmPath,
|
||||
Extract: false,
|
||||
|
@ -151,7 +151,7 @@ func verifyVersion(version string) error {
|
|||
|
||||
type osInstaller interface {
|
||||
// Install downloads, installs and verifies the kubernetes component.
|
||||
Install(ctx context.Context, kubernetesComponent components.Component) error
|
||||
Install(ctx context.Context, kubernetesComponent *components.Component) error
|
||||
}
|
||||
|
||||
type serveStopper interface {
|
||||
|
|
|
@ -100,6 +100,6 @@ type stubOsInstaller struct {
|
|||
InstallErr error
|
||||
}
|
||||
|
||||
func (s stubOsInstaller) Install(_ context.Context, _ components.Component) error {
|
||||
func (s stubOsInstaller) Install(_ context.Context, _ *components.Component) error {
|
||||
return s.InstallErr
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue