From 397f800614f8f3ae6a43a32d562e4dd1b5e62b8e Mon Sep 17 00:00:00 2001 From: Lai Jiang Date: Mon, 24 Feb 2025 14:01:05 -0500 Subject: [PATCH] Connect to GKE by default from the tool (#2686) --- .../google/registry/tools/RegistryCli.java | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/core/src/main/java/google/registry/tools/RegistryCli.java b/core/src/main/java/google/registry/tools/RegistryCli.java index da5f03386..7a00a103c 100644 --- a/core/src/main/java/google/registry/tools/RegistryCli.java +++ b/core/src/main/java/google/registry/tools/RegistryCli.java @@ -25,7 +25,6 @@ import com.beust.jcommander.Parameters; import com.beust.jcommander.ParametersDelegate; import com.google.common.base.Throwables; import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; import google.registry.persistence.transaction.JpaTransactionManager; import google.registry.persistence.transaction.TransactionManagerFactory; @@ -42,13 +41,6 @@ import org.postgresql.util.PSQLException; @Parameters(separators = " =", commandDescription = "Command-line interface to the registry") final class RegistryCli implements CommandRunner { - private static final ImmutableSet DEFAULT_GKE_ENVIRONMENTS = - ImmutableSet.of( - RegistryToolEnvironment.ALPHA, - RegistryToolEnvironment.CRASH, - RegistryToolEnvironment.QA, - RegistryToolEnvironment.SANDBOX); - // The environment parameter is parsed twice: once here, and once with {@link // RegistryToolEnvironment#parseFromArgs} in the {@link RegistryTool#main} function. // @@ -78,9 +70,6 @@ final class RegistryCli implements CommandRunner { + "Beam pipelines") private String sqlAccessInfoFile = null; - @Parameter(names = "--gke", description = "Whether to use GKE runtime, instead of GAE") - private boolean useGke = false; - @Parameter(names = "--gae", description = "Whether to use GAE runtime, instead of GKE") private boolean useGae = false; @@ -161,12 +150,6 @@ final class RegistryCli implements CommandRunner { throw e; } - checkState(!useGke || !useGae, "Cannot specify both --gke and --gae"); - // Special logic to set the default based on the environment if neither --gae nor --gke is set. - if (!useGke && !useGae) { - useGke = DEFAULT_GKE_ENVIRONMENTS.contains(environment); - } - String parsedCommand = jcommander.getParsedCommand(); // Show the list of all commands either if requested or if no subcommand name was specified // (which does not throw a ParameterException parse error above). @@ -186,7 +169,7 @@ final class RegistryCli implements CommandRunner { DaggerRegistryToolComponent.builder() .credentialFilePath(credentialJson) .sqlAccessInfoFile(sqlAccessInfoFile) - .useGke(useGke) + .useGke(!useGae) .useCanary(useCanary) .build();