Repository navigation
RTECO-1352 - Fix jf setup docker login when using --url - #460
Merged
fluxxBot merged 6 commits intoJun 3, 2026
Merged
Conversation
Edenb2131
requested review from
a team,
agrasth,
bhanurp,
fluxxBot,
itsmeleela and
udaykb2
May 26, 2026 09:41
fluxxBot
reviewed
May 27, 2026
fluxxBot
suggested changes
May 27, 2026
…used jf setup docker fails when invoked with --url because configureContainer reads ServerDetails.GetUrl(), which createServerDetailsFromFlags clears for the Rt command domain after copying it into ArtifactoryUrl. The empty string passed to docker login resolves to Docker Hub and returns a misleading 401. Read GetArtifactoryUrl() with GetUrl() fallback for the --server-id path, take parsedURL.Host directly, and return an explicit error when both URLs are empty. Reproduces on SaaS and self-hosted equally.
Edenb2131
force-pushed
the
RTECO-1352-fix-setup-docker-empty-registry
branch
from
May 27, 2026 12:17
eb5970c to
331df92
Compare
4 tasks done
fluxxBot
previously approved these changes
Jun 1, 2026
gosec G101 (Potential hardcoded credentials: Password in URL) flagged the test case that verifies userinfo is stripped from the URL when deriving the docker registry host. The flagged string is a test fixture, not a real credential. Add an inline #nosec G101 directive with an explanatory comment.
Contributor
📗 Scan Summary
|
Contributor
fluxxBot
approved these changes
Jun 3, 2026
bhanurp
approved these changes
Jun 3, 2026
Edenb2131
pushed a commit
to Edenb2131/jfrog-cli
that referenced
this pull request
Jun 3, 2026
Adds an end-to-end test in jfrog-cli that exercises `jf setup docker --url=...`, the exact failure path of RTECO-1352. The fix landed in jfrog/jfrog-cli-artifactory#460; this bumps the dependency to include it and adds the test as a regression guard. The test runs with --url + --access-token (no saved config) and asserts that the temp docker config gets an auth entry keyed by the Artifactory registry hostname. Before the fix the command resolved to Docker Hub and returned a 401.
social4hyq
pushed a commit
to social4hyq/homebrew-core
that referenced
this pull request
Sep 20, 2026
jfrog-cli 2.107.0 Created-by: HarmonybrewBot Commit-by: HarmonybrewBot Merged-by: HarmonybrewBot Description: Created by `brew bump` --- Created with `brew bump-formula-pr`.<details> <summary>release notes</summary> <pre>## What changed in v2.107.0 > Auto-generated from 2 repositories · 2026-06-03 > Comparing `v2.106.0` → `v2.107.0` > ℹ️ No changes in: build-info-go, gofrog, jfrog-cli-core, jfrog-cli-security, jfrog-client-go ### ✨ New Features - **[jfrog-cli-artifactory]** RTECO-1079 - Implement search for plugins [#474](jfrog/jfrog-cli-artifactory#474) (@udaykb2) - **[jfrog-cli-artifactory]** RTECO-1079 - Add prompt to install & update for version [#475](jfrog/jfrog-cli-artifactory#475) (@udaykb2) ### 🐛 Bug Fixes - **[jfrog-cli]** RTECO-1352 - Fix jf setup docker login when using --url [#3517](jfrog/jfrog-cli#3517) (@Edenb2131) - **[jfrog-cli-artifactory]** Fix - Change GOPROXY [#477](jfrog/jfrog-cli-artifactory#477) (@udaykb2) - **[jfrog-cli-artifactory]** RTECO-1352 - Fix jf setup docker login when using --url [#460](jfrog/jfrog-cli-artifactory#460) (@Edenb2131) ### 🔧 Internal Changes - **[jfrog-cli-artifactory]** RTECO-1079 - Update agents commands help [#478](jfrog/jfrog-cli-artifactory#478) (@udaykb2) ### 📦 Other Changes - **[jfrog-cli]** Rteco 1299 jfrog artifactory ecomatrix cli e2e [#3523](jfrog/jfrog-cli#3523) (@naveenku-jfrog) - **[jfrog-cli]** Make sure to use cyclonedx-go 0.10.0 [#3525](jfrog/jfrog-cli#3525) (@attiasas) - **[jfrog-cli]** RTECO-1299 - Retry failed jfrog-cli-workflows runs via rerun-failed-jobs API [#3529](jfrog/jfrog-cli#3529) (@naveenku-jfrog) - **[jfrog-cli-artifactory]** RTECO-1079 - Remove updating plugins during publish [#471](jfrog/jfrog-cli-artifactory#471) (@udaykb2) - **[jfrog-cli-artifactory]** RTECO-1079 - Consistent plugin identification [#473](jfrog/jfrog-cli-artifactory#473) (@udaykb2) - **[jfrog-cli-artifactory]** RTECO-1079 - Make version & slug consistent [#472](jfrog/jfrog-cli-artifactory#472) (@udaykb2) - **[jfrog-cli-artifactory]** RTECO-1079 - Change the semver error response [#479](jfrog/jfrog-cli-artifactory#479) (@udaykb2) - **[jfrog-cli-artifactory]** RTECO-1079 - Use consistent env naming [#480](jfrog/jfrog-cli-artifactory#480) (@udaykb2) --- ### 📊 Summary | Repository | Changes | |---|---| | [jfrog-cli-artifactory](https://github.com/jfrog/jfrog-cli-artifactory) | 10 | | [jfrog-cli](https://github.com/jfrog/jfrog-cli) | 4 | | **Total** | **14** | ### 🔗 Module Version Changes | Module | From | To | |---|---|---| | [jfrog-cli-artifactory](https://github.com/jfrog/jfrog-cli-artifactory) | `v0.8.1-0.20260601110159-16e27949b870` | `v0.8.1-0.20260603105750-3886c0f01286` | </pre> <p>View the full release notes at <a href="https://github.com/jfrog/jfrog-cli/releases/tag/v2.107.0">https://github.com/jfrog/jfrog-cli/releases/tag/v2.107.0</a>.</p> </details> <hr> See merge request: Harmonybrew/homebrew-core!10364
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


