Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions images/hull-integration/get-custom-scripts/GetSbomLicense.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,14 @@ if ([String]::IsNullOrWhitespace($oci_server))
return @{ "statusCode" = 500; "errorMessage" = $errorMessage } | ConvertTo-Json
}
}
$this.WriteLog("~~~ SBOM: Logging in to $($oci_server)")
oras login $oci_server --username $oci_username --password $oci_password
$this.WriteLog("~~~ SBOM: Logged in to $($oci_server)")
# `oras login` takes a bare registry HOST and rejects a reference that includes a repository path
# (e.g. an ECR endpoint with a version prefix like "<acct>.dkr.ecr.<region>.amazonaws.com/26.1" ->
# "invalid reference: invalid registry"). Log in to the host only; $oci_server (which may carry the
# path) is still used to build the artifact reference below, so `oras discover` targets the right repo.
$oci_login_host = $oci_server.Split("/")[0]
$this.WriteLog("~~~ SBOM: Logging in to $($oci_login_host)")
oras login $oci_login_host --username $oci_username --password $oci_password
$this.WriteLog("~~~ SBOM: Logged in to $($oci_login_host)")

foreach($chartInfo in $entity._helm_charts_)
{
Expand Down