release

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2020 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// gcbmgr/anago defaults
	DefaultToolRepo   = "release"
	DefaultToolBranch = git.Master
	DefaultToolOrg    = git.DefaultGithubOrg
	// TODO(vdf): Need to reference K8s Infra project here
	DefaultKubernetesStagingProject = "kubernetes-release-test"
	DefaultRelengStagingProject     = "k8s-staging-releng"
	DefaultDiskSize                 = "300"
	BucketPrefix                    = "kubernetes-release-"

	// GCSStagePath is the directory where release artifacts are staged before
	// push to GCS.
	GCSStagePath = "gcs-stage"

	// ReleaseStagePath is the directory where releases are staged.
	ReleaseStagePath = "release-stage"

	// GCEPath is the directory where GCE scripts are created.
	GCEPath = "release-stage/full/kubernetes/cluster/gce"

	// GCIPath is the path for the container optimized OS for GCP.
	GCIPath = "release-stage/full/kubernetes/cluster/gce/gci"

	// ReleaseTarsPath is the directory where release artifacts are created.
	ReleaseTarsPath = "release-tars"

	// WindowsLocalPath is the directory where Windows GCE scripts are created.
	WindowsLocalPath = "release-stage/full/kubernetes/cluster/gce/windows"

	// WindowsGCSPath is the directory where Windoes GCE scripts are staged
	// before push to GCS.
	WindowsGCSPath = "gcs-stage/extra/gce/windows"

	// ProductionBucket is the default bucket for Kubernetes releases
	ProductionBucket = "kubernetes-release"

	// ProductionBucketURL is the url for the ProductionBucket
	ProductionBucketURL = "https://dl.k8s.io"
)

Variables

This section is empty.

Functions

func BuiltWithBazel

func BuiltWithBazel(workDir string) (bool, error)

BuiltWithBazel determines whether the most recent Kubernetes release was built with Bazel.

func GetDefaultToolRepoURL added in v0.2.5

func GetDefaultToolRepoURL() string

GetDefaultKubernetesRepoURL returns the default HTTPS repo URL for Release Engineering tools. Expected: https://github.com/kubernetes/release

func GetKubecrossVersion added in v0.2.3

func GetKubecrossVersion(branches ...string) (string, error)

GetKubecrossVersion returns the current kube-cross container version. Replaces release::kubecross_version

func GetToolBranch added in v0.2.5

func GetToolBranch() string

GetToolBranch checks if the 'TOOL_BRANCH' environment variable is set. If 'TOOL_BRANCH' is non-empty, it returns the value. Otherwise, it returns DefaultToolBranch.

func GetToolOrg added in v0.2.5

func GetToolOrg() string

GetToolOrg checks if the 'TOOL_ORG' environment variable is set. If 'TOOL_ORG' is non-empty, it returns the value. Otherwise, it returns DefaultToolOrg.

func GetToolRepo added in v0.2.5

func GetToolRepo() string

GetToolRepo checks if the 'TOOL_REPO' environment variable is set. If 'TOOL_REPO' is non-empty, it returns the value. Otherwise, it returns DefaultToolRepo.

func GetToolRepoURL added in v0.2.5

func GetToolRepoURL(org, repo string, useSSH bool) string

GetKubernetesRepoURL takes a GitHub org and repo, and useSSH as a boolean and returns a repo URL for Release Engineering tools. Expected result is one of the following: - https://github.com/<org>/release - git@github.com:<org>/release

func IsDirtyBuild

func IsDirtyBuild(build string) bool

IsDirtyBuild checks if build version is dirty.

func IsValidReleaseBuild

func IsValidReleaseBuild(build string) (bool, error)

IsValidReleaseBuild checks if build version is valid for release.

func ReadBazelVersion

func ReadBazelVersion(workDir string) (string, error)

ReadBazelVersion reads the version from a Bazel build.

func ReadDockerizedVersion

func ReadDockerizedVersion(workDir string) (string, error)

ReadDockerizedVersion reads the version from a Dockerized Kubernetes build.

func SetBuildVersion added in v0.3.0

func SetBuildVersion(
	branch string,
) error

func URLPrefixForBucket added in v0.2.6

func URLPrefixForBucket(bucket string) string

URLPrefixForBucket returns the URL prefix for the provided bucket string

Types

type Repo added in v0.3.0

type Repo struct {
	// contains filtered or unexported fields
}

Repo is a wrapper around a kubernetes/release repository

func NewRepo added in v0.3.0

func NewRepo() *Repo

NewRepo creates a new release repository

func (*Repo) CheckState added in v0.3.0

func (r *Repo) CheckState(expOrg, expRepo, expBranch string) error

CheckState verifies that the repository is in the requested state

func (*Repo) GetTag added in v0.3.0

func (r *Repo) GetTag() (string, error)

GetTag returns the tag from the current repository

func (*Repo) Open added in v0.3.0

func (r *Repo) Open() error

Open assumes the current working directory as repository root and tries to open it

func (*Repo) SetRepo added in v0.3.0

func (r *Repo) SetRepo(repo Repository)

SetRepo can be used to set the internal repository implementation

type Repository added in v0.3.0

type Repository interface {
	Describe(opts *git.DescribeOptions) (string, error)
	CurrentBranch() (branch string, err error)
	Remotes() (res []*git.Remote, err error)
	LsRemote(...string) (string, error)
	Branch(...string) (string, error)
}

type Version added in v0.3.0

type Version struct {
	// contains filtered or unexported fields
}

GitHub is a wrapper around GitHub related functionality

func NewVersion added in v0.3.0

func NewVersion() *Version

NewVersion creates a new Version

func (*Version) GetKubeVersion added in v0.3.0

func (v *Version) GetKubeVersion(versionType VersionType) (string, error)

GetKubeVersion retrieves the version of the provided Kubernetes version type

func (*Version) GetKubeVersionForBranch added in v0.3.0

func (v *Version) GetKubeVersionForBranch(versionType VersionType, branch string) (string, error)

GetKubeVersionForBranch returns the remote Kubernetes release version for the provided branch

func (*Version) SetClient added in v0.3.0

func (v *Version) SetClient(client VersionClient)

SetClient can be used to manually set the internal Version client

type VersionClient added in v0.3.0

type VersionClient interface {
	GetURLResponse(string) (string, error)
}

type VersionType added in v0.2.6

type VersionType string

VersionType is a simple wrapper around a Kubernetes release version

const (
	// VersionStable references the latest stable Kubernetes version,
	// for example `v1.17.3`
	VersionTypeStable VersionType = "release/stable"

	// VersionStablePreRelease references the latest stable pre release
	// Kubernetes version, for example `v1.19.0-alpha.0`
	VersionTypeStablePreRelease VersionType = "release/latest"

	// VersionStable references the latest CI Kubernetes version,
	// for example `v1.19.0-alpha.0.721+f8ff8f44206ff4`
	VersionTypeCILatest VersionType = "ci/latest"
)

func (VersionType) URL added in v0.3.0

func (t VersionType) URL(version string) string

url retrieves the full URL of the Kubernetes release version

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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