SUSE / container-suseconnect

Provides access to repositories inside containers using the host entitlements
Apache License 2.0
19 stars 16 forks source link

Add flag --log-credentials-errors #57

Closed dcermak closed 1 year ago

dcermak commented 2 years ago

Currently container-suseconnect will print errors to the console when it fails to obtain the SLE credentials. This is however causing UX issues in the SLE BCI containers, which work perfectly fine without a SLE subscription.

Thus a new flag is introduced: --log-credentials-errors. When this flag is set or if the environment variable CONTAINER_SUSECONNECT_LOG_CREDENTIALS_ERR is set, then container-suseconnect will continue printing errors as it did, but the default is now that errors with obtaining the credentials will be silently swallowed so that users of SLE BCI don't get confused by this error message.

This fixes https://github.com/SUSE/container-suseconnect/issues/62

dirkmueller commented 2 years ago

As a user/customer, the behavior I would expect is

This patch is putting the burden of finding out which case it is on the user, and it changes the default to the second, unregistered option. Following the 'supported customers first' principle I am wondering if we can do something to make the first option also as convenient. can we keep the default of the behavior, but handle only the case of "BCI repository available and no registration code provided" silently instead?

Detecting whether "BCI repository available" could be done by calling this via a new name that enables the new behavior, so existing invocations remain unaffected.