mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-11-16 01:59:57 -05: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
|
|
@ -55,8 +55,8 @@ func NewOSInstaller() *OsInstaller {
|
|||
|
||||
// Install downloads a resource from a URL, applies any given text transformations and extracts the resulting file if required.
|
||||
// The resulting file(s) are copied to the destination. It also verifies the sha256 hash of the downloaded file.
|
||||
func (i *OsInstaller) Install(ctx context.Context, kubernetesComponent components.Component) error {
|
||||
tempPath, err := i.retryDownloadToTempDir(ctx, kubernetesComponent.URL)
|
||||
func (i *OsInstaller) Install(ctx context.Context, kubernetesComponent *components.Component) error {
|
||||
tempPath, err := i.retryDownloadToTempDir(ctx, kubernetesComponent.Url)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -83,7 +83,7 @@ func (i *OsInstaller) Install(ctx context.Context, kubernetesComponent component
|
|||
err = i.copy(tempPath, kubernetesComponent.InstallPath, executablePerm)
|
||||
}
|
||||
if err != nil {
|
||||
return fmt.Errorf("installing from %q: copying to destination %q: %w", kubernetesComponent.URL, kubernetesComponent.InstallPath, err)
|
||||
return fmt.Errorf("installing from %q: copying to destination %q: %w", kubernetesComponent.Url, kubernetesComponent.InstallPath, err)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue