mirror of https://github.com/alibaba/SREWorks.git
appmanager适配更新
This commit is contained in:
parent
9f9bd97eac
commit
88e76a5637
|
@ -74,8 +74,8 @@ def init_cluster():
|
|||
items = requests.get("%s/clusters" % ENDPOINT, headers=HEADERS).json().get('data', {}).get('items', [])
|
||||
for item in items:
|
||||
cluster_mapping[item['clusterId']] = {
|
||||
'masterUrl': item['clusterConfig']['masterUrl'],
|
||||
'oauthToken': item['clusterConfig']['oauthToken'],
|
||||
'masterUrl': item.get('clusterConfig',{}).get('masterUrl'),
|
||||
'oauthToken': item.get('clusterConfig',{}).get('oauthToken'),
|
||||
}
|
||||
|
||||
# 获取当前的 masterUrl 和 oauthToken 信息
|
||||
|
@ -88,7 +88,7 @@ def init_cluster():
|
|||
for cluster in clusters:
|
||||
if not cluster_mapping.get(cluster):
|
||||
_insert_cluster(cluster, master_url, oauth_token)
|
||||
elif cluster_mapping[cluster]['masterUrl'] != master_url or cluster_mapping[cluster]['oauthToken'] != oauth_token:
|
||||
elif cluster_mapping[cluster].get('masterUrl') != master_url or cluster_mapping[cluster].get('oauthToken') != oauth_token:
|
||||
_update_cluster(cluster, master_url, oauth_token)
|
||||
else:
|
||||
logger.info('no need to update cluster %s' % cluster)
|
||||
|
|
|
@ -2,7 +2,7 @@ FROM maven:3.8.3-adoptopenjdk-11 AS build
|
|||
COPY . /app
|
||||
RUN mkdir /root/.m2/ && curl https://sreworks.oss-cn-beijing.aliyuncs.com/test/settings.xml -o /root/.m2/settings.xml
|
||||
WORKDIR /app
|
||||
RUN mvn -Dmaven.test.skip=true clean package -U -q
|
||||
RUN mvn -Dmaven.test.skip=true clean package -U
|
||||
|
||||
# Release
|
||||
FROM maven:3.8.3-adoptopenjdk-11 AS release
|
||||
|
@ -20,4 +20,4 @@ COPY --from=build /app/${APP_NAME}-start-standalone/target/${APP_NAME}/BOOT-INF/
|
|||
RUN wget -O /app/helm "https://abm-storage.oss-cn-zhangjiakou.aliyuncs.com/lib/helm" && chmod +x /app/helm
|
||||
|
||||
WORKDIR /app
|
||||
ENTRYPOINT ["/app/sbin/run_sreworks.sh"]
|
||||
ENTRYPOINT ["/app/sbin/run_sreworks.sh"]
|
|
@ -82,6 +82,13 @@ public enum DeployComponentStateEnum {
|
|||
return FAILURE;
|
||||
}
|
||||
break;
|
||||
case EXCEPTION:
|
||||
if (DeployComponentEventEnum.OP_RETRY.equals(event)) {
|
||||
return PROCESSING;
|
||||
} else if (DeployComponentEventEnum.OP_TERMINATE.equals(event)) {
|
||||
return FAILURE;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -125,8 +125,7 @@ public class RunningDeployComponentStateAction implements DeployComponentStateAc
|
|||
} catch (Exception e) {
|
||||
response = GetDeployComponentHandlerRes.builder()
|
||||
.status(DeployComponentStateEnum.WAIT_FOR_OP)
|
||||
.message(String.format("get component status failed|request=%s|exception=%s",
|
||||
JSONObject.toJSONString(request), ExceptionUtils.getStackTrace(e)))
|
||||
.message(String.format("deploy components failed|errorMessage=%s", ExceptionUtils.getStackTrace(e)))
|
||||
.build();
|
||||
}
|
||||
switch (response.getStatus()) {
|
||||
|
|
Loading…
Reference in New Issue