Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Cilium upgrades #951

Merged
merged 1 commit into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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