Skip to content

Commit

Permalink
Merge pull request #1587 from jsonwan/github_perf/k8s_startup
Browse files Browse the repository at this point in the history
perf: 容器化-支持各微服务按顺序更新 #919
  • Loading branch information
jsonwan authored Dec 5, 2022
2 parents 517ec76 + 695a198 commit 1a71819
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
public class Consts {
// k8s命名空间
public static final String KEY_KUBERNETES_NAMESPACE = "KUBERNETES_NAMESPACE";
// k8s默认命名空间
public static final String VALUE_NAMESPACE_DEFAULT = "default";
// 服务启动依赖关系定义字符串
public static final String KEY_STARTUP_DEPENDENCIES_STR = "BK_JOB_STARTUP_DEPENDENCIES_STR";
// 当前服务名称
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
@Data
public class ServiceDependModel {
@Parameter(names = {"-n", "--namespace"}, description = "当前服务所在的命名空间")
private String namespace = "default";
private String namespace;

@Parameter(names = {"-s", "--service"}, description = "当前服务名称")
private String serviceName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ static ServiceDependModel parseDependModelFromArgsOrEnv(String[] args) {
Consts.KEY_KUBERNETES_NAMESPACE,
namespace
);
if (StringUtils.isBlank(namespace)) {
namespace = Consts.VALUE_NAMESPACE_DEFAULT;
log.warn("use default namespace:{}", namespace);
}
serviceDependModel.setNamespace(namespace);
}
String serviceName = serviceDependModel.getServiceName();
Expand Down

0 comments on commit 1a71819

Please sign in to comment.