mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
bootstraper: delete helm chart on installation failure before retrying installation (#1977)
* Delete helm chart on failure before retrying installation * Add chart name to debug output * Remove now unused wait flag from helm Release struct --------- Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
parent
31a22bb443
commit
5a9f9c0a52
@ -57,6 +57,8 @@ func New(log *logger.Logger) (*Client, error) {
|
||||
action := action.NewInstall(actionConfig)
|
||||
action.Namespace = constants.HelmNamespace
|
||||
action.Timeout = timeout
|
||||
action.Atomic = true
|
||||
action.Wait = true
|
||||
|
||||
return &Client{
|
||||
action,
|
||||
@ -67,7 +69,6 @@ func New(log *logger.Logger) (*Client, error) {
|
||||
// InstallConstellationServices installs the constellation-services chart. In the future this chart should bundle all microservices.
|
||||
func (h *Client) InstallConstellationServices(ctx context.Context, release helm.Release, extraVals map[string]any) error {
|
||||
h.ReleaseName = release.ReleaseName
|
||||
h.Wait = release.Wait
|
||||
|
||||
mergedVals := helm.MergeMaps(release.Values, extraVals)
|
||||
|
||||
@ -77,7 +78,6 @@ func (h *Client) InstallConstellationServices(ctx context.Context, release helm.
|
||||
// InstallCertManager installs the cert-manager chart.
|
||||
func (h *Client) InstallCertManager(ctx context.Context, release helm.Release) error {
|
||||
h.ReleaseName = release.ReleaseName
|
||||
h.Wait = release.Wait
|
||||
h.Timeout = 10 * time.Minute
|
||||
|
||||
return h.install(ctx, release.Chart, release.Values)
|
||||
@ -86,7 +86,6 @@ func (h *Client) InstallCertManager(ctx context.Context, release helm.Release) e
|
||||
// InstallOperators installs the Constellation Operators.
|
||||
func (h *Client) InstallOperators(ctx context.Context, release helm.Release, extraVals map[string]any) error {
|
||||
h.ReleaseName = release.ReleaseName
|
||||
h.Wait = release.Wait
|
||||
|
||||
mergedVals := helm.MergeMaps(release.Values, extraVals)
|
||||
|
||||
@ -96,7 +95,6 @@ func (h *Client) InstallOperators(ctx context.Context, release helm.Release, ext
|
||||
// InstallCilium sets up the cilium pod network.
|
||||
func (h *Client) InstallCilium(ctx context.Context, kubectl k8sapi.Client, release helm.Release, in k8sapi.SetupPodNetworkInput) error {
|
||||
h.ReleaseName = release.ReleaseName
|
||||
h.Wait = release.Wait
|
||||
|
||||
timeoutS := int64(10)
|
||||
// allow coredns to run on uninitialized nodes (required by cloud-controller-manager)
|
||||
@ -215,7 +213,10 @@ type installDoer struct {
|
||||
func (i installDoer) Do(ctx context.Context) error {
|
||||
i.log.With(zap.String("chart", i.chart.Name())).Infof("Trying to install Helm chart")
|
||||
|
||||
_, err := i.client.RunWithContext(ctx, i.chart, i.values)
|
||||
|
||||
if _, err := i.client.RunWithContext(ctx, i.chart, i.values); err != nil {
|
||||
i.log.With(zap.Error(err), zap.String("chart", i.chart.Name())).Errorf("Helm chart installation failed")
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -168,7 +168,7 @@ func (i *ChartLoader) loadRelease(info chartInfo) (helm.Release, error) {
|
||||
return helm.Release{}, fmt.Errorf("packaging %s chart: %w", info.releaseName, err)
|
||||
}
|
||||
|
||||
return helm.Release{Chart: chartRaw, Values: values, ReleaseName: info.releaseName, Wait: false}, nil
|
||||
return helm.Release{Chart: chartRaw, Values: values, ReleaseName: info.releaseName}, nil
|
||||
}
|
||||
|
||||
// loadCiliumValues is used to separate the marshalling step from the loading step.
|
||||
|
@ -12,7 +12,6 @@ type Release struct {
|
||||
Chart []byte
|
||||
Values map[string]any
|
||||
ReleaseName string
|
||||
Wait bool
|
||||
}
|
||||
|
||||
// Releases bundles all helm releases to be deployed to Constellation.
|
||||
|
Loading…
Reference in New Issue
Block a user