Skip to content

[Feature] Return a non-zero exit code if login fails #750

@clintonb

Description

@clintonb

Current Behavior

Calling regctl registry login with invalid credentials returns a zero exit code. When used in GitHub Actions, the step passes despite the login failure.

$ regctl registry login ghcr.io --user "<username>" --pass "<invalid-password>"
time="2024-05-25T06:01:28Z" level=warning msg="Changing login user for registry" host=docker.io new=<username> orig=githubactions
time="2024-05-25T06:01:28Z" level=warning msg="Changing login password for registry" host=docker.io
time="2024-05-25T06:01:28Z" level=warning msg="Failed to ping registry with credentials" err="failed to ping registry ghcr.io: unauthorized"

Expected Behavior

Return a non-zero exit code so other commands are halted.

Example Solution

Version

0.6.1

Environment

  • Running as binary or container:
  • Host platform:
  • Registry description:

Anything else

if err != nil {
log.WithFields(logrus.Fields{
"err": err,
}).Warn("Failed to ping registry with credentials")
}

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions