Skip to content

Commit

Permalink
Enable Cilium upgrades (#951)
Browse files Browse the repository at this point in the history
  • Loading branch information
g-gaston authored Jan 12, 2022
1 parent bb2a5dd commit f99aa72
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 19 deletions.
8 changes: 0 additions & 8 deletions pkg/features/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const (
TinkerbellProviderEnvVar = "TINKERBELL_PROVIDER"
FullLifecycleAPIEnvVar = "FULL_LIFECYCLE_API"
FullLifecycleGate = "FullLifecycleAPI"
NetworkingUpgradeEnvVar = "NETWORKING_UPGRADE"
)

func FeedGates(featureGates []string) {
Expand Down Expand Up @@ -49,10 +48,3 @@ func TinkerbellProvider() Feature {
IsActive: globalFeatures.isActiveForEnvVar(TinkerbellProviderEnvVar),
}
}

func NetworkingUpgrade() Feature {
return Feature{
Name: "Upgrade CNI during cluster upgrades",
IsActive: globalFeatures.isActiveForEnvVar(NetworkingUpgradeEnvVar),
}
}
16 changes: 7 additions & 9 deletions pkg/workflows/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (

"github.com/aws/eks-anywhere/pkg/cluster"
"github.com/aws/eks-anywhere/pkg/clustermarshaller"
"github.com/aws/eks-anywhere/pkg/features"
"github.com/aws/eks-anywhere/pkg/filewriter"
"github.com/aws/eks-anywhere/pkg/logger"
"github.com/aws/eks-anywhere/pkg/providers"
Expand Down Expand Up @@ -182,16 +181,15 @@ func (s *upgradeCoreComponents) Run(ctx context.Context, commandContext *task.Co
target := getManagementCluster(commandContext)

logger.Info("Upgrading core components")
if features.IsActive(features.NetworkingUpgrade()) {
changeDiff, err := commandContext.ClusterManager.UpgradeNetworking(ctx, target, commandContext.CurrentClusterSpec, commandContext.ClusterSpec)
if err != nil {
commandContext.SetError(err)
return &CollectDiagnosticsTask{}
}
commandContext.UpgradeChangeDiff.Append(changeDiff)

changeDiff, err := commandContext.ClusterManager.UpgradeNetworking(ctx, target, commandContext.CurrentClusterSpec, commandContext.ClusterSpec)
if err != nil {
commandContext.SetError(err)
return &CollectDiagnosticsTask{}
}
commandContext.UpgradeChangeDiff.Append(changeDiff)

changeDiff, err := commandContext.CAPIManager.Upgrade(ctx, target, commandContext.Provider, commandContext.CurrentClusterSpec, commandContext.ClusterSpec)
changeDiff, err = commandContext.CAPIManager.Upgrade(ctx, target, commandContext.Provider, commandContext.CurrentClusterSpec, commandContext.ClusterSpec)
if err != nil {
commandContext.SetError(err)
return &CollectDiagnosticsTask{}
Expand Down
3 changes: 1 addition & 2 deletions pkg/workflows/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/bootstrapper"
"github.com/aws/eks-anywhere/pkg/cluster"
"github.com/aws/eks-anywhere/pkg/features"
writermocks "github.com/aws/eks-anywhere/pkg/filewriter/mocks"
"github.com/aws/eks-anywhere/pkg/providers"
providermocks "github.com/aws/eks-anywhere/pkg/providers/mocks"
Expand Down Expand Up @@ -42,7 +41,7 @@ type upgradeTestSetup struct {
}

func newUpgradeTest(t *testing.T) *upgradeTestSetup {
featureEnvVars := []string{features.NetworkingUpgradeEnvVar}
featureEnvVars := []string{}
mockCtrl := gomock.NewController(t)
bootstrapper := mocks.NewMockBootstrapper(mockCtrl)
clusterManager := mocks.NewMockClusterManager(mockCtrl)
Expand Down

0 comments on commit f99aa72

Please sign in to comment.