Skip to content

Commit

Permalink
Remove unused async package
Browse files Browse the repository at this point in the history
  • Loading branch information
mboersma committed Sep 14, 2023
1 parent af1be1c commit a521b7b
Show file tree
Hide file tree
Showing 36 changed files with 408 additions and 1,686 deletions.
24 changes: 12 additions & 12 deletions azure/services/agentpools/agentpools_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"k8s.io/utils/ptr"
infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1"
"sigs.k8s.io/cluster-api-provider-azure/azure/services/agentpools/mock_agentpools"
"sigs.k8s.io/cluster-api-provider-azure/azure/services/async/mock_async"
"sigs.k8s.io/cluster-api-provider-azure/azure/services/asyncpoller/mock_asyncpoller"
gomockinternal "sigs.k8s.io/cluster-api-provider-azure/internal/test/matchers/gomock"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
)
Expand All @@ -38,12 +38,12 @@ func TestReconcileAgentPools(t *testing.T) {
testcases := []struct {
name string
expectedError string
expect func(s *mock_agentpools.MockAgentPoolScopeMockRecorder, r *mock_async.MockReconcilerMockRecorder)
expect func(s *mock_agentpools.MockAgentPoolScopeMockRecorder, r *mock_asyncpoller.MockReconcilerMockRecorder)
}{
{
name: "agent pool successfully created with autoscaling enabled",
expectedError: "",
expect: func(s *mock_agentpools.MockAgentPoolScopeMockRecorder, r *mock_async.MockReconcilerMockRecorder) {
expect: func(s *mock_agentpools.MockAgentPoolScopeMockRecorder, r *mock_asyncpoller.MockReconcilerMockRecorder) {
fakeAgentPoolSpec := fakeAgentPool()
s.AgentPoolSpec().Return(&fakeAgentPoolSpec)
r.CreateOrUpdateResource(gomockinternal.AContext(), &fakeAgentPoolSpec, serviceName).Return(sdkFakeAgentPool(sdkWithAutoscaling(true), sdkWithCount(1)), nil)
Expand All @@ -55,7 +55,7 @@ func TestReconcileAgentPools(t *testing.T) {
{
name: "agent pool successfully created with autoscaling disabled",
expectedError: "",
expect: func(s *mock_agentpools.MockAgentPoolScopeMockRecorder, r *mock_async.MockReconcilerMockRecorder) {
expect: func(s *mock_agentpools.MockAgentPoolScopeMockRecorder, r *mock_asyncpoller.MockReconcilerMockRecorder) {
fakeAgentPoolSpec := fakeAgentPool()
s.AgentPoolSpec().Return(&fakeAgentPoolSpec)
r.CreateOrUpdateResource(gomockinternal.AContext(), &fakeAgentPoolSpec, serviceName).Return(sdkFakeAgentPool(sdkWithAutoscaling(false), sdkWithCount(1)), nil)
Expand All @@ -67,14 +67,14 @@ func TestReconcileAgentPools(t *testing.T) {
{
name: "no agent pool spec found",
expectedError: "",
expect: func(s *mock_agentpools.MockAgentPoolScopeMockRecorder, r *mock_async.MockReconcilerMockRecorder) {
expect: func(s *mock_agentpools.MockAgentPoolScopeMockRecorder, r *mock_asyncpoller.MockReconcilerMockRecorder) {
s.AgentPoolSpec().Return(nil)
},
},
{
name: "fail to create a agent pool",
expectedError: internalError.Error(),
expect: func(s *mock_agentpools.MockAgentPoolScopeMockRecorder, r *mock_async.MockReconcilerMockRecorder) {
expect: func(s *mock_agentpools.MockAgentPoolScopeMockRecorder, r *mock_asyncpoller.MockReconcilerMockRecorder) {
fakeAgentPoolSpec := fakeAgentPool()
s.AgentPoolSpec().Return(&fakeAgentPoolSpec)
r.CreateOrUpdateResource(gomockinternal.AContext(), &fakeAgentPoolSpec, serviceName).Return(nil, internalError)
Expand All @@ -91,7 +91,7 @@ func TestReconcileAgentPools(t *testing.T) {
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()
scopeMock := mock_agentpools.NewMockAgentPoolScope(mockCtrl)
asyncMock := mock_async.NewMockReconciler(mockCtrl)
asyncMock := mock_asyncpoller.NewMockReconciler(mockCtrl)

tc.expect(scopeMock.EXPECT(), asyncMock.EXPECT())

Expand All @@ -115,12 +115,12 @@ func TestDeleteAgentPools(t *testing.T) {
testcases := []struct {
name string
expectedError string
expect func(s *mock_agentpools.MockAgentPoolScopeMockRecorder, r *mock_async.MockReconcilerMockRecorder)
expect func(s *mock_agentpools.MockAgentPoolScopeMockRecorder, r *mock_asyncpoller.MockReconcilerMockRecorder)
}{
{
name: "existing agent pool successfully deleted",
expectedError: "",
expect: func(s *mock_agentpools.MockAgentPoolScopeMockRecorder, r *mock_async.MockReconcilerMockRecorder) {
expect: func(s *mock_agentpools.MockAgentPoolScopeMockRecorder, r *mock_asyncpoller.MockReconcilerMockRecorder) {
fakeAgentPoolSpec := fakeAgentPool()
s.AgentPoolSpec().Return(&fakeAgentPoolSpec)
r.DeleteResource(gomockinternal.AContext(), &fakeAgentPoolSpec, serviceName).Return(nil)
Expand All @@ -130,14 +130,14 @@ func TestDeleteAgentPools(t *testing.T) {
{
name: "no agent pool spec found",
expectedError: "",
expect: func(s *mock_agentpools.MockAgentPoolScopeMockRecorder, r *mock_async.MockReconcilerMockRecorder) {
expect: func(s *mock_agentpools.MockAgentPoolScopeMockRecorder, r *mock_asyncpoller.MockReconcilerMockRecorder) {
s.AgentPoolSpec().Return(nil)
},
},
{
name: "fail to delete a agent pool",
expectedError: internalError.Error(),
expect: func(s *mock_agentpools.MockAgentPoolScopeMockRecorder, r *mock_async.MockReconcilerMockRecorder) {
expect: func(s *mock_agentpools.MockAgentPoolScopeMockRecorder, r *mock_asyncpoller.MockReconcilerMockRecorder) {
fakeAgentPoolSpec := fakeAgentPool()
s.AgentPoolSpec().Return(&fakeAgentPoolSpec)
r.DeleteResource(gomockinternal.AContext(), &fakeAgentPoolSpec, serviceName).Return(internalError)
Expand All @@ -154,7 +154,7 @@ func TestDeleteAgentPools(t *testing.T) {
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()
scopeMock := mock_agentpools.NewMockAgentPoolScope(mockCtrl)
asyncMock := mock_async.NewMockReconciler(mockCtrl)
asyncMock := mock_asyncpoller.NewMockReconciler(mockCtrl)

tc.expect(scopeMock.EXPECT(), asyncMock.EXPECT())

Expand Down
244 changes: 0 additions & 244 deletions azure/services/async/async.go

This file was deleted.

Loading

0 comments on commit a521b7b

Please sign in to comment.