Repository: apigee/registry (go)

Issue:
Registry tool: Let's drop the `APG_` prefix from environment variables.
This vestigal configuration came from the automatically-generated CLI, which we've since replaced with `registry config` subcommands. As discussed in #1107, if we remove the `APG_` prefix, then we can use `REGISTRY_ADDRESS`, etc. to configure the `registry` and related tools in containers (and anywhere).

Pull request:
drop the APG_ prefix from env vars
Fixes #1113
See also #1107


Patch:
diff --git a/auth/HOSTED.bat b/auth/HOSTED.bat
index 5b4d741..cc3201b 100755
--- a/auth/HOSTED.bat
+++ b/auth/HOSTED.bat
@@ -32,20 +32,20 @@ goto :eof
 setlocal
 
 :: set the service address.
-set APG_REGISTRY_ADDRESS=apigeeregistry.googleapis.com:443
-set APG_REGISTRY_INSECURE=false
+set REGISTRY_ADDRESS=apigeeregistry.googleapis.com:443
+set REGISTRY_INSECURE=false
 
-FOR /F %%g IN ('gcloud config get project') DO set APG_REGISTRY_PROJECT=%%g
-set APG_REGISTRY_LOCATION=global
+FOR /F %%g IN ('gcloud config get project') DO set REGISTRY_PROJECT=%%g
+set REGISTRY_LOCATION=global
 FOR /F %%g IN ('gcloud config get account') DO set CLIENT_EMAIL=%%g
-set APG_REGISTRY_TOKEN_SOURCE=gcloud auth print-access-token %CLIENT_EMAIL%
+set REGISTRY_TOKEN_SOURCE=gcloud auth print-access-token %CLIENT_EMAIL%
 
 registry config configurations create hosted ^
-  --registry.insecure=%APG_REGISTRY_INSECURE% ^
-  --registry.address=%APG_REGISTRY_ADDRESS% ^
-  --registry.project=%APG_REGISTRY_PROJECT% ^
-  --registry.location=%APG_REGISTRY_LOCATION%
+  --registry.insecure=%REGISTRY_INSECURE% ^
+  --registry.address=%REGISTRY_ADDRESS% ^
+  --registry.project=%REGISTRY_PROJECT% ^
+  --registry.location=%REGISTRY_LOCATION%
 
-registry config set token-source "%APG_REGISTRY_TOKEN_SOURCE%"
+registry config set token-source "%REGISTRY_TOKEN_SOURCE%"
 
 endlocal
diff --git a/auth/HOSTED.sh b/auth/HOSTED.sh
index 2d4bb07..6e86d4c 100755
--- a/auth/HOSTED.sh
+++ b/auth/HOSTED.sh
@@ -31,18 +31,18 @@ if ! [ -x "$(command -v gcloud)" ]; then
 fi
 
 # Set the service address.
-APG_REGISTRY_ADDRESS="apigeeregistry.googleapis.com:443"
-APG_REGISTRY_INSECURE="false"
+REGISTRY_ADDRESS="apigeeregistry.googleapis.com:443"
+REGISTRY_INSECURE="false"
 
-APG_REGISTRY_PROJECT="$(gcloud config get project)"
-APG_REGISTRY_LOCATION="global"
-APG_REGISTRY_CLIENT_EMAIL="$(gcloud auth list --filter=status:ACTIVE --format="value(account)")"
-APG_REGISTRY_TOKEN_SOURCE="gcloud auth print-access-token ${APG_REGISTRY_CLIENT_EMAIL}"
+REGISTRY_PROJECT="$(gcloud config get project)"
+REGISTRY_LOCATION="global"
+REGISTRY_CLIENT_EMAIL="$(gcloud auth list --filter=status:ACTIVE --format="value(account)")"
+REGISTRY_TOKEN_SOURCE="gcloud auth print-access-token ${REGISTRY_CLIENT_EMAIL}"
 
 registry config configurations create hosted \
