kyma-project / hydroform

Infrastructure SDK for provisioning and managing Kubernetes cluster based on Terraform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

parallel-install: Improve pre-installation API

clebs opened this issue · comments

Description

The public API for doing the pre-installation tasks is leaking implementation details to the client and requires a big amount of code to use:

//Prepare cluster before Kyma installation
preInstallerCfg := preinstaller.Config{
InstallationResourcePath: installationCfg.InstallationResourcePath,
Log: installationCfg.Log,
KubeconfigSource: installationCfg.KubeconfigSource,
}
resourceParser := &preinstaller.GenericResourceParser{}
resourceManager, err := preinstaller.NewDefaultResourceManager(installationCfg.KubeconfigSource, preInstallerCfg.Log, commonRetryOpts)
if err != nil {
log.Fatalf("Failed to create Kyma default resource manager: %v", err)
}
resourceApplier := preinstaller.NewGenericResourceApplier(installationCfg.Log, resourceManager)
preInstaller, err := preinstaller.NewPreInstaller(resourceApplier, resourceParser, preInstallerCfg, commonRetryOpts)
if err != nil {
log.Fatalf("Failed to create Kyma pre-installer: %v", err)
}
result, err := preInstaller.InstallCRDs()
if err != nil || len(result.NotInstalled) > 0 {
log.Fatalf("Failed to install CRDs: %s", err)
}
result, err = preInstaller.CreateNamespaces()
if err != nil || len(result.NotInstalled) > 0 {
log.Fatalf("Failed to create namespaces: %s", err)
}

Refactor the API so that it can be used with more simple calls and hydroform does the heavy lifting.

Reasons

Improve dev experience and reduce mistakes.

This issue or PR has been automatically marked as stale due to the lack of recent activity.
Thank you for your contributions.

This bot triages issues and PRs according to the following rules:

  • After 60d of inactivity, lifecycle/stale is applied
  • After 7d of inactivity since lifecycle/stale was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Close this issue or PR with /close

If you think that I work incorrectly, kindly raise an issue with the problem.

/lifecycle stale

Issue is no longer valid, parallel installation package was deprecated and removed long ago.