|
@@ -9,14 +9,13 @@ import io.kubernetes.client.models.V1Status;
|
|
|
import nju.seec.SEECdemo.logic.api.k8s.LimitRangeApi;
|
|
import nju.seec.SEECdemo.logic.api.k8s.LimitRangeApi;
|
|
|
import nju.seec.SEECdemo.logic.api.k8s.exception.K8sApiException;
|
|
import nju.seec.SEECdemo.logic.api.k8s.exception.K8sApiException;
|
|
|
import nju.seec.SEECdemo.logic.api.k8s.model.LimitRange;
|
|
import nju.seec.SEECdemo.logic.api.k8s.model.LimitRange;
|
|
|
-import nju.seec.SEECdemo.logic.api.k8s.vo.LimitRangeVO;
|
|
|
|
|
import nju.seec.SEECdemo.util.LoggerUtil;
|
|
import nju.seec.SEECdemo.util.LoggerUtil;
|
|
|
|
|
+import org.slf4j.Logger;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
|
|
|
|
|
|
|
import static nju.seec.SEECdemo.util.Constants.PRETTY_FORMAT;
|
|
import static nju.seec.SEECdemo.util.Constants.PRETTY_FORMAT;
|
|
|
|
|
|
|
@@ -24,6 +23,8 @@ import static nju.seec.SEECdemo.util.Constants.PRETTY_FORMAT;
|
|
|
@Service
|
|
@Service
|
|
|
public class LimitRangeApiImpl implements LimitRangeApi {
|
|
public class LimitRangeApiImpl implements LimitRangeApi {
|
|
|
|
|
|
|
|
|
|
+ private static final Logger logger = LoggerUtil.getLogger(LimitRangeApiImpl.class);
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private CoreV1Api coreV1Api;
|
|
private CoreV1Api coreV1Api;
|
|
|
|
|
|
|
@@ -95,6 +96,8 @@ public class LimitRangeApiImpl implements LimitRangeApi {
|
|
|
//namespace NotFound 404
|
|
//namespace NotFound 404
|
|
|
//Already Exist 409
|
|
//Already Exist 409
|
|
|
//422 if default value greater than max value, or min value greater than defaultRequest value
|
|
//422 if default value greater than max value, or min value greater than defaultRequest value
|
|
|
|
|
+ LoggerUtil.error(logger, e, "创建LimitRange失败, namespace={}, limitRange={}, response={}",
|
|
|
|
|
+ namespace, body, e.getResponseBody());
|
|
|
switch (e.getCode()) {
|
|
switch (e.getCode()) {
|
|
|
case K8sApiException.NOT_FOUND:
|
|
case K8sApiException.NOT_FOUND:
|
|
|
throw new K8sApiException(K8sApiException.NOT_FOUND);
|
|
throw new K8sApiException(K8sApiException.NOT_FOUND);
|