gofmt,go vet).Summary
jf setup docker(andjf setup podman) fail immediately when invoked with--url. The CLI callsdocker login "", the daemon resolves the empty registry to Docker Hub, and the user seesfailed to login to container registry: docker login failed for: .Reproduces on both SaaS and self-hosted — CLI-only defect, independent of Artifactory version. Tracked as RTECO-1352.
Reproduction
Root cause
configureContainerderived the registry host fromsc.serverDetails.GetUrl(). ButcreateServerDetailsFromFlags(jfrog-cli) clearsdetails.Urlfor the Rt command domain after copying it intoArtifactoryUrl:So on the
--urlpath,GetUrl()returns"",url.Parse("")yields an empty URL, andContainerManagerLoginis called with an empty registry — the daemon then defaults to Docker Hub.The bug only manifests on
--url. The--server-idpath worked because saved configs populateUrlfrom disk.Fix
Extract a
deriveContainerRegistryHosthelper that:GetArtifactoryUrl()first (populated on the--urlpath), falls back toGetUrl()(populated on--server-id).parsedURL.Hostdirectly —docker logintakes onlyhost[:port]."server URL is empty; provide --url or --server-id"when both are empty, instead of silently redirecting to Docker Hub.Tests
12 table-driven subtests in
TestDeriveContainerRegistryHostcovering:--urlpath,--server-idfallback, both-set precedence, ports, http scheme, self-hosted IP (with and without port), IPv6, subdomain registry method, embedded-credentials guard, no-scheme typo, both-empty. All pass.Backward compatibility
No public API or flag changes.
--server-idsuccess path unchanged. The only user-visible change is a clearer error in the both-URLs-empty case.Depends on: