mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-01 19:46:07 -04:00
cli: only apply upgrades on gcp/azure (#1518)
The constellation-operator currently doesn't support the necessary operations for AWS, OpenStack and QEMU.
This commit is contained in:
parent
870182987c
commit
861bc84f94
2 changed files with 27 additions and 16 deletions
|
@ -15,6 +15,7 @@ import (
|
||||||
"github.com/edgelesssys/constellation/v2/cli/internal/cloudcmd"
|
"github.com/edgelesssys/constellation/v2/cli/internal/cloudcmd"
|
||||||
"github.com/edgelesssys/constellation/v2/cli/internal/helm"
|
"github.com/edgelesssys/constellation/v2/cli/internal/helm"
|
||||||
"github.com/edgelesssys/constellation/v2/internal/attestation/measurements"
|
"github.com/edgelesssys/constellation/v2/internal/attestation/measurements"
|
||||||
|
"github.com/edgelesssys/constellation/v2/internal/cloud/cloudprovider"
|
||||||
"github.com/edgelesssys/constellation/v2/internal/compatibility"
|
"github.com/edgelesssys/constellation/v2/internal/compatibility"
|
||||||
"github.com/edgelesssys/constellation/v2/internal/config"
|
"github.com/edgelesssys/constellation/v2/internal/config"
|
||||||
"github.com/edgelesssys/constellation/v2/internal/file"
|
"github.com/edgelesssys/constellation/v2/internal/file"
|
||||||
|
@ -80,6 +81,7 @@ func (u *upgradeApplyCmd) upgradeApply(cmd *cobra.Command, fileHandler file.Hand
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if conf.GetProvider() == cloudprovider.Azure || conf.GetProvider() == cloudprovider.GCP {
|
||||||
err = u.handleServiceUpgrade(cmd, conf, flags)
|
err = u.handleServiceUpgrade(cmd, conf, flags)
|
||||||
upgradeErr := &compatibility.InvalidUpgradeError{}
|
upgradeErr := &compatibility.InvalidUpgradeError{}
|
||||||
switch {
|
switch {
|
||||||
|
@ -92,12 +94,15 @@ func (u *upgradeApplyCmd) upgradeApply(cmd *cobra.Command, fileHandler file.Hand
|
||||||
err = u.upgrader.UpgradeNodeVersion(cmd.Context(), conf)
|
err = u.upgrader.UpgradeNodeVersion(cmd.Context(), conf)
|
||||||
switch {
|
switch {
|
||||||
case errors.Is(err, cloudcmd.ErrInProgress):
|
case errors.Is(err, cloudcmd.ErrInProgress):
|
||||||
cmd.PrintErrln("Skipping image & Kubernetes upgrades. Another upgrade is in progress")
|
cmd.PrintErrln("Skipping image and Kubernetes upgrades. Another upgrade is in progress.")
|
||||||
case errors.As(err, &upgradeErr):
|
case errors.As(err, &upgradeErr):
|
||||||
cmd.PrintErrln(err)
|
cmd.PrintErrln(err)
|
||||||
case err != nil:
|
case err != nil:
|
||||||
return fmt.Errorf("upgrading NodeVersion: %w", err)
|
return fmt.Errorf("upgrading NodeVersion: %w", err)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
cmd.PrintErrln("WARNING: Skipping service and image upgrades, which are currently only supported for Azure and GCP.")
|
||||||
|
}
|
||||||
|
|
||||||
// If an image upgrade was just executed there won't be a diff. The function will return nil in that case.
|
// If an image upgrade was just executed there won't be a diff. The function will return nil in that case.
|
||||||
if err := u.upgradeMeasurementsIfDiff(cmd, conf.GetMeasurements(), flags); err != nil {
|
if err := u.upgradeMeasurementsIfDiff(cmd, conf.GetMeasurements(), flags); err != nil {
|
||||||
|
|
|
@ -6,6 +6,12 @@ You configure the desired versions in your local Constellation configuration and
|
||||||
To learn about available versions you use the `upgrade check` command.
|
To learn about available versions you use the `upgrade check` command.
|
||||||
Which versions are available depends on the CLI version you are using.
|
Which versions are available depends on the CLI version you are using.
|
||||||
|
|
||||||
|
:::caution
|
||||||
|
|
||||||
|
Upgrades arent't yet implemented for AWS. If you require this feature, [let us know](https://github.com/edgelesssys/constellation/issues/new?assignees=&labels=&template=feature_request.md)!
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
## Update the CLI
|
## Update the CLI
|
||||||
|
|
||||||
Each CLI comes with a set of supported microservice and Kubernetes versions.
|
Each CLI comes with a set of supported microservice and Kubernetes versions.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue