DaanHoogland commented on code in PR #7515:
URL: https://github.com/apache/cloudstack/pull/7515#discussion_r1205062619
##########
plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/cluster/KubernetesClusterManagerImpl.java:
##########
@@ -960,6 +1023,9 @@ private void
validateKubernetesClusterUpgradeParameters(UpgradeKubernetesCluster
if (kubernetesCluster == null || kubernetesCluster.getRemoved() !=
null) {
throw new InvalidParameterValueException("Invalid Kubernetes
cluster ID");
}
+ if (!kubernetesCluster.getManaged()) {
+ throw new InvalidParameterValueException(String.format("Kubernetes
cluster : %s is not managed by Apache CloudStack",
kubernetesCluster.getName()));
+ }
Review Comment:
repetition of the prior block
##########
plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/cluster/KubernetesClusterManagerImpl.java:
##########
@@ -832,6 +892,9 @@ private void
validateKubernetesClusterScaleParameters(ScaleKubernetesClusterCmd
Account caller = CallContext.current().getCallingAccount();
accountManager.checkAccess(caller,
SecurityChecker.AccessType.OperateEntry, false, kubernetesCluster);
+ if (!kubernetesCluster.getManaged()) {
+ throw new InvalidParameterValueException(String.format("Kubernetes
cluster %s is not managed by Apache CloudStack", kubernetesCluster.getName()));
+ }
Review Comment:
the exact same bit of code is used to throw the exact same exception later
on. please extract to a method or chencge the messages.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]