* `-e [REDACTED]` → `-e SOME_SECRET=[REDACTED]` * Replaces `Utils.redact` with `Utils.sensitive` to clarify that we're indicating redactability, not actually performing redaction. * Redacts from YAML output, including `mrsk config` (fixes #96)
21 lines
443 B
Ruby
21 lines
443 B
Ruby
class Mrsk::Commands::Registry < Mrsk::Commands::Base
|
|
delegate :registry, to: :config
|
|
|
|
def login
|
|
docker :login, registry["server"], "-u", sensitive(lookup("username")), "-p", sensitive(lookup("password"))
|
|
end
|
|
|
|
def logout
|
|
docker :logout, registry["server"]
|
|
end
|
|
|
|
private
|
|
def lookup(key)
|
|
if registry[key].is_a?(Array)
|
|
ENV.fetch(registry[key].first).dup
|
|
else
|
|
registry[key]
|
|
end
|
|
end
|
|
end
|