target

package
v0.83.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: Apache-2.0 Imports: 6 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"`
}

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 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"`
}

type GCPTargetResultOptions

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

type KojiTargetOptions

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

type KojiTargetResultOptions

type KojiTargetResultOptions struct {
	ImageMD5  string `json:"image_md5"`
	ImageSize uint64 `json:"image_size"`
}

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 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 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 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 NewOCITarget

func NewOCITarget(options *OCITargetOptions) *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 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"`
	TargetError *clienterrors.Error `json:"target_error,omitempty"`
}

func NewAWSS3TargetResult

func NewAWSS3TargetResult(options *AWSS3TargetResultOptions) *TargetResult

func NewAWSTargetResult

func NewAWSTargetResult(options *AWSTargetResultOptions) *TargetResult

func NewAzureImageTargetResult

func NewAzureImageTargetResult(options *AzureImageTargetResultOptions) *TargetResult

func NewAzureTargetResult

func NewAzureTargetResult() *TargetResult

func NewContainerTargetResult

func NewContainerTargetResult(options *ContainerTargetResultOptions) *TargetResult

func NewGCPTargetResult

func NewGCPTargetResult(options *GCPTargetResultOptions) *TargetResult

func NewKojiTargetResult

func NewKojiTargetResult(options *KojiTargetResultOptions) *TargetResult

func NewOCITargetResult

func NewOCITargetResult(options *OCITargetResultOptions) *TargetResult

func NewVMWareTargetResult

func NewVMWareTargetResult() *TargetResult

func NewWorkerServerTargetResult

func NewWorkerServerTargetResult() *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