target

package
v0.0.0-...-e90010f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSS3TargetOptions

type AWSS3TargetOptions struct {
	Region              string `json:"region"`
	AccessKeyID         string `json:"accessKeyID"`
	SecretAccessKey     string `json:"secretAccessKey"`
	SessionToken        string `json:"sessionToken"`
	Bucket              string `json:"bucket"`
	Key                 string `json:"key"`
	Endpoint            string `json:"endpoint"`
	CABundle            string `json:"ca_bundle"`
	SkipSSLVerification bool   `json:"skip_ssl_verification"`
	Public              bool   `json:"public,omitempty"`
}

type AWSS3TargetResultOptions

type AWSS3TargetResultOptions struct {
	URL string `json:"url"`
}

type AWSTargetOptions

type AWSTargetOptions struct {
	Region            string   `json:"region"`
	AccessKeyID       string   `json:"accessKeyID"`
	SecretAccessKey   string   `json:"secretAccessKey"`
	SessionToken      string   `json:"sessionToken"`
	Bucket            string   `json:"bucket"`
	Key               string   `json:"key"`
	ShareWithAccounts []string `json:"shareWithAccounts"`

	// Boot mode of the AMI (optional)
	// Supported values:
	//  - ec2.BootModeValuesLegacyBios
	//  - ec2.BootModeValuesUefi
	//  - ec2.BootModeValuesUefiPreferred
	// If not provided, then the Boot mode will be determined by the default
	// boot mode of the instance provisioned from the AMI.
	BootMode *string `json:"bootMode,omitempty"`
}

type AWSTargetResultOptions

type AWSTargetResultOptions struct {
	Ami    string `json:"ami"`
	Region string `json:"region"`
}

type AzureImageTargetOptions

type AzureImageTargetOptions struct {
	TenantID         string               `json:"tenant_id"`
	Location         string               `json:"location,omitempty"`
	SubscriptionID   string               `json:"subscription_id"`
	ResourceGroup    string               `json:"resource_group"`
	HyperVGeneration HyperVGenerationType `json:"hyperv_generation"`
}

type AzureImageTargetResultOptions

type AzureImageTargetResultOptions struct {
	ImageName string `json:"image_name"`
}

type AzureTargetOptions

type AzureTargetOptions struct {
	StorageAccount   string `json:"storageAccount"`
	StorageAccessKey string `json:"storageAccessKey"`
	Container        string `json:"container"`
}

type ChecksumType

type ChecksumType string

ChecksumType represents the type of a checksum used for a KojiOutputInfo.

const (
	ChecksumTypeMD5 ChecksumType = "md5"
)

type ContainerTargetOptions

type ContainerTargetOptions struct {
	Reference string `json:"reference"`

	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`

	TlsVerify *bool `json:"tls_verify,omitempty"`
}

type ContainerTargetResultOptions

type ContainerTargetResultOptions struct {
	URL    string `json:"url"`
	Digest string `json:"digest"`
}

type GCPTargetOptions

type GCPTargetOptions struct {
	Region            string   `json:"region"`
	Os                string   `json:"os"` // not exposed in cloudapi for now
	Bucket            string   `json:"bucket,omitempty"`
	Object            string   `json:"object"`
	ShareWithAccounts []string `json:"shareWithAccounts,omitempty"`

	// If provided, these credentials are used by the worker to import the image
	// to GCP. If not provided, the worker will try to authenticate using the
	// credentials from worker's configuration.
	Credentials []byte `json:"credentials,omitempty"`

	// The list of Guest OS Features to specify for the image being imported.
	GuestOsFeatures []*computepb.GuestOsFeature `json:"guestOsFeatures,omitempty"`
}

type GCPTargetResultOptions

type GCPTargetResultOptions struct {
	ImageName string `json:"image_name"`
	ProjectID string `json:"project_id"`
}

type HyperVGenerationType

type HyperVGenerationType string
const (
	HyperVGenV1 HyperVGenerationType = "V1"
	HyperVGenV2 HyperVGenerationType = "V2"
)

type KojiOutputInfo

type KojiOutputInfo struct {
	Filename     string       `json:"filename"`
	ChecksumType ChecksumType `json:"checksum_type"`
	Checksum     string       `json:"checksum"`
	Size         uint64       `json:"size"`
}

KojiOutputInfo represents the information about any output file uploaded to Koji as part of the OSBuild job. This information is then used by the KojiFinalize job when importing files into Koji.

type KojiTargetOptions

type KojiTargetOptions struct {
	UploadDirectory string `json:"upload_directory"`
	Server          string `json:"server"`
}

type KojiTargetResultOptions

type KojiTargetResultOptions struct {
	Image               *KojiOutputInfo  `json:"image"`
	Log                 *KojiOutputInfo  `json:"log,omitempty"`
	OSBuildManifest     *KojiOutputInfo  `json:"osbuild_manifest,omitempty"`
	OSBuildManifestInfo *ManifestInfo    `json:"osbuild_manifest_info,omitempty"`
	SbomDocs            []KojiOutputInfo `json:"sbom_docs,omitempty"`
}

func (KojiTargetResultOptions) MarshalJSON

func (o KojiTargetResultOptions) MarshalJSON() ([]byte, error)

func (*KojiTargetResultOptions) UnmarshalJSON

func (o *KojiTargetResultOptions) UnmarshalJSON(data []byte) error

type LocalTargetOptions deprecated

type LocalTargetOptions struct {
	ComposeId       uuid.UUID `json:"compose_id"`
	ImageBuildId    int       `json:"image_build_id"`
	Filename        string    `json:"filename"`
	StreamOptimized bool      `json:"stream_optimized"` // return image as stream optimized
}

Deprecated: LocalTargetOptions should not be used by any new code. The data structure is kept for backward compatibility and to ensure that old osbuild-composer instances which were upgraded will be able to read the target details from the local store.

type ManifestInfo

type ManifestInfo struct {
	OSBuildComposerVersion string `json:"osbuild_composer_version"`
	// List of relevant modules used by osbuild-composer which
	// could affect the manifest content.
	OSBuildComposerDeps []*OSBuildComposerDepModule `json:"osbuild_composer_deps,omitempty"`
}

ManifestInfo contains information about the environment in which the manifest was produced and which could affect its content.

type OCIObjectStorageTargetOptions

type OCIObjectStorageTargetOptions struct {
	User        string `json:"user"`
	Tenancy     string `json:"tenancy"`
	Region      string `json:"region"`
	Fingerprint string `json:"fingerprint"`
	PrivateKey  string `json:"private_key"`
	Bucket      string `json:"bucket"`
	Namespace   string `json:"namespace"`
	Compartment string `json:"compartment_id"`
}

type OCIObjectStorageTargetResultOptions

type OCIObjectStorageTargetResultOptions struct {
	URL string `json:"url"`
}

type OCITargetOptions

type OCITargetOptions struct {
	User        string `json:"user"`
	Tenancy     string `json:"tenancy"`
	Region      string `json:"region"`
	Fingerprint string `json:"fingerprint"`
	PrivateKey  string `json:"private_key"`
	Bucket      string `json:"bucket"`
	Namespace   string `json:"namespace"`
	Compartment string `json:"compartment_id"`
}

type OCITargetResultOptions

type OCITargetResultOptions struct {
	Region  string `json:"region"`
	ImageID string `json:"image_id"`
}

type OSBuildComposerDepModule

type OSBuildComposerDepModule struct {
	Path    string                    `json:"path"`
	Version string                    `json:"version"`
	Replace *OSBuildComposerDepModule `json:"replace,omitempty"`
}

type OsbuildArtifact

type OsbuildArtifact struct {
	// Filename of the image as produced by osbuild for a given export
	ExportFilename string `json:"export_filename"`
	// Name of the osbuild pipeline, which should be exported for this target
	ExportName string `json:"export_name"`
}

OsbuildArtifact represents a configuration to produce osbuild artifact specific to a target.

type PulpOSTreeTargetOptions

type PulpOSTreeTargetOptions struct {
	// ServerAddress for the pulp instance
	ServerAddress string `json:"server_address,omitempty"`

	// Repository to import the ostree commit to
	Repository string `json:"repository"`

	// BasePath for distributing the repository (if new)
	BasePath string `json:"basepath,omitempty"`

	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
}

type PulpOSTreeTargetResultOptions

type PulpOSTreeTargetResultOptions struct {
	RepoURL string `json:"repository_url"`
}

type Target

type Target struct {
	Uuid uuid.UUID `json:"uuid"`
	// Desired name of the image in the target environment
	ImageName string `json:"image_name"`
	// Name of the specific target type
	Name    TargetName             `json:"name"`
	Created time.Time              `json:"created"`
	Status  common.ImageBuildState `json:"status"`
	// Target type specific options
	Options TargetOptions `json:"options"`
	// Configuration to produce osbuild artifact specific to this target
	OsbuildArtifact OsbuildArtifact `json:"osbuild_artifact"`
}

func NewAWSS3Target

func NewAWSS3Target(options *AWSS3TargetOptions) *Target

func NewAWSTarget

func NewAWSTarget(options *AWSTargetOptions) *Target

func NewAzureImageTarget

func NewAzureImageTarget(options *AzureImageTargetOptions) *Target

NewAzureImageTarget creates org.osbuild.azure.image target

This target uploads and registers an Azure Image. The image can be then immediately used to spin up a virtual machine.

The target uses Azure OAuth credentials. In most cases you want to create a service principal for this purpose, see: https://docs.microsoft.com/en-us/azure/active-directory/develop/app-objects-and-service-principals The credentials are not passed in the target options, instead they are defined in the worker. If the worker doesn't have Azure credentials and gets a job with this target, the job will fail.

The Tenant ID for the authorization process is specified in the target options. This means that this target can be used for multi-tenant applications.

If you need to just upload a PageBlob into Azure Storage, see the org.osbuild.azure target.

func NewAzureTarget

func NewAzureTarget(options *AzureTargetOptions) *Target

NewAzureTarget creates org.osbuild.azure target

This target uploads a Page Blob to Azure Storage.

The target uses Azure Storage keys for authentication, see: https://docs.microsoft.com/en-us/azure/storage/common/storage-account-keys-manage The credentials are defined inside the target options.

If you need to upload an Azure Image instead, see the org.osbuild.azure.image target.

func NewContainerTarget

func NewContainerTarget(options *ContainerTargetOptions) *Target

func NewGCPTarget

func NewGCPTarget(options *GCPTargetOptions) *Target

func NewKojiTarget

func NewKojiTarget(options *KojiTargetOptions) *Target

func NewLocalTarget deprecated

func NewLocalTarget(options *LocalTargetOptions) *Target

Deprecated: NewLocalTarget should not be used by any new code.

func NewOCIObjectStorageTarget

func NewOCIObjectStorageTarget(options *OCIObjectStorageTargetOptions) *Target

func NewOCITarget

func NewOCITarget(options *OCITargetOptions) *Target

func NewPulpOSTreeTarget

func NewPulpOSTreeTarget(options *PulpOSTreeTargetOptions) *Target

func NewVMWareTarget

func NewVMWareTarget(options *VMWareTargetOptions) *Target

func NewWorkerServerTarget

func NewWorkerServerTarget() *Target

func (Target) MarshalJSON

func (target Target) MarshalJSON() ([]byte, error)

func (*Target) UnmarshalJSON

func (target *Target) UnmarshalJSON(data []byte) error

type TargetName

type TargetName string
const (
	TargetNameAWS   TargetName = "org.osbuild.aws"
	TargetNameAWSS3 TargetName = "org.osbuild.aws.s3"
)
const TargetNameAzure TargetName = "org.osbuild.azure"
const TargetNameAzureImage TargetName = "org.osbuild.azure.image"
const TargetNameContainer TargetName = "org.osbuild.container"
const TargetNameGCP TargetName = "org.osbuild.gcp"
const TargetNameKoji TargetName = "org.osbuild.koji"
const TargetNameLocal TargetName = "org.osbuild.local"

Deprecated: TargetNameLocal should not be used by any new code.

const TargetNameOCI TargetName = "org.osbuild.oci"
const TargetNameOCIObjectStorage TargetName = "org.osbuild.oci.objectstorage"
const TargetNamePulpOSTree TargetName = "org.osbuild.pulp.ostree"
const TargetNameVMWare TargetName = "org.osbuild.vmware"
const TargetNameWorkerServer TargetName = "org.osbuild.worker.server"

type TargetOptions

type TargetOptions interface {
	// contains filtered or unexported methods
}

type TargetResult

type TargetResult struct {
	Name    TargetName          `json:"name"`
	Options TargetResultOptions `json:"options,omitempty"`
	// Configuration used to produce osbuild artifact specific to this target
	OsbuildArtifact *OsbuildArtifact    `json:"osbuild_artifact,omitempty"`
	TargetError     *clienterrors.Error `json:"target_error,omitempty"`
}

func NewAWSS3TargetResult

func NewAWSS3TargetResult(options *AWSS3TargetResultOptions, artifact *OsbuildArtifact) *TargetResult

func NewAWSTargetResult

func NewAWSTargetResult(options *AWSTargetResultOptions, artifact *OsbuildArtifact) *TargetResult

func NewAzureImageTargetResult

func NewAzureImageTargetResult(options *AzureImageTargetResultOptions, artifact *OsbuildArtifact) *TargetResult

func NewAzureTargetResult

func NewAzureTargetResult(artifact *OsbuildArtifact) *TargetResult

func NewContainerTargetResult

func NewContainerTargetResult(options *ContainerTargetResultOptions, artifact *OsbuildArtifact) *TargetResult

func NewGCPTargetResult

func NewGCPTargetResult(options *GCPTargetResultOptions, artifact *OsbuildArtifact) *TargetResult

func NewKojiTargetResult

func NewKojiTargetResult(options *KojiTargetResultOptions, artifact *OsbuildArtifact) *TargetResult

func NewOCIObjectStorageTargetResult

func NewOCIObjectStorageTargetResult(options *OCIObjectStorageTargetResultOptions, artifact *OsbuildArtifact) *TargetResult

func NewOCITargetResult

func NewOCITargetResult(options *OCITargetResultOptions, artifact *OsbuildArtifact) *TargetResult

func NewPulpOSTreeTargetResult

func NewPulpOSTreeTargetResult(options *PulpOSTreeTargetResultOptions, artifact *OsbuildArtifact) *TargetResult

func NewVMWareTargetResult

func NewVMWareTargetResult(artifact *OsbuildArtifact) *TargetResult

func NewWorkerServerTargetResult

func NewWorkerServerTargetResult(artifact *OsbuildArtifact) *TargetResult

func (*TargetResult) UnmarshalJSON

func (targetResult *TargetResult) UnmarshalJSON(data []byte) error

type TargetResultOptions

type TargetResultOptions interface {
	// contains filtered or unexported methods
}

func UnmarshalTargetResultOptions

func UnmarshalTargetResultOptions(trName TargetName, rawOptions json.RawMessage) (TargetResultOptions, error)

type VMWareTargetOptions

type VMWareTargetOptions struct {
	Host       string `json:"host"`
	Username   string `json:"username"`
	Password   string `json:"password"`
	Datacenter string `json:"datacenter"`
	Cluster    string `json:"cluster"`
	Datastore  string `json:"datastore"`
	Folder     string `json:"folder"`
}

type WorkerServerTargetOptions

type WorkerServerTargetOptions struct{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL