Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolveRef ¶
func ResolveRef(location, ref string, consumerCerts bool, subs *rhsm.Subscriptions, ca *string) (string, error)
ResolveRef resolves the URL path specified by the location and ref (location+"refs/heads/"+ref) and returns the commit ID for the named ref. If there is an error, it will be of type ResolveRefError.
Types ¶
type CommitSpec ¶
type CommitSpec struct { // Ref for the commit. Can be empty. Ref string // URL of the repo where the commit can be fetched, if available. URL string ContentURL string Secrets string // Checksum of the commit. Checksum string }
CommitSpec specifies an ostree commit using any combination of Ref (branch), URL (source), and Checksum (commit ID).
func Resolve ¶
func Resolve(source SourceSpec) (CommitSpec, error)
Resolve the ostree source specification to a commit specification.
If a URL is defined in the source specification, the checksum of the ref is resolved, otherwise the checksum is an empty string. Failure to resolve the checksum results in a ResolveRefError.
If the ref is already a checksum (64 alphanumeric characters), it is not resolved or checked against the repository.
If the ref is malformed, the function returns with a RefError.
type ImageOptions ¶
type ImageOptions struct { // For ostree commit and container types: The ref of the new commit to be // built. // For ostree installers and raw images: The ref of the commit being // embedded in the installer or deployed in the image. ImageRef string `json:"ref"` // For ostree commit and container types: The ParentRef specifies the parent // ostree commit that the new commit will be based on. // For ostree installers and raw images: The ParentRef does not apply. ParentRef string `json:"parent"` // The URL from which to fetch the commit specified by the checksum. URL string `json:"url"` // If specified, the URL will be used only for metadata. ContentURL string `json:"contenturl"` // Indicate if the 'org.osbuild.rhsm.consumer' secret should be added when pulling from the // remote. RHSM bool `json:"rhsm"` }
ImageOptions specify an ostree ref, checksum, URL, ContentURL, and RHSM. The meaning of each parameter depends on the image type being built. The type is used to specify ostree-related image options when initializing a Manifest.
func (ImageOptions) Validate ¶
func (options ImageOptions) Validate() error
Validate the image options. This doesn't verify the existence of any remote objects and does not guarantee that refs will be successfully resolved. It only checks that the values and value combinations are valid.
The function checks the following: - The ImageRef, if specified, is a valid ref and does not look like a checksum. - The ParentRef, if specified, must be a valid ref or a checksum. - If the ParentRef is specified, the URL must also be specified. - URLs must be valid.
type ParameterComboError ¶
type ParameterComboError struct {
// contains filtered or unexported fields
}
func NewParameterComboError ¶
func NewParameterComboError(msg string, args ...interface{}) ParameterComboError
func (ParameterComboError) Error ¶
func (e ParameterComboError) Error() string
type RefError ¶
type RefError struct {
// contains filtered or unexported fields
}
RefError is returned when a parameter is invalid (e.g., malformed or contains illegal characters).
func NewRefError ¶
NewRefError creates and returns a new InvalidParameterError with a given formatted message.
type ResolveRefError ¶
type ResolveRefError struct {
// contains filtered or unexported fields
}
ResolveRefError is returned when there is a failure to resolve the reference.
func NewResolveRefError ¶
func NewResolveRefError(msg string, args ...interface{}) ResolveRefError
NewResolveRefError creates and returns a new ResolveRefError with a given formatted message.
func (ResolveRefError) Error ¶
func (e ResolveRefError) Error() string
type SourceSpec ¶
SourceSpec serves as input for ResolveParams, and contains all necessary variables to resolve a ref, which can then be turned into a CommitSpec.