-  --registry.insecure="${APG_REGISTRY_INSECURE}" \
-  --registry.address="${APG_REGISTRY_ADDRESS}" \
-  --registry.project="${APG_REGISTRY_PROJECT}" \
-  --registry.location="${APG_REGISTRY_LOCATION}" 
+  --registry.insecure="${REGISTRY_INSECURE}" \
+  --registry.address="${REGISTRY_ADDRESS}" \
+  --registry.project="${REGISTRY_PROJECT}" \
+  --registry.location="${REGISTRY_LOCATION}" 
   
-registry config set token-source "${APG_REGISTRY_TOKEN_SOURCE}"
+registry config set token-source "${REGISTRY_TOKEN_SOURCE}"
diff --git a/auth/LOCAL.sh b/auth/LOCAL.sh
index a3958f7..519bf7d 100755
--- a/auth/LOCAL.sh
+++ b/auth/LOCAL.sh
@@ -20,14 +20,14 @@
 #
 
 # Be sure that the port setting below is correct. 8080 is the default.
-APG_REGISTRY_ADDRESS="localhost:8080"
+REGISTRY_ADDRESS="localhost:8080"
 
 # Local calls don't use TLS.
-APG_REGISTRY_INSECURE="true"
+REGISTRY_INSECURE="true"
 
-APG_REGISTRY_LOCATION="global"
+REGISTRY_LOCATION="global"
 
 registry config configurations create local \
-  --registry.insecure="${APG_REGISTRY_INSECURE}" \
-  --registry.address="${APG_REGISTRY_ADDRESS}" \
-  --registry.location="${APG_REGISTRY_LOCATION}"
+  --registry.insecure="${REGISTRY_INSECURE}" \
+  --registry.address="${REGISTRY_ADDRESS}" \
+  --registry.location="${REGISTRY_LOCATION}"
diff --git a/cmd/registry/README.md b/cmd/registry/README.md
index 6c25ac7..a49df32 100644
--- a/cmd/registry/README.md
+++ b/cmd/registry/README.md
@@ -6,8 +6,8 @@ subcommands that call methods of the Registry API.
 
 ## Usage
 
-Run `registry help` for general information and `registry help [subcommand]`
-for details on any subcommand.
+Run `registry help` for general information and `registry help [subcommand]` for
+details on any subcommand.
 
 ## Configuration
 
@@ -52,8 +52,7 @@ gcloud config set project $PROJECT_ID
 ```
 
 4. Run the following script to get an authorization token and set it in your
-   environment as `$APG_REGISTRY_TOKEN` (on Windows, please use
-   `auth/HOSTED.bat`):
+   environment as `$REGISTRY_TOKEN` (on Windows, please use `auth/HOSTED.bat`):
 
 ```
 . auth/HOSTED.sh
@@ -90,8 +89,8 @@ that is likely to become a recommended way to populate an API registry.
   registry upload openapi APIs --project-id $PROJECT_ID
   ```
 
-  Here `APIs` is a directory in the repo and `$PROJECT_ID` should be set to
-  your registry project id.
+  Here `APIs` is a directory in the repo and `$PROJECT_ID` should be set to your
+  registry project id.
 
 - `registry upload protos` reads Protocol Buffer API descriptions from a
   directory that follows the style of the
diff --git a/deployments/envoy/README.md b/deployments/envoy/README.md
index b54ba24..16a18b6 100644
--- a/deployments/envoy/README.md
+++ b/deployments/envoy/README.md
@@ -19,12 +19,12 @@ Following steps assume you're in the root directory.
    - To create an external LB, run `make deploy-gke`
    - To create an internal LB, run `make deploy-gke LB=internal`
 
-1. Setup the client authentication. This step differs based on the load
-   balancer type you chose in the previous step:
+1. Setup the client authentication. This step differs based on the load balancer
+   type you chose in the previous step:
 
    - External LB: run `. auth/GKE.sh`.
-   - Internal LB: Usually you can't access services that are behind the
-     internal LB from your local. For more details, please check
+   - Internal LB: Usually you can't access services that are behind the internal
+     LB from your local. For more details, please check
      [here](https://cloud.google.com/kubernetes-engine/docs/how-to/internal-load-balancing#inspect).
 
      1. Find the ingress IP:
@@ -32,13 +32,13 @@ Following steps assume you're in the root directory.
      1. Find the service port:
         `kubectl get service registry-backend -o jsonpath="{.spec.ports[0].port}"`
      1. SSH into a VM.
-     1. Run the following commands with `ingress_ip` found in the first step
-        and `service_port` found in the second step:
+     1. Run the following commands with `ingress_ip` found in the first step and
+        `service_port` found in the second step:
 
         ```shell script
-        export APG_REGISTRY_ADDRESS="<ingress_ip>:<service_port>"
-        export APG_REGISTRY_CLIENT_EMAIL=$(gcloud config list account --format "value(core.account)")
-        export APG_REGISTRY_TOKEN=$(gcloud auth print-identity-token ${APG_REGISTRY_CLIENT_EMAIL})
+        export REGISTRY_ADDRESS="<ingress_ip>:<service_port>"
+        export REGISTRY_CLIENT_EMAIL=$(gcloud config list account --format "value(core.account)")
+        export REGISTRY_TOKEN=$(gcloud auth print-identity-token ${REGISTRY_CLIENT_EMAIL})
         ```
 
 1. Verify the server. The GKE deployment uses
@@ -47,5 +47,5 @@ Following steps assume you're in the root directory.
    you configured. Below is a sample curl call to access your GKE deployment:
 
    ```shell script
-   curl $APG_REGISTRY_ADDRESS/v1/status -i -H "Authorization: Bearer $APG_REGISTRY_TOKEN"
+   curl $REGISTRY_ADDRESS/v1/status -i -H "Authorization: Bearer $REGISTRY_TOKEN"
    ```
diff --git a/pkg/config/config.go b/pkg/config/config.go
index 4123027..bf02684 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -44,7 +44,6 @@ var (
 	ErrReservedConfigName = fmt.Errorf("%q is reserved", ActivePointerFilename)
 
 	envBindings    = []string{"registry.address", "registry.insecure", "registry.token"}
-	envPrefix      = "APG"
 	envKeyReplacer = strings.NewReplacer(".", "_")
 )
 
@@ -197,16 +196,6 @@ func ReadValid(name string) (c Configuration, err error) {
 		return
 	}
 
-	for _, env := range envBindings {
-		if v.IsSet(env) {
-			evar := strings.ToUpper(envKeyReplacer.Replace(envPrefix + "." + env))
-			eval, _ := os.LookupEnv(evar)
-			if eval == v.GetString(env) {
-				fmt.Printf("WARN: deprecated env: %s=%q\n", evar, eval)
-			}
-		}
-	}
-
 	return
 }
 
@@ -277,7 +266,6 @@ func ActiveName() (string, error) {
 func bindEnvs(v *viper.Viper) error {
 	v.AutomaticEnv()
 	v.SetEnvKeyReplacer(envKeyReplacer)
-	v.SetEnvPrefix(envPrefix)
 	for _, env := range envBindings {
 		if err := v.BindEnv(env); err != nil {
 			return err
diff --git a/pkg/connection/README.md b/pkg/connection/README.md
index 7cf5a6f..b836b9f 100644
--- a/pkg/connection/README.md
+++ b/pkg/connection/README.md
@@ -33,5 +33,5 @@ The following environment variables are also used for overrides for testing and
 internal purposes, but should be avoided for production as they are not
 guaranteed:
 
-- APG_REGISTRY_ADDRESS
-- APG_REGISTRY_INSECURE
+- REGISTRY_ADDRESS
+- REGISTRY_INSECURE


Test patch:
diff --git a/cmd/registry/cmd/annotate/annotate_test.go b/cmd/registry/cmd/annotate/annotate_test.go
index ba720e8..e094505 100644
--- a/cmd/registry/cmd/annotate/annotate_test.go
+++ b/cmd/registry/cmd/annotate/annotate_test.go
@@ -25,7 +25,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/cmd/registry/cmd/apply/apply_test.go b/cmd/registry/cmd/apply/apply_test.go
index 0ec97d8..03fd58b 100644
--- a/cmd/registry/cmd/apply/apply_test.go
+++ b/cmd/registry/cmd/apply/apply_test.go
@@ -26,7 +26,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/cmd/registry/cmd/check/check_test.go b/cmd/registry/cmd/check/check_test.go
index 444641f..91c2d54 100644
--- a/cmd/registry/cmd/check/check_test.go
+++ b/cmd/registry/cmd/check/check_test.go
@@ -27,7 +27,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/cmd/registry/cmd/check/lint/checker_test.go b/cmd/registry/cmd/check/lint/checker_test.go
index 4128226..86a2e85 100644
--- a/cmd/registry/cmd/check/lint/checker_test.go
+++ b/cmd/registry/cmd/check/lint/checker_test.go
@@ -31,7 +31,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/cmd/registry/cmd/check/rules/rule1000/rule1000_test.go b/cmd/registry/cmd/check/rules/rule1000/rule1000_test.go
index 8493375..c3cbbd6 100644
--- a/cmd/registry/cmd/check/rules/rule1000/rule1000_test.go
+++ b/cmd/registry/cmd/check/rules/rule1000/rule1000_test.go
@@ -32,7 +32,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/cmd/registry/cmd/check/rules/rule1001/rule1001_test.go b/cmd/registry/cmd/check/rules/rule1001/rule1001_test.go
index 751990b..13d03ec 100644
--- a/cmd/registry/cmd/check/rules/rule1001/rule1001_test.go
+++ b/cmd/registry/cmd/check/rules/rule1001/rule1001_test.go
@@ -31,7 +31,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/cmd/registry/cmd/check/rules/rule1003/rule1003_test.go b/cmd/registry/cmd/check/rules/rule1003/rule1003_test.go
index a15922d..9976039 100644
--- a/cmd/registry/cmd/check/rules/rule1003/rule1003_test.go
+++ b/cmd/registry/cmd/check/rules/rule1003/rule1003_test.go
@@ -31,7 +31,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/cmd/registry/cmd/check/rules/rule101/rule101_test.go b/cmd/registry/cmd/check/rules/rule101/rule101_test.go
index 5f506c1..881f029 100644
--- a/cmd/registry/cmd/check/rules/rule101/rule101_test.go
+++ b/cmd/registry/cmd/check/rules/rule101/rule101_test.go
@@ -29,7 +29,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/cmd/registry/cmd/check/rules/rule102/rule102_test.go b/cmd/registry/cmd/check/rules/rule102/rule102_test.go
index e16a0ac..0785272 100644
--- a/cmd/registry/cmd/check/rules/rule102/rule102_test.go
+++ b/cmd/registry/cmd/check/rules/rule102/rule102_test.go
@@ -29,7 +29,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/cmd/registry/cmd/check/rules/rule104/rule104_test.go b/cmd/registry/cmd/check/rules/rule104/rule104_test.go
index 43c6a05..d9ac5b8 100644
--- a/cmd/registry/cmd/check/rules/rule104/rule104_test.go
+++ b/cmd/registry/cmd/check/rules/rule104/rule104_test.go
@@ -29,7 +29,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/cmd/registry/cmd/check/rules/rule106/rule106_test.go b/cmd/registry/cmd/check/rules/rule106/rule106_test.go
index 95be5f8..c4d5dac 100644
--- a/cmd/registry/cmd/check/rules/rule106/rule106_test.go
+++ b/cmd/registry/cmd/check/rules/rule106/rule106_test.go
@@ -29,7 +29,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/cmd/registry/cmd/compute/complexity/complexity_test.go b/cmd/registry/cmd/compute/complexity/complexity_test.go
index d79580e..d76c2d8 100644
--- a/cmd/registry/cmd/compute/complexity/complexity_test.go
+++ b/cmd/registry/cmd/compute/complexity/complexity_test.go
@@ -38,7 +38,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/cmd/registry/cmd/compute/conformance/conformance_test.go b/cmd/registry/cmd/compute/conformance/conformance_test.go
index 7f997d4..941dcd2 100644
--- a/cmd/registry/cmd/compute/conformance/conformance_test.go
+++ b/cmd/registry/cmd/compute/conformance/conformance_test.go
@@ -37,7 +37,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/cmd/registry/cmd/compute/lint/lint_test.go b/cmd/registry/cmd/compute/lint/lint_test.go
index 6525a99..f7dd44b 100644
--- a/cmd/registry/cmd/compute/lint/lint_test.go
+++ b/cmd/registry/cmd/compute/lint/lint_test.go
@@ -30,7 +30,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/cmd/registry/cmd/compute/lintstats/lintstats_test.go b/cmd/registry/cmd/compute/lintstats/lintstats_test.go
index c728354..e17a317 100644
--- a/cmd/registry/cmd/compute/lintstats/lintstats_test.go
+++ b/cmd/registry/cmd/compute/lintstats/lintstats_test.go
@@ -22,7 +22,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/cmd/registry/cmd/compute/score/score_test.go b/cmd/registry/cmd/compute/score/score_test.go
index 26ae5a2..4487230 100644
--- a/cmd/registry/cmd/compute/score/score_test.go
+++ b/cmd/registry/cmd/compute/score/score_test.go
@@ -30,7 +30,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/cmd/registry/cmd/compute/scorecard/scorecard_test.go b/cmd/registry/cmd/compute/scorecard/scorecard_test.go
index 6b2416f..2857101 100644
--- a/cmd/registry/cmd/compute/scorecard/scorecard_test.go
+++ b/cmd/registry/cmd/compute/scorecard/scorecard_test.go
@@ -29,7 +29,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/cmd/registry/cmd/compute/vocabulary/vocabulary_test.go b/cmd/registry/cmd/compute/vocabulary/vocabulary_test.go
index 0ad2e00..72a4993 100644
--- a/cmd/registry/cmd/compute/vocabulary/vocabulary_test.go
+++ b/cmd/registry/cmd/compute/vocabulary/vocabulary_test.go
@@ -30,7 +30,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/cmd/registry/cmd/config/configurations/configurations_test.go b/cmd/registry/cmd/config/configurations/configurations_test.go
index 0aed058..b469338 100644
--- a/cmd/registry/cmd/config/configurations/configurations_test.go
+++ b/cmd/registry/cmd/config/configurations/configurations_test.go
@@ -62,8 +62,8 @@ func TestNoConfigurations(t *testing.T) {
 
 func TestConfigurations(t *testing.T) {
 	t.Cleanup(test.CleanConfigDir(t))
-	t.Setenv("APG_REGISTRY_ADDRESS", "")
-	t.Setenv("APG_REGISTRY_INSECURE", "")
+	t.Setenv("REGISTRY_ADDRESS", "")
+	t.Setenv("REGISTRY_INSECURE", "")
 
 	cmd := createCommand()
 	cmd.SetArgs([]string{"config1"})
diff --git a/cmd/registry/cmd/delete/delete_test.go b/cmd/registry/cmd/delete/delete_test.go
index 99a0756..763224b 100644
--- a/cmd/registry/cmd/delete/delete_test.go
+++ b/cmd/registry/cmd/delete/delete_test.go
@@ -29,7 +29,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/cmd/registry/cmd/export/export_test.go b/cmd/registry/cmd/export/export_test.go
index d74afd4..e066dda 100644
--- a/cmd/registry/cmd/export/export_test.go
+++ b/cmd/registry/cmd/export/export_test.go
@@ -26,7 +26,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/cmd/registry/cmd/get/get_test.go b/cmd/registry/cmd/get/get_test.go
index 561832a..d11a15b 100644
--- a/cmd/registry/cmd/get/get_test.go
+++ b/cmd/registry/cmd/get/get_test.go
@@ -31,7 +31,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/cmd/registry/cmd/label/label_test.go b/cmd/registry/cmd/label/label_test.go
index bf76de2..31f3ba6 100644
--- a/cmd/registry/cmd/label/label_test.go
+++ b/cmd/registry/cmd/label/label_test.go
@@ -25,7 +25,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/cmd/registry/cmd/resolve/resolve_test.go b/cmd/registry/cmd/resolve/resolve_test.go
index 7a7a2e0..b1d21c8 100644
--- a/cmd/registry/cmd/resolve/resolve_test.go
+++ b/cmd/registry/cmd/resolve/resolve_test.go
@@ -37,7 +37,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/cmd/registry/cmd/upload/upload_test.go b/cmd/registry/cmd/upload/upload_test.go
index 27b2363..7c52156 100644
--- a/cmd/registry/cmd/upload/upload_test.go
+++ b/cmd/registry/cmd/upload/upload_test.go
@@ -23,7 +23,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/cmd/registry/conformance/conformance_test.go b/cmd/registry/conformance/conformance_test.go
index 3bd7a1c..db2a303 100644
--- a/cmd/registry/conformance/conformance_test.go
+++ b/cmd/registry/conformance/conformance_test.go
@@ -22,7 +22,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/cmd/registry/controller/controller_test.go b/cmd/registry/controller/controller_test.go
index 915b97a..b4c850a 100644
--- a/cmd/registry/controller/controller_test.go
+++ b/cmd/registry/controller/controller_test.go
@@ -36,7 +36,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/cmd/registry/patch/patch_test.go b/cmd/registry/patch/patch_test.go
index e7186e3..6fc7830 100644
--- a/cmd/registry/patch/patch_test.go
+++ b/cmd/registry/patch/patch_test.go
@@ -40,7 +40,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/cmd/registry/scoring/scoring_test.go b/cmd/registry/scoring/scoring_test.go
index 8e08c3d..4b792d2 100644
--- a/cmd/registry/scoring/scoring_test.go
+++ b/cmd/registry/scoring/scoring_test.go
@@ -22,7 +22,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/pkg/config/configuration_test.go b/pkg/config/configuration_test.go
index 4a80680..485b2e0 100644
--- a/pkg/config/configuration_test.go
+++ b/pkg/config/configuration_test.go
@@ -39,7 +39,7 @@ func TestMissingDirectory(t *testing.T) {
 
 func TestActiveSettings(t *testing.T) {
 	t.Cleanup(test.CleanConfigDir(t))
-	t.Setenv("APG_REGISTRY_ADDRESS", "")
+	t.Setenv("REGISTRY_ADDRESS", "")
 
 	// missing active file
 	_, err := config.Active()
@@ -95,7 +95,7 @@ func TestActiveSettings(t *testing.T) {
 		t.Errorf("unexpected diff: (-want +got):\n%s", diff)
 	}
 
-	t.Setenv("APG_REGISTRY_ADDRESS", "ignore")
+	t.Setenv("REGISTRY_ADDRESS", "ignore")
 	name, raw, err := config.ActiveRaw()
 	if err != nil {
 		t.Fatal(err)
@@ -118,9 +118,9 @@ func TestSettingsEnvVars(t *testing.T) {
 			Token:    "token",
 		},
 	}
-	t.Setenv("APG_REGISTRY_ADDRESS", want.Registry.Address)
-	t.Setenv("APG_REGISTRY_INSECURE", strconv.FormatBool(want.Registry.Insecure))
-	t.Setenv("APG_REGISTRY_TOKEN", want.Registry.Token)
+	t.Setenv("REGISTRY_ADDRESS", want.Registry.Address)
+	t.Setenv("REGISTRY_INSECURE", strconv.FormatBool(want.Registry.Insecure))
+	t.Setenv("REGISTRY_TOKEN", want.Registry.Token)
 
 	got, err := config.Active()
 	if err != nil {
@@ -341,8 +341,8 @@ func TestManipulations(t *testing.T) {
 
 func TestAllConfigs(t *testing.T) {
 	t.Cleanup(test.CleanConfigDir(t))
-	t.Setenv("APG_REGISTRY_ADDRESS", "")
-	t.Setenv("APG_REGISTRY_INSECURE", "")
+	t.Setenv("REGISTRY_ADDRESS", "")
+	t.Setenv("REGISTRY_INSECURE", "")
 
 	config1 := config.Configuration{
 		Registry: config.Registry{
diff --git a/pkg/connection/client_test.go b/pkg/connection/client_test.go
index 1bcd4e6..74a779e 100644
--- a/pkg/connection/client_test.go
+++ b/pkg/connection/client_test.go
@@ -23,8 +23,8 @@ import (
 
 func TestClientBadConfig(t *testing.T) {
 	t.Cleanup(test.CleanConfigDir(t))
-	t.Setenv("APG_REGISTRY_ADDRESS", "")
-	t.Setenv("APG_REGISTRY_INSECURE", "")
+	t.Setenv("REGISTRY_ADDRESS", "")
+	t.Setenv("REGISTRY_INSECURE", "")
 
 	_, err := NewRegistryClient(context.Background())
 	if err == nil {
@@ -57,8 +57,8 @@ func TestClientBadConfig(t *testing.T) {
 
 func TestClientGoodConfig(t *testing.T) {
 	t.Cleanup(test.CleanConfigDir(t))
-	t.Setenv("APG_REGISTRY_ADDRESS", "localhost:8080")
-	t.Setenv("APG_REGISTRY_INSECURE", "true")
+	t.Setenv("REGISTRY_ADDRESS", "localhost:8080")
+	t.Setenv("REGISTRY_INSECURE", "true")
 
 	_, err := NewRegistryClient(context.Background())
 	if err != nil {
diff --git a/pkg/connection/grpctest/server.go b/pkg/connection/grpctest/server.go
index cb20595..4d7fdd0 100644
--- a/pkg/connection/grpctest/server.go
+++ b/pkg/connection/grpctest/server.go
@@ -35,8 +35,8 @@ import (
 )
 
 // NewIfNoAddress will create a RegistryServer served by a
-// basic grpc.Server if env var APG_REGISTRY_ADDRESS is
-// not set, see NewServer() for details. If APG_REGISTRY_ADDRESS
+// basic grpc.Server if env var REGISTRY_ADDRESS is
+// not set, see NewServer() for details. If REGISTRY_ADDRESS
 // is set, returns nil as client will connect to that remote address.
 // Example:
 //
diff --git a/pkg/visitor/visit_test.go b/pkg/visitor/visit_test.go
index 05a1825..1047b4e 100644
--- a/pkg/visitor/visit_test.go
+++ b/pkg/visitor/visit_test.go
@@ -27,7 +27,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/pkg/wipeout/wipeout_test.go b/pkg/wipeout/wipeout_test.go
index 65f1c57..b8a1323 100644
--- a/pkg/wipeout/wipeout_test.go
+++ b/pkg/wipeout/wipeout_test.go
@@ -28,7 +28,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/tests/crud/crud_test.go b/tests/crud/crud_test.go
index 420a155..50c0d6d 100644
--- a/tests/crud/crud_test.go
+++ b/tests/crud/crud_test.go
@@ -34,7 +34,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/tests/demo/demo_test.go b/tests/demo/demo_test.go
index 32c171b..c741594 100644
--- a/tests/demo/demo_test.go
+++ b/tests/demo/demo_test.go
@@ -33,7 +33,7 @@ import (
 )
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})
diff --git a/tests/filters_test.go b/tests/filters_test.go
index 753714f..16227e1 100644
--- a/tests/filters_test.go
+++ b/tests/filters_test.go
@@ -51,7 +51,7 @@ func check(t *testing.T, message string, err error) {
 }
 
 // TestMain will set up a local RegistryServer and grpc.Server for all
-// tests in this package if APG_REGISTRY_ADDRESS env var is not set
+// tests in this package if REGISTRY_ADDRESS env var is not set
 // for the client.
 func TestMain(m *testing.M) {
 	grpctest.TestMain(m, registry.Config{})