mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-09-20 21:14:37 -04:00
terraform-provider: Add support for STACKIT / OpenStack
This commit is contained in:
parent
1670d977c6
commit
d69673fab7
24 changed files with 511 additions and 36 deletions
|
@ -844,7 +844,7 @@ type applier interface {
|
|||
// methods required to install/upgrade Helm charts
|
||||
|
||||
PrepareHelmCharts(
|
||||
flags helm.Options, state *state.State, serviceAccURI string, masterSecret uri.MasterSecret, openStackCfg *config.OpenStackConfig,
|
||||
flags helm.Options, state *state.State, serviceAccURI string, masterSecret uri.MasterSecret,
|
||||
) (helm.Applier, bool, error)
|
||||
|
||||
// methods to interact with Kubernetes
|
||||
|
|
|
@ -554,7 +554,7 @@ func (s *stubConstellApplier) Init(context.Context, atls.Validator, *state.State
|
|||
|
||||
type helmApplier interface {
|
||||
PrepareHelmCharts(
|
||||
flags helm.Options, stateFile *state.State, serviceAccURI string, masterSecret uri.MasterSecret, openStackCfg *config.OpenStackConfig,
|
||||
flags helm.Options, stateFile *state.State, serviceAccURI string, masterSecret uri.MasterSecret,
|
||||
) (
|
||||
helm.Applier, bool, error)
|
||||
}
|
||||
|
|
|
@ -43,6 +43,18 @@ func (a *applyCmd) runHelmApply(cmd *cobra.Command, conf *config.Config, stateFi
|
|||
ApplyTimeout: a.flags.helmTimeout,
|
||||
AllowDestructive: helm.DenyDestructive,
|
||||
}
|
||||
if conf.Provider.OpenStack != nil {
|
||||
var deployYawolLoadBalancer bool
|
||||
if conf.Provider.OpenStack.DeployYawolLoadBalancer != nil {
|
||||
deployYawolLoadBalancer = *conf.Provider.OpenStack.DeployYawolLoadBalancer
|
||||
}
|
||||
options.OpenStackValues = &helm.OpenStackValues{
|
||||
DeployYawolLoadBalancer: deployYawolLoadBalancer,
|
||||
FloatingIPPoolID: conf.Provider.OpenStack.FloatingIPPoolID,
|
||||
YawolFlavorID: conf.Provider.OpenStack.YawolFlavorID,
|
||||
YawolImageID: conf.Provider.OpenStack.YawolImageID,
|
||||
}
|
||||
}
|
||||
|
||||
a.log.Debug("Getting service account URI")
|
||||
serviceAccURI, err := cloudcmd.GetMarshaledServiceAccountURI(conf, a.fileHandler)
|
||||
|
@ -51,7 +63,7 @@ func (a *applyCmd) runHelmApply(cmd *cobra.Command, conf *config.Config, stateFi
|
|||
}
|
||||
|
||||
a.log.Debug("Preparing Helm charts")
|
||||
executor, includesUpgrades, err := a.applier.PrepareHelmCharts(options, stateFile, serviceAccURI, masterSecret, conf.Provider.OpenStack)
|
||||
executor, includesUpgrades, err := a.applier.PrepareHelmCharts(options, stateFile, serviceAccURI, masterSecret)
|
||||
if errors.Is(err, helm.ErrConfirmationMissing) {
|
||||
if !a.flags.yes {
|
||||
cmd.PrintErrln("WARNING: Upgrading cert-manager will destroy all custom resources you have manually created that are based on the current version of cert-manager.")
|
||||
|
@ -65,7 +77,7 @@ func (a *applyCmd) runHelmApply(cmd *cobra.Command, conf *config.Config, stateFi
|
|||
}
|
||||
}
|
||||
options.AllowDestructive = helm.AllowDestructive
|
||||
executor, includesUpgrades, err = a.applier.PrepareHelmCharts(options, stateFile, serviceAccURI, masterSecret, conf.Provider.OpenStack)
|
||||
executor, includesUpgrades, err = a.applier.PrepareHelmCharts(options, stateFile, serviceAccURI, masterSecret)
|
||||
}
|
||||
var upgradeErr *compatibility.InvalidUpgradeError
|
||||
if err != nil {
|
||||
|
|
|
@ -279,7 +279,7 @@ type stubHelmApplier struct {
|
|||
}
|
||||
|
||||
func (s stubHelmApplier) PrepareHelmCharts(
|
||||
_ helm.Options, _ *state.State, _ string, _ uri.MasterSecret, _ *config.OpenStackConfig,
|
||||
_ helm.Options, _ *state.State, _ string, _ uri.MasterSecret,
|
||||
) (helm.Applier, bool, error) {
|
||||
return stubRunner{}, false, s.err
|
||||
}
|
||||
|
|
|
@ -376,9 +376,9 @@ type mockApplier struct {
|
|||
}
|
||||
|
||||
func (m *mockApplier) PrepareHelmCharts(
|
||||
helmOpts helm.Options, stateFile *state.State, str string, masterSecret uri.MasterSecret, openStackCfg *config.OpenStackConfig,
|
||||
helmOpts helm.Options, stateFile *state.State, str string, masterSecret uri.MasterSecret,
|
||||
) (helm.Applier, bool, error) {
|
||||
args := m.Called(helmOpts, stateFile, helmOpts, str, masterSecret, openStackCfg)
|
||||
args := m.Called(helmOpts, stateFile, helmOpts, str, masterSecret)
|
||||
return args.Get(0).(helm.Applier), args.Bool(1), args.Error(2)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue