diff --git a/README.md b/README.md index b1f7c8b..4e79a32 100644 --- a/README.md +++ b/README.md @@ -280,16 +280,17 @@ Otherwise start the container that should be registered and execute SUSEConnect -e -r ``` -In case you have a registration code that hasn't otherwise be used, you -can use the USERNAME "regcode" and the given registration code as password. +In case you have an unused registration code, you can connect with the username "regcode" and use the registration code as the password. For interactive use of containers you can also -pass the obtained username and password via environment variables +pass the obtained username, password and system token via environment variables: ```bash docker run -e SCC_CREDENTIAL_USERNAME= \ -e SCC_CREDENTIAL_PASSWORD= \ + -e SCC_CREDENTIAL_SYSTEM_TOKEN= \ my-image +``` # License diff --git a/internal/credentials.go b/internal/credentials.go index d5f78d5..ddabb6d 100644 --- a/internal/credentials.go +++ b/internal/credentials.go @@ -45,10 +45,12 @@ func (cr *Credentials) locations() []string { func (cr *Credentials) onLocationsNotFound() bool { env_user := os.Getenv("SCC_CREDENTIAL_USERNAME") env_pass := os.Getenv("SCC_CREDENTIAL_PASSWORD") + env_system_token := os.Getenv("SCC_CREDENTIAL_SYSTEM_TOKEN") if env_user != "" && env_pass != "" { cr.Username = env_user cr.Password = env_pass + cr.SystemToken = env_system_token return true }