Skip to content

fix: Use WithSecretVariable in Sign() for consistent credential handling#952

Merged
bupd merged 1 commit into
goharbor:mainfrom
Sypher845:fix/consistent-secret-handling
May 26, 2026
Merged

fix: Use WithSecretVariable in Sign() for consistent credential handling#952
bupd merged 1 commit into
goharbor:mainfrom
Sypher845:fix/consistent-secret-handling

Conversation

@Sypher845
Copy link
Copy Markdown
Contributor

@Sypher845 Sypher845 commented May 22, 2026

Description

Makes Sign() follow the same WithSecretVariable + shell expansion pattern already used by AttestSBOM().

Before

In the Job push-latest-images -> Publish and Sign Snapshot Image
image

After

image

same as the Attest:
image

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation update
  • Chore / maintenance

Changes

  • Replaced Plaintext(ctx) extraction with WithSecretVariable("REGISTRY_PASSWORD", registryPassword)
  • Pass password via $REGISTRY_PASSWORD shell variable instead of direct CLI argument
  • Fixed fmt.Errorf format verb (%s%v for a pointer nil-check)

Signed-off-by: Sypher845 <suyashpatil845@gmail.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 9.27%. Comparing base (60ad0bd) to head (ced8586).
⚠️ Report is 163 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##             main    #952      +/-   ##
=========================================
- Coverage   10.99%   9.27%   -1.72%     
=========================================
  Files         173     290     +117     
  Lines        8671   14597    +5926     
=========================================
+ Hits          953    1354     +401     
- Misses       7612   13117    +5505     
- Partials      106     126      +20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@qcserestipy
Copy link
Copy Markdown
Collaborator

@Sypher845 Thank you for taking up that issue. Can you please add some screen shots or screen recordings that demonstrate the new behavior

@Sypher845
Copy link
Copy Markdown
Contributor Author

@qcserestipy i have attached the screenshots, please have a look

Copy link
Copy Markdown
Member

@bupd bupd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@bupd bupd changed the title fix: use WithSecretVariable in Sign() for consistent credential handling fix: Use WithSecretVariable in Sign() for consistent credential handling May 26, 2026
@bupd bupd merged commit e172fcc into goharbor:main May 26, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sign() uses Plaintext(ctx) instead of WithSecretVariable for registry password

3 participants