updated vendor
This commit is contained in:
+7
-4
@@ -202,13 +202,15 @@ func ClientOptCredentialsFile(credentialsFile string) ClientOption {
|
||||
}
|
||||
}
|
||||
|
||||
// ClientOptHTTPClient returns a function that sets the httpClient setting on a client options set
|
||||
// ClientOptHTTPClient returns a function that sets the HTTP client for the registry client.
|
||||
func ClientOptHTTPClient(httpClient *http.Client) ClientOption {
|
||||
return func(client *Client) {
|
||||
client.httpClient = httpClient
|
||||
}
|
||||
}
|
||||
|
||||
// ClientOptPlainHTTP returns a function that enables plain HTTP (non-TLS)
|
||||
// communication for the registry client.
|
||||
func ClientOptPlainHTTP() ClientOption {
|
||||
return func(c *Client) {
|
||||
c.plainHTTP = true
|
||||
@@ -236,7 +238,7 @@ func warnIfHostHasPath(host string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// Login logs into a registry
|
||||
// Login authenticates the client with a remote OCI registry using the provided host and options.
|
||||
func (c *Client) Login(host string, options ...LoginOption) error {
|
||||
for _, option := range options {
|
||||
option(&loginOperation{host, c})
|
||||
@@ -282,7 +284,8 @@ func LoginOptBasicAuth(username string, password string) LoginOption {
|
||||
}
|
||||
}
|
||||
|
||||
// LoginOptPlainText returns a function that allows plaintext (HTTP) login
|
||||
// LoginOptPlainText returns a function that enables plaintext (HTTP) login
|
||||
// instead of HTTPS for the registry client.
|
||||
func LoginOptPlainText(isPlainText bool) LoginOption {
|
||||
return func(o *loginOperation) {
|
||||
o.client.plainHTTP = isPlainText
|
||||
@@ -882,7 +885,7 @@ func (c *Client) ValidateReference(ref, version string, u *url.URL) (string, *ur
|
||||
tag = version
|
||||
} else {
|
||||
// Retrieve list of repository tags
|
||||
tags, err := c.Tags(strings.TrimPrefix(ref, fmt.Sprintf("%s://", OCIScheme)))
|
||||
tags, err := c.Tags(strings.TrimPrefix(ref, OCIScheme+"://"))
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
|
||||
+2
-1
@@ -18,6 +18,7 @@ package registry
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
@@ -190,7 +191,7 @@ func GetPluginName(source string) (string, error) {
|
||||
// e.g., "ghcr.io/user/plugin-name:v1.0.0" -> Repository: "user/plugin-name"
|
||||
repository := ref.Repository
|
||||
if repository == "" {
|
||||
return "", fmt.Errorf("invalid OCI reference: missing repository")
|
||||
return "", errors.New("invalid OCI reference: missing repository")
|
||||
}
|
||||
|
||||
// Get the last part of the repository path as the plugin name
|
||||
|
||||
+1
-2
@@ -17,7 +17,6 @@ limitations under the License.
|
||||
package registry
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"oras.land/oras-go/v2/registry"
|
||||
@@ -80,5 +79,5 @@ func (r *reference) String() string {
|
||||
|
||||
// IsOCI determines whether a URL is to be treated as an OCI URL
|
||||
func IsOCI(url string) bool {
|
||||
return strings.HasPrefix(url, fmt.Sprintf("%s://", OCIScheme))
|
||||
return strings.HasPrefix(url, OCIScheme+"://")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user