Skip to content

Commit

Permalink
deployment rename
Browse files Browse the repository at this point in the history
  • Loading branch information
sssash18 committed Nov 23, 2023
1 parent 3e01a46 commit 2d40729
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions cluster-autoscaler/cloudprovider/mcm/mcm_cloud_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ type setup struct {
machines []*v1alpha1.Machine
machineSets []*v1alpha1.MachineSet
machineDeployments []*v1alpha1.MachineDeployment
deployments *v1.Deployment
mcmDeployment *v1.Deployment
machineClasses []*v1alpha1.MachineClass
nodeGroups []string
targetCoreFakeResourceActions *customfake.ResourceActions
Expand Down Expand Up @@ -82,8 +82,8 @@ func setupEnv(setup *setup) ([]runtime.Object, []runtime.Object, []runtime.Objec

var appsControlObjects []runtime.Object

if setup.deployments != nil {
appsControlObjects = append(appsControlObjects, setup.deployments)
if setup.mcmDeployment != nil {
appsControlObjects = append(appsControlObjects, setup.mcmDeployment)
}

return controlMachineObjects, targetCoreObjects, appsControlObjects
Expand Down Expand Up @@ -356,7 +356,7 @@ func TestRefresh(t *testing.T) {
machines: newMachines(1, "fakeID", nil, "machinedeployment-1", "machineset-1", []string{"1"}, []bool{false}),
machineDeployments: newMachineDeployments(1, 1, nil, nil, nil),
nodeGroups: []string{nodeGroup2},
deployments: newMCMDeployment(0),
mcmDeployment: newMCMDeployment(0),
},
expect{
err: fmt.Errorf("machine-controller-manager is offline. Cluster autoscaler operations would be suspended."),
Expand All @@ -383,7 +383,7 @@ func TestRefresh(t *testing.T) {
machines: newMachines(1, "fakeID", nil, "machinedeployment-1", "machineset-1", []string{"1"}, []bool{false}),
machineDeployments: newMachineDeployments(1, 1, nil, nil, nil),
nodeGroups: []string{nodeGroup2},
deployments: newMCMDeployment(1),
mcmDeployment: newMCMDeployment(1),
},
expect{
machines: newMachines(1, "fakeID", nil, "machinedeployment-1", "machineset-1", []string{"3"}, []bool{false}),
Expand All @@ -397,7 +397,7 @@ func TestRefresh(t *testing.T) {
machines: newMachines(1, "fakeID", nil, "machinedeployment-1", "machineset-1", []string{"1"}, []bool{false}),
machineDeployments: newMachineDeployments(1, 1, nil, nil, nil),
nodeGroups: []string{nodeGroup2},
deployments: newMCMDeployment(1),
mcmDeployment: newMCMDeployment(1),
},
expect{
machines: newMachines(1, "fakeID", nil, "machinedeployment-1", "machineset-1", []string{"1"}, []bool{false}),
Expand All @@ -415,8 +415,8 @@ func TestRefresh(t *testing.T) {
Update: customfake.CreateFakeResponse(math.MaxInt32, mcUpdateErrorMsg, 0),
},
},
nodeGroups: []string{nodeGroup2},
deployments: newMCMDeployment(1),
nodeGroups: []string{nodeGroup2},
mcmDeployment: newMCMDeployment(1),
},
expect{
machines: []*v1alpha1.Machine{newMachine("machine-1", "fakeID-1", nil, "machinedeployment-1", "machineset-1", "1", false, true)},
Expand Down
2 changes: 1 addition & 1 deletion cluster-autoscaler/cloudprovider/mcm/mcm_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func createMCMManagerInternal(discoveryOpts cloudprovider.NodeGroupDiscoveryOpti

controlAppsClient := controlClientBuilder.ClientOrDie("control-apps-client")
selector := fields.Everything()
deploymentListWatch := cache.NewListWatchFromClient(controlAppsClient.AppsV1().RESTClient(), "deployments", namespace, selector)
deploymentListWatch := cache.NewListWatchFromClient(controlAppsClient.AppsV1().RESTClient(), "mcmDeployment", namespace, selector)
store, reflector := cache.NewNamespaceKeyedIndexerAndReflector(deploymentListWatch, &appsv1.Deployment{}, time.Hour)
deploymentLister := v1appslister.NewDeploymentLister(store)
stopCh := make(chan struct{})
Expand Down

0 comments on commit 2d40729

Please sign in to comment.