@Override
    public boolean scale(ApiClient apiClient, V1Deployment v1Deployment, String namespace, int value) throws HyscaleException {
        if (v1Deployment == null) {
            LOGGER.error("Cannot scale 'null' deployment");
            return false;
        }
        String name = v1Deployment.getMetadata().getName();
        int currentReplicas = v1Deployment.getSpec().getReplicas();
        String lastAppliedConfig = v1Deployment.getMetadata().getAnnotations()
                .get(AnnotationKey.K8S_HYSCALE_LAST_APPLIED_CONFIGURATION.getAnnotation());
        V1Deployment lastAppliedDeployment = GsonProviderUtil.getPrettyGsonBuilder().fromJson(lastAppliedConfig, V1Deployment.class);
        ActivityContext activityContext = new ActivityContext(DeployerActivity.SCALING_SERVICE);
        WorkflowLogger.startActivity(activityContext);
        boolean status = false;
        try {
            if (!(currentReplicas == value && lastAppliedDeployment.getSpec().getReplicas() == value)) {
                lastAppliedDeployment.getSpec().setReplicas(value);
                patch(apiClient, name, namespace, lastAppliedDeployment);
            }
            status = waitForDesiredState(apiClient, name, namespace, activityContext);
        } catch (HyscaleException e) {
            LOGGER.error("Error while applying PATCH scale to {} due to : {} code :{}", name, e.getMessage(), e.getCode(), e);
            HyscaleException ex = new HyscaleException(DeployerErrorCodes.ERROR_WHILE_SCALING, e.getMessage());
            throw ex;
        } finally {
            if (status) {
                WorkflowLogger.endActivity(activityContext, Status.DONE);
            } else {
                WorkflowLogger.endActivity(activityContext, Status.FAILED);
            }
        }
        return status;
    }
@param deploymentList
@return list of service names from label of deployment
deployer/deployer-services/src/main/java/io/hyscale/deployer/services/handler/impl/V1DeploymentHandler.java