Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unsecure username and password conn configuration #125

Merged
merged 1 commit into from
Mar 26, 2024
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
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ E2E test suite for opendatahub using fabric8 kubernetes client

## Environment variables
* **ENV_FILE** - path to yaml file with env variables values
* **KUBE_USERNAME** - user of the cluster
* **KUBE_PASSWORD** - password of kube user
* **KUBE_TOKEN** - token of kube access (use instead of username/password)
* **KUBE_URL** - url of the cluster (api url)
* **PRODUCT** - odh or rhoai
Expand Down
3 changes: 2 additions & 1 deletion docs/md/io/odh/test/e2e/standard/UninstallST.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
| - | - | - |
| 1. | Create uninstall configmap | ConfigMap exists |
| 2. | Wait for controllers namespace deletion | Controllers namespace is deleted |
| 3. | Remove Operator namespace | Operator namespace is deleted |
| 3. | Check that relevant resources are deleted (Subscription, InstallPlan, CSV) | All relevant resources are deleted |
| 4. | Check that all related namespaces are deleted (monitoring, notebooks, controllers) | All related namespaces are deleted |
| 5. | Remove Operator namespace | Operator namespace is deleted |

4 changes: 0 additions & 4 deletions src/main/java/io/odh/test/Environment.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ public class Environment {
public static final String USER_PATH = System.getProperty("user.dir");

private static final String CONFIG_FILE_PATH_ENV = "ENV_FILE";
private static final String USERNAME_ENV = "KUBE_USERNAME";
private static final String PASSWORD_ENV = "KUBE_PASSWORD";
private static final String TOKEN_ENV = "KUBE_TOKEN";
private static final String URL_ENV = "KUBE_URL";
private static final String PRODUCT_ENV = "PRODUCT";
Expand Down Expand Up @@ -77,8 +75,6 @@ public class Environment {
*/
public static final String PRODUCT = getOrDefault(PRODUCT_ENV, PRODUCT_ODH);
public static final String RUN_USER = getOrDefault("USER", null);
public static final String KUBE_USERNAME = getOrDefault(USERNAME_ENV, null);
public static final String KUBE_PASSWORD = getOrDefault(PASSWORD_ENV, null);
public static final String KUBE_TOKEN = getOrDefault(TOKEN_ENV, null);
public static final String KUBE_URL = getOrDefault(URL_ENV, null);

Expand Down
18 changes: 1 addition & 17 deletions src/main/java/io/odh/test/platform/KubeClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,7 @@ public KubeClient inNamespace(String namespace) {
}

private Config getConfig() {
if (Environment.KUBE_USERNAME != null
&& Environment.KUBE_PASSWORD != null
&& Environment.KUBE_URL != null) {
Exec.exec(Arrays.asList("oc", "login", "-u", Environment.KUBE_USERNAME,
"-p", Environment.KUBE_PASSWORD,
"--insecure-skip-tls-verify",
"--kubeconfig", Environment.USER_PATH + "/test.kubeconfig",
Environment.KUBE_URL));
kubeconfigPath = Environment.USER_PATH + "/test.kubeconfig";
return new ConfigBuilder()
.withUsername(Environment.KUBE_USERNAME)
.withPassword(Environment.KUBE_PASSWORD)
.withMasterUrl(Environment.KUBE_URL)
.withDisableHostnameVerification(true)
.withTrustCerts(true)
.build();
} else if (Environment.KUBE_URL != null
if (Environment.KUBE_URL != null
&& Environment.KUBE_TOKEN != null) {
Exec.exec(Arrays.asList("oc", "login", "--token", Environment.KUBE_TOKEN,
"--insecure-skip-tls-verify",
Expand Down
Loading