manifest

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

README

KubeKit Manifest

This Go package is to manage the KubeKit Manifest and Version. It's used by the KubeKit and KubekitOS teams to define the dependencies (software, packages or applications) that should exists in the KubekitOS image or VM.

Requirements

Either Go or Docker is required to validate the changes to the Manifest.

Adding a New Relase to the Manifest

DO NOT MODIFY THE MANIFEST FILE MANUALLY

To modify the Manifest to add a new release, for example the release 1.2.3, execute the following instructions:

  1. Create a new branch for the new release, example: git checkout -b 'release-1.2.3'
  2. Execute make release NR=<new release number>
  3. Edit the new releaseX_Y_Z.go with the changes to the manifest.
  4. Verify all the new changes are correct, executing make test or make test-in-docker if Go is not installed.
  5. Commit the changes to GitHub, example git add . && git commit "release 1.2.3"
  6. Create the Pull Request from this branch and follow to the process to merge it to the master branch

In summary, these are the commands to execute to create a new release, in this example it's the release 1.2.3:

git checkout -b 'release-1.2.3'
make release NR=1.2.3
# Modify the new release:
vim release1_2_3.go
make test-in-docker
git add .
git commit "release 1.2.3"

If something went wrong after executing make release NR=x.y.z you can rollback to the previous version with make rollback-release. If for some reason this doesn't work, then dispose the new git branch and go back to the master branch.

IMPORTANT: There is no need to have a MANIFEST file for KubeKit but it is generated when you execute make test or make test-in-docker.

Documentation

Index

Constants

View Source
const DEFAULTFORMAT = "yaml"

DEFAULTFORMAT is the default format to write the Manifest. Could be Yaml or Json

View Source
const Version = "0.1.0"

Version is the current KubeKit and KubekitOS version

Variables

View Source
var ChecksumTypes = []ChecksumType{"sha256"}

ChecksumTypes is a list of supported checksum types

View Source
var KubeManifest = Manifest{
	Releases: map[string]Release{
		"2.1.0": release,
	},
}

KubeManifest is a global variable that defines the KubekitOS Manifest and all the Releases in it

View Source
var Prerelease = "dev"

Prerelease is a marker for the version. If this is "" (empty string) then it means that it is a final release. Otherwise, this is a pre-release such as "dev" (in development), "beta", "rc1", etc.

Functions

func JSON

func JSON() ([]byte, error)

JSON returns the KubeManifest in JSON format

func WriteFile

func WriteFile(filename, format string) error

WriteFile writes the KubeManifest to a file in a given format

func Yaml

func Yaml() ([]byte, error)

Yaml returns the KubeManifest in YAML format

Types

type ChecksumType

type ChecksumType string

ChecksumType is a type to group the few supported checksum types

type Dependencies

type Dependencies struct {
	ControlPlane map[string]Dependency `json:"control-plane,omitempty" yaml:"control-plane,omitempty" mapstructure:"control-plane"`
	Core         map[string]Dependency `json:"core,omitempty" yaml:"core,omitempty" mapstructure:"core"`
}

Dependencies has 1 kind of dependencies list: core

type Dependency

type Dependency struct {
	Version      string       `json:"version" yaml:"version" mapstructure:"version"`
	Name         string       `json:"name" yaml:"name" mapstructure:"name"`
	Src          string       `json:"src" yaml:"src" mapstructure:"src"`
	PrebakePath  string       `json:"prebake-path" yaml:"prebake-path" mapstructure:"prebake-path"`
	Checksum     string       `json:"checksum" yaml:"checksum" mapstructure:"checksum"`
	ChecksumType ChecksumType `json:"checksum_type" yaml:"checksum_type" mapstructure:"checksum_type"`
	LicenseURL   string       `json:"license_url" yaml:"license_url" mapstructure:"license_url"`
}

Dependency defines a software, package or application required on KubekitOS

type Manifest

type Manifest struct {
	Releases map[string]Release `json:"releases" yaml:"releases" mapstructure:"releases"`
}

Manifest is the main type that encapsulate a manifest

func (*Manifest) JSON

func (m *Manifest) JSON() ([]byte, error)

JSON returns the Manifest structure in JSON format

func (*Manifest) WriteFile

func (m *Manifest) WriteFile(filename, format string) (err error)

WriteFile writes the manifest to a file in a given format

func (*Manifest) Yaml

func (m *Manifest) Yaml() ([]byte, error)

Yaml returns the Manifest structure in YAML format

type Release

type Release struct {
	PreviousVersion   string       `json:"previous-version" yaml:"previous-version" mapstructure:"previous-version"`
	KubernetesVersion string       `json:"kubernetes-version" yaml:"kubernetes-version" mapstructure:"kubernetes-version"`
	DockerVersion     string       `json:"docker-version" yaml:"docker-version" mapstructure:"docker-version"`
	EtcdVersion       string       `json:"etcd-version" yaml:"etcd-version" mapstructure:"etcd-version"`
	Dependencies      Dependencies `json:"dependencies" yaml:"dependencies" mapstructure:"dependencies"`
}

Release contain a Kubernetes version and dependencies

Jump to

Keyboard shortcuts

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