5656import org .apache .cloudstack .acl .RoleType ;
5757import org .apache .cloudstack .acl .Rule ;
5858import org .apache .cloudstack .acl .SecurityChecker ;
59- import org .apache .cloudstack .affinity .AffinityGroupProcessor ;
60- import org .apache .cloudstack .affinity .AffinityGroupService ;
6159import org .apache .cloudstack .affinity .AffinityGroupVO ;
6260import org .apache .cloudstack .affinity .AffinityProcessorBase ;
6361import org .apache .cloudstack .affinity .dao .AffinityGroupDao ;
@@ -337,8 +335,6 @@ public class KubernetesClusterManagerImpl extends ManagerBase implements Kuberne
337335 @ Inject
338336 protected AffinityGroupDao affinityGroupDao ;
339337 @ Inject
340- protected AffinityGroupService affinityGroupService ;
341- @ Inject
342338 protected AffinityGroupVMMapDao affinityGroupVMMapDao ;
343339 @ Inject
344340 protected ServiceOfferingDao serviceOfferingDao ;
@@ -2565,11 +2561,6 @@ protected Set<Long> getExistingWorkerHostIds(KubernetesCluster cluster) {
25652561
25662562 protected void validateNodesAgainstExistingWorkers (List <Long > nodeIds , Set <Long > existingWorkerHostIds ,
25672563 AffinityGroupVO affinityGroup , KubernetesCluster cluster ) {
2568- AffinityGroupProcessor processor = getAffinityGroupProcessor (affinityGroup .getType ());
2569- if (Objects .isNull (processor )) {
2570- return ;
2571- }
2572-
25732564 for (Long nodeId : nodeIds ) {
25742565 VMInstanceVO node = vmInstanceDao .findById (nodeId );
25752566 if (node == null || node .getHostId () == null ) {
@@ -2602,8 +2593,7 @@ protected void validateNodesAgainstExistingWorkers(List<Long> nodeIds, Set<Long>
26022593 }
26032594
26042595 protected void validateNewNodesAntiAffinity (List <Long > nodeIds , AffinityGroupVO affinityGroup , KubernetesCluster cluster ) {
2605- AffinityGroupProcessor processor = getAffinityGroupProcessor (affinityGroup .getType ());
2606- if (processor == null || !AffinityProcessorBase .AFFINITY_TYPE_HOST_ANTI .equals (affinityGroup .getType ())) {
2596+ if (!AffinityProcessorBase .AFFINITY_TYPE_HOST_ANTI .equals (affinityGroup .getType ())) {
26072597 return ;
26082598 }
26092599
@@ -2624,14 +2614,6 @@ protected void validateNewNodesAntiAffinity(List<Long> nodeIds, AffinityGroupVO
26242614 }
26252615 }
26262616
2627- protected AffinityGroupProcessor getAffinityGroupProcessor (String affinityGroupType ) {
2628- Map <String , AffinityGroupProcessor > typeProcessorMap = affinityGroupService .getAffinityTypeToProcessorMap ();
2629- if (MapUtils .isEmpty (typeProcessorMap )) {
2630- return null ;
2631- }
2632- return typeProcessorMap .get (affinityGroupType );
2633- }
2634-
26352617 protected String getHostName (Long hostId ) {
26362618 HostVO host = hostDao .findById (hostId );
26372619 return host != null ? host .getName () : String .valueOf (hostId );
0 commit comments