Documentation ¶
Index ¶
- type Options
- type PackageDefinition
- type PackageVariation
- type Specs
- func (s *Specs) BuildArtifactsArchive(pkgDef *PackageDefinition) error
- func (s *Specs) BuildSpecs(pkgDef *PackageDefinition, specOnly bool) (err error)
- func (s *Specs) ConstructPackageDefinition() (*PackageDefinition, error)
- func (s *Specs) DownloadArtifact(sourcePath, destPath string, extractTgz bool) error
- func (s *Specs) DownloadArtifactFromGCS(sourcePath, destPath string, extractTgz bool) error
- func (s *Specs) DownloadArtifactFromURL(downloadURL, destPath string, extractTgz bool) error
- func (s *Specs) GetCNIPluginsVersion() (string, error)
- func (s *Specs) GetCRIToolsVersion() (string, error)
- func (s *Specs) GetKubernetesCIDownloadLink(baseURL, name, version, arch string) (string, error)
- func (s *Specs) GetKubernetesChannelForVersion(kubernetesVersion string) (string, error)
- func (s *Specs) GetKubernetesDownloadLink(channel, baseURL, name, version, arch string) func() (string, error)
- func (s *Specs) GetKubernetesReleaseDownloadLink(baseURL, name, version, arch string) string
- func (s *Specs) GetKubernetesVersionForChannel(channel string) (string, error)
- func (s *Specs) GetMetadataWithVersionConstraint(packageName, packageVersion string, ...) (*metadata.PackageMetadata, error)
- func (s *Specs) GetPackageMetadata(templateDir, packageName, packageVersion string) (*metadata.PackageMetadata, error)
- func (s *Specs) GetPackageSource(...) (string, error)
- func (s *Specs) Run() error
- func (s *Specs) SetImpl(impl impl)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶ added in v0.16.0
type Options struct { // Package is name of the package to generate specs and artifacts archive for. Package string // Version is the package version. // For kubelet, kubeadm, kubectl, this is Kubernetes version. // For cri-tools, kubernetes-cni and cri-o, this is their corresponding version. Version string // Revision is the package revision. Revision string // Architectures to download binaries for. // This can be one of: amd64, arm64, ppc64le, s390x. Architectures []string // Channel is a release Channel that we're building packages for. // It's used to determine the Kubernetes/package version if version is not // explicitly provided. // This can be one of: release, prerelease, nightly. // Omit for non-core Kubernetes packages. Channel string // PackageSourceBase is the base URL to download artifacts from. // Can be https:// or gs:// URL. PackageSourceBase string // SpecTemplatePath is a path to a directory with spec template files. SpecTemplatePath string // SpecOutputPath is a path to a directory where to save spec files and // archives. The directory must exist before running the command. SpecOutputPath string // SpecOnly generates only spec files without the artifacts archive. SpecOnly bool }
Options defines options for generating specs and artifacts archive for the given package.
func DefaultOptions ¶ added in v0.16.0
func DefaultOptions() *Options
DefaultOptions returns a new Options instance.
type PackageDefinition ¶
type PackageDefinition struct { Name string Version string Revision string Channel string Metadata *metadata.PackageMetadata Variations []PackageVariation SpecTemplatePath string SpecOutputPath string }
PackageDefinition represents a concrete package and stores package's name, version, and metadata.
func (*PackageDefinition) RPMVersion ¶ added in v0.16.0
func (p *PackageDefinition) RPMVersion() string
RPMVersion returns version that's escaped to be a valid RPM package version. This function currently replaces "-" with "~" as described in the following document: https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/#_handling_non_sorting_versions_with_tilde_dot_and_caret
type PackageVariation ¶ added in v0.16.0
PackageVariation is a variation of the same package. Variation currently represents a different architecture and source for the given architecture.
type Specs ¶ added in v0.16.0
type Specs struct {
// contains filtered or unexported fields
}
func (*Specs) BuildArtifactsArchive ¶ added in v0.16.0
func (s *Specs) BuildArtifactsArchive(pkgDef *PackageDefinition) error
BuildArtifactsArchive downloads and archives artifacts from the given package source for all selected architectures. This archive is used as a source for artifacts by OpenBuildService when building the package.
func (*Specs) BuildSpecs ¶ added in v0.16.0
func (s *Specs) BuildSpecs(pkgDef *PackageDefinition, specOnly bool) (err error)
BuildSpecs creates spec file based on provided package definition.
func (*Specs) ConstructPackageDefinition ¶ added in v0.16.0
func (s *Specs) ConstructPackageDefinition() (*PackageDefinition, error)
ConstructPackageDefinition creates a new instance of PackageDefinition based on provided options.
func (*Specs) DownloadArtifact ¶ added in v0.16.0
DownloadArtifact is a wrapper function that runs appropriate download function depending if the package source URL scheme is gs:// or https://.
func (*Specs) DownloadArtifactFromGCS ¶ added in v0.16.0
DownloadArtifactFromGCS downloads the artifact from the given GCS bucket.
func (*Specs) DownloadArtifactFromURL ¶ added in v0.16.0
downloadArtifactFromGCS downloads the artifact from the given URL.
func (*Specs) GetCNIPluginsVersion ¶ added in v0.17.0
GetCNIPluginsVersion gets the latest CNI plugins version from GitHub.
func (*Specs) GetCRIToolsVersion ¶ added in v0.17.0
GetCRIToolsVersion gets the latest cri-tools version from GitHub.
func (*Specs) GetKubernetesCIDownloadLink ¶ added in v0.16.0
GetKubernetesCIDownloadLink gets the download link for CI version of Kubernetes.
func (*Specs) GetKubernetesChannelForVersion ¶ added in v0.16.0
GetKubernetesChannelForVersion returns channel for the given Kubernetes version.
func (*Specs) GetKubernetesDownloadLink ¶ added in v0.16.0
func (s *Specs) GetKubernetesDownloadLink(channel, baseURL, name, version, arch string) func() (string, error)
GetKubernetesDownloadLink gets the download link for Kubernetes packages based on given options.
func (*Specs) GetKubernetesReleaseDownloadLink ¶ added in v0.16.0
GetKubernetesReleaseDownloadLink gets the download link for release version of Kubernetes.
func (*Specs) GetKubernetesVersionForChannel ¶ added in v0.16.0
GetKubernetesVersionForChannel is used to determine the Kubernetes version based on the provided channel.
func (*Specs) GetMetadataWithVersionConstraint ¶ added in v0.16.0
func (s *Specs) GetMetadataWithVersionConstraint(packageName, packageVersion string, constraintedMetadata []metadata.PackageMetadata) (*metadata.PackageMetadata, error)
GetMetadataWithVersionConstraint parses metadata and takes metadata that matches the given version constraint.
func (*Specs) GetPackageMetadata ¶ added in v0.16.0
func (s *Specs) GetPackageMetadata(templateDir, packageName, packageVersion string) (*metadata.PackageMetadata, error)
GetPackageMetadata gets metadata for the given package. Metadata includes information about package source and dependencies, and is stored in a YAML manifest.
func (*Specs) GetPackageSource ¶ added in v0.16.0
func (s *Specs) GetPackageSource(templateBaseURL, baseURL, packageName, packageVersion, packageArch, channel string) (string, error)
GetPackageSource gets the download link for artifacts for the given package. This function runs template on sourceURLTemplate defined in the metadata manifest.