Skip to content

Commit

Permalink
Use ocp token instead of password
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Stejskal <[email protected]>
  • Loading branch information
Frawless committed Nov 13, 2023
1 parent 4609fab commit 54ce80a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/main/java/io/tealc/ClusterManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static synchronized ClusterManager getInstance() {

Config config = new ConfigBuilder()
.withUsername(Environment.WORKER_01_USERNAME)
.withPassword(Environment.WORKER_01_PASSWORD)
.withOauthToken(Environment.WORKER_01_TOKEN)
.withMasterUrl(Environment.WORKER_01_URL)
.withDisableHostnameVerification(true)
.withTrustCerts(true)
Expand All @@ -32,7 +32,7 @@ public static synchronized ClusterManager getInstance() {

config = new ConfigBuilder()
.withUsername(Environment.WORKER_02_USERNAME)
.withPassword(Environment.WORKER_02_PASSWORD)
.withOauthToken(Environment.WORKER_02_TOKEN)
.withMasterUrl(Environment.WORKER_02_URL)
.withDisableHostnameVerification(true)
.withTrustCerts(true)
Expand All @@ -42,7 +42,7 @@ public static synchronized ClusterManager getInstance() {

config = new ConfigBuilder()
.withUsername(Environment.WORKER_03_USERNAME)
.withPassword(Environment.WORKER_03_PASSWORD)
.withOauthToken(Environment.WORKER_03_TOKEN)
.withMasterUrl(Environment.WORKER_03_URL)
.withDisableHostnameVerification(true)
.withTrustCerts(true)
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/io/tealc/Environment.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,26 @@ public class Environment {
private static final Map<String, String> VALUES = new HashMap<>();

public static final String WORKER_01_USERNAME_ENV = "WORKER_01_USERNAME";
public static final String WORKER_01_PASSWORD_ENV = "WORKER_01_PASSWORD";
public static final String WORKER_01_TOKEN_ENV = "WORKER_01_OCP_TOKEN";
public static final String WORKER_01_URL_ENV = "WORKER_01_URL";
public static final String WORKER_02_USERNAME_ENV = "WORKER_02_USERNAME";
public static final String WORKER_02_PASSWORD_ENV = "WORKER_02_PASSWORD";
public static final String WORKER_02_TOKEN_ENV = "WORKER_02_OCP_TOKEN";
public static final String WORKER_02_URL_ENV = "WORKER_02_URL";
public static final String WORKER_03_USERNAME_ENV = "WORKER_03_USERNAME";
public static final String WORKER_03_PASSWORD_ENV = "WORKER_03_PASSWORD";
public static final String WORKER_03_TOKEN_ENV = "WORKER_03_OCP_TOKEN";
public static final String WORKER_03_URL_ENV = "WORKER_03_URL";

/**
* Set values
*/
public static final String WORKER_01_USERNAME = getOrDefault(WORKER_01_USERNAME_ENV, null);
public static final String WORKER_01_PASSWORD = getOrDefault(WORKER_01_PASSWORD_ENV, null);
public static final String WORKER_01_TOKEN = getOrDefault(WORKER_01_TOKEN_ENV, null);
public static final String WORKER_01_URL = getOrDefault(WORKER_01_URL_ENV, null);
public static final String WORKER_02_USERNAME = getOrDefault(WORKER_02_USERNAME_ENV, null);
public static final String WORKER_02_PASSWORD = getOrDefault(WORKER_02_PASSWORD_ENV, null);
public static final String WORKER_02_TOKEN = getOrDefault(WORKER_02_TOKEN_ENV, null);
public static final String WORKER_02_URL = getOrDefault(WORKER_02_URL_ENV, null);
public static final String WORKER_03_USERNAME = getOrDefault(WORKER_03_USERNAME_ENV, null);
public static final String WORKER_03_PASSWORD = getOrDefault(WORKER_03_PASSWORD_ENV, null);
public static final String WORKER_03_TOKEN = getOrDefault(WORKER_03_TOKEN_ENV, null);
public static final String WORKER_03_URL = getOrDefault(WORKER_03_URL_ENV, null);

private Environment() { }
Expand Down

0 comments on commit 54ce80a

Please sign in to comment.