build

package
v0.0.0-...-6d85d49 Latest Latest
Warning

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

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

Documentation

Overview

Package build implements a common system for building kubernetes for deployers to use.

Index

Constants

View Source
const CosHmacCredentialsProviderName = "CosHmacCredentialsProvider"

CosHmacCredentialsProviderName provides a name of CosHmacCreds provider

Variables

View Source
var (
	CommonTestBinaries = []string{
		"kubectl",
		"e2e.test",
		"ginkgo",
	}
)
View Source
var (
	// ErrCosHmacCredentialsHomeNotFound is emitted when the user directory cannot be found.
	ErrCosHmacCredentialsHomeNotFound = awserr.New("UserHomeNotFound", "user home directory not found.", nil)
)

Functions

func NewCosHmacCredentials

func NewCosHmacCredentials(filename string) *credentials.Credentials

NewCosHmacCredentials returns a pointer to a new Credentials object

func StoreCommonBinaries

func StoreCommonBinaries(kuberoot string, outroot string)

StoreCommonBinaries will best effort try to store commonly built binaries to the output directory

Types

type BuildAndStageStrategy

type BuildAndStageStrategy string //nolint:revive

ignore package name stutter

const (

	// MakeStrategy builds using make and (optionally) stages using krel
	MakeStrategy BuildAndStageStrategy = "make"
)

type Builder

type Builder interface {
	// Build determines how kubernetes artifacts are built from sources or existing artifacts
	// and returns the version being built
	Build() (string, error)
}

type COSConfig

type COSConfig struct {
	APIKey             string   `json:"apikey"`
	COSHMACKeys        HMACKeys `json:"cos_hmac_keys"`
	Endpoints          string   `json:"endpoints"`
	IAMAPIKeyDesc      string   `json:"iam_apikey_description"`
	IAMAPIKeyID        string   `json:"iam_apikey_id"`
	IAMAPIKeyName      string   `json:"iam_apikey_name"`
	IAMRoleCRN         string   `json:"iam_role_crn"`
	IAMServiceIDCRN    string   `json:"iam_serviceid_crn"`
	ResourceInstanceID string   `json:"resource_instance_id"`
}

func OpenFile

func OpenFile(filename string) (*COSConfig, error)

type CosHmacCredentialsProvider

type CosHmacCredentialsProvider struct {
	// Path to the COS HMAC credentials file.
	//
	// If empty will look for "COS_HMAC_CREDENTIALS_FILE" env variable. If the
	// env value is empty will default to current user's home directory.
	// Linux/OSX: "$HOME/.ibmcloud/hmac_credentials"
	// Windows:   "%USERPROFILE%\.ibmcloud\hmac_credentials"
	Filename string
	// contains filtered or unexported fields
}

func (*CosHmacCredentialsProvider) IsExpired

func (p *CosHmacCredentialsProvider) IsExpired() bool

IsExpired returns if the cos hmac credentials have expired.

func (*CosHmacCredentialsProvider) Retrieve

Retrieve reads and extracts the cos hmac credentials from the current users home directory.

type HMACKeys

type HMACKeys struct {
	AccessKeyID     string `json:"access_key_id"`
	SecretAccessKey string `json:"secret_access_key"`
}

type IBMCOSStager

type IBMCOSStager struct {
	StageLocation   string
	RepoRoot        string
	Region          string
	Bucket          string
	Path            string
	TargetBuildArch string
	Credentials     *credentials.Credentials
}

func NewIBMCOSStager

func NewIBMCOSStager(stageLocation, repoRoot, targetBuildArch, cosCredType string) (*IBMCOSStager, error)

func (*IBMCOSStager) Stage

func (i *IBMCOSStager) Stage(version string) error

Stage implements Stager.

type MakeBuilder

type MakeBuilder struct {
	RepoRoot        string
	TargetBuildArch string
}

func (*MakeBuilder) Build

func (m *MakeBuilder) Build() (string, error)

Build builds kubernetes with the quick-release make target

type NoopBuilder

type NoopBuilder struct{}

func (*NoopBuilder) Build

func (n *NoopBuilder) Build() (string, error)

type NoopStager

type NoopStager struct{}

func (*NoopStager) Stage

func (n *NoopStager) Stage(string) error

type Options

type Options struct {
	Strategy           string `flag:"~strategy" desc:"Determines the build strategy to use either make or bazel."`
	StageLocation      string `` /* 134-byte string literal not displayed */
	RepoRoot           string `flag:"-"`
	ImageLocation      string `flag:"~image-location" desc:"Image registry where built images are stored."`
	StageExtraGCPFiles bool   `flag:"-"`
	VersionSuffix      string `flag:"-"`
	UpdateLatest       bool   `flag:"~update-latest" desc:"Whether should upload the build number to the GCS"`
	TargetBuildArch    string `flag:"~target-build-arch" desc:"Target architecture for the test artifacts for dockerized build"`
	COSCredType        string `flag:"~cos-cred-type" desc:"IBM COS credential type(supported options: shared, cos_hmac)"`
	Builder
	Stager
}

func (*Options) Validate

func (o *Options) Validate() error

type Stager

type Stager interface {
	// Stage determines how kubernetes artifacts will be staged (e.g. to say a GCS bucket)
	// for the specified version
	Stage(version string) error
}

Jump to

Keyboard shortcuts

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