Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ public class AwsKubeConfigProvider implements KubeConfigProvider {
@Value("${spider.port}")
private String spiderPort;

@Value("${spider.checkhost}")
private List<String> spiderChekdHosts;


@Override
public Config buildConfig(K8sClusterDto dto) {
String yaml = dto.getAccessInfo().getKubeconfig();
Config cfg = Config.fromKubeconfig(KubeConfigProviderFactory.replaceUrlHostByPort(yaml, spiderPort, List.of("localhost"), spiderUrl));
Config cfg = Config.fromKubeconfig(KubeConfigProviderFactory.replaceUrlHostByPort(yaml, spiderPort, spiderChekdHosts, spiderUrl));
cfg.setTrustCerts(true);
cfg.setConnectionTimeout(30_000);
cfg.setRequestTimeout(30_000);
Expand All @@ -52,7 +56,7 @@ public String getOriginalKubeconfigYaml(K8sClusterDto dto) {
throw new IllegalStateException("Kubeconfig is null or empty for Azure cluster: " + dto.getName());
}

return KubeConfigProviderFactory.replaceUrlHostByPort(kubeconfig, spiderPort, List.of("localhost"), spiderUrl);
return KubeConfigProviderFactory.replaceUrlHostByPort(kubeconfig, spiderPort, spiderChekdHosts, spiderUrl);
}

}
1 change: 1 addition & 0 deletions src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ cbtumblebug:
spider:
url: ${SPIDER_URL:210.217.178.130}
port: ${SPIDER_PORT:1024}
checkhost: localhost,127.0.0.1,0.0.0.0

nexus:
url: ${NEXUS_URL:nexus-repository}
Expand Down
Loading