-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
121 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
lib/src/main/java/com/scalar/admin/kubernetes/TlsPauser.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.scalar.admin.kubernetes; | ||
|
||
import com.scalar.admin.RequestCoordinator; | ||
import com.scalar.admin.TlsRequestCoordinator; | ||
import java.net.InetSocketAddress; | ||
import java.util.stream.Collectors; | ||
import javax.annotation.Nullable; | ||
|
||
public class TlsPauser extends Pauser { | ||
|
||
private final String caRootCert; | ||
private final String overrideAuthority; | ||
|
||
public TlsPauser( | ||
String namespace, | ||
String helmReleaseName, | ||
@Nullable String caRootCert, | ||
@Nullable String overrideAuthority) | ||
throws PauserException { | ||
super(namespace, helmReleaseName); | ||
|
||
this.caRootCert = caRootCert; | ||
this.overrideAuthority = overrideAuthority; | ||
} | ||
|
||
@Override | ||
RequestCoordinator getRequestCoordinator(TargetSnapshot target) { | ||
return new TlsRequestCoordinator( | ||
target.getPods().stream() | ||
.map(p -> new InetSocketAddress(p.getStatus().getPodIP(), target.getAdminPort())) | ||
.collect(Collectors.toList()), | ||
caRootCert, | ||
overrideAuthority); | ||
} | ||
} |