forked from kyma-project/kyma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cluster-prerequisites.go
47 lines (35 loc) · 1.5 KB
/
cluster-prerequisites.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package steps
import (
"log"
"path"
"github.com/kyma-project/kyma/components/installer/pkg/config"
"github.com/kyma-project/kyma/components/installer/pkg/toolkit"
)
//InstallClusterPrerequisites will install all needed before Kyma installation resources
func (steps *InstallationSteps) InstallClusterPrerequisites(installationData *config.InstallationData) error {
const stepName string = "Installing cluster prerequisites"
steps.PrintInstallationStep(stepName)
steps.statusManager.InProgress(stepName)
prerequisitesScriptPath := path.Join(steps.chartDir, "cluster-prerequisites/install.sh")
err := steps.kymaCommandExecutor.RunCommand("/bin/bash", prerequisitesScriptPath)
if steps.errorHandlers.CheckError("Script Error: ", err) {
steps.statusManager.Error(stepName)
return err
}
log.Println(stepName + "...DONE")
return nil
}
//UpdateClusterPrerequisites will update all needed before Kyma installation resources
func (steps *InstallationSteps) UpdateClusterPrerequisites(installationData *config.InstallationData) error {
const stepName string = "Updating cluster prerequisites"
steps.PrintInstallationStep(stepName)
steps.statusManager.InProgress(stepName)
prerequisitesScriptPath := path.Join(steps.chartDir, "cluster-prerequisites/update.sh")
err := steps.kymaCommandExecutor.RunBashCommand(prerequisitesScriptPath, toolkit.EmptyArgs)
if steps.errorHandlers.CheckError("Script Error: ", err) {
steps.statusManager.Error(stepName)
return err
}
log.Println(stepName + "...DONE")
return nil
}