From c8b9e55cf23a326769a992bd3f321151c35ff8a8 Mon Sep 17 00:00:00 2001 From: Cavaughn Browne Date: Fri, 6 Oct 2023 21:21:14 +0000 Subject: [PATCH] update apply resources to use regular kubectl apply instead of force --- pkg/clustermanager/cluster_manager.go | 2 +- pkg/clustermanager/cluster_manager_test.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/clustermanager/cluster_manager.go b/pkg/clustermanager/cluster_manager.go index c902156f0956..3da0545a6de0 100644 --- a/pkg/clustermanager/cluster_manager.go +++ b/pkg/clustermanager/cluster_manager.go @@ -1359,7 +1359,7 @@ func (c *ClusterManager) resumeReconcileForCluster(ctx context.Context, clusterC } func (c *ClusterManager) applyResource(ctx context.Context, cluster *types.Cluster, resourcesSpec []byte) error { - err := c.clusterClient.ApplyKubeSpecFromBytesForce(ctx, cluster, resourcesSpec) + err := c.clusterClient.ApplyKubeSpecFromBytes(ctx, cluster, resourcesSpec) if err != nil { return fmt.Errorf("applying eks-a spec: %v", err) } diff --git a/pkg/clustermanager/cluster_manager_test.go b/pkg/clustermanager/cluster_manager_test.go index ba6a4b4b4804..15de861592cb 100644 --- a/pkg/clustermanager/cluster_manager_test.go +++ b/pkg/clustermanager/cluster_manager_test.go @@ -1781,7 +1781,7 @@ func TestClusterManagerCreateEKSAResourcesSuccess(t *testing.T) { c, m := newClusterManager(t) - m.client.EXPECT().ApplyKubeSpecFromBytesForce(ctx, tt.cluster, gomock.Any()) + m.client.EXPECT().ApplyKubeSpecFromBytes(ctx, tt.cluster, gomock.Any()) // ApplyKubeSpecFromBytes is called twice. Once for Bundles and again for EKSARelease. m.client.EXPECT().ApplyKubeSpecFromBytes(ctx, tt.cluster, gomock.Any()).MaxTimes(2) m.client.EXPECT().ApplyKubeSpecFromBytesWithNamespace(ctx, tt.cluster, gomock.Any(), gomock.Any()).MaxTimes(2) @@ -1834,7 +1834,7 @@ func TestClusterManagerCreateEKSAResourcesFailureBundles(t *testing.T) { c := clustermanager.New(cf, client, m.networking, m.writer, m.diagnosticsFactory, m.awsIamAuth, m.eksaComponents) m.client.EXPECT().CreateNamespaceIfNotPresent(ctx, gomock.Any(), tt.clusterSpec.Cluster.Namespace).Return(nil) - m.client.EXPECT().ApplyKubeSpecFromBytesForce(ctx, gomock.Any(), gomock.Any()).Return(nil) + m.client.EXPECT().ApplyKubeSpecFromBytes(ctx, gomock.Any(), gomock.Any()).Return(nil) m.client.EXPECT().ApplyKubeSpecFromBytes(ctx, gomock.Any(), gomock.Any()).Return(errors.New("")) tt.Expect(c.CreateEKSAResources(ctx, tt.cluster, tt.clusterSpec, datacenterConfig, machineConfigs)).NotTo(Succeed()) } @@ -1866,7 +1866,7 @@ func TestClusterManagerCreateEKSAResourcesFailureEKSARelease(t *testing.T) { c := clustermanager.New(cf, client, m.networking, m.writer, m.diagnosticsFactory, m.awsIamAuth, m.eksaComponents) m.client.EXPECT().CreateNamespaceIfNotPresent(ctx, gomock.Any(), tt.clusterSpec.Cluster.Namespace).Return(nil) - m.client.EXPECT().ApplyKubeSpecFromBytesForce(ctx, gomock.Any(), gomock.Any()).Return(nil) + m.client.EXPECT().ApplyKubeSpecFromBytes(ctx, gomock.Any(), gomock.Any()).Return(nil) m.client.EXPECT().ApplyKubeSpecFromBytes(ctx, gomock.Any(), gomock.Any()).Return(nil) m.client.EXPECT().ApplyKubeSpecFromBytes(ctx, gomock.Any(), gomock.Any()).Return(errors.New("")) tt.Expect(c.CreateEKSAResources(ctx, tt.cluster, tt.clusterSpec, datacenterConfig, machineConfigs)).NotTo(Succeed())