flux

package module
v0.0.0-...-3f67607 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

README

Flux

We believe that environments should be entirely version controlled. This is an anti-fragile measure to ensure stability through visibility. If anything fails, you can simply reapply the current state of the repository.

Flux is a tool that automatically ensures that the state of a cluster matches what is specified in version control (along with a few extra features).

It is most useful when used as a deployment tool at the end of a Continuous Delivery pipeline. Flux will make sure that your new container images and config changes are propagated to the cluster.

CircleCI GoDoc

Get started by browsing through the documentation below.

Introduction to Flux

FAQ

How it works

Installing Flux

Using Flux

Upgrading to Flux v1

Troubleshooting

Developer information

Build documentation

Release documentation

Contribution

Flux follows a typical PR workflow. All contributions should be made as PRs that satisfy the guidelines below.

Guidelines
  • All code must abide Go Code Review Comments
  • Names should abide What's in a name
  • Code must build on both Linux and Darwin, via plain go build
  • Code should have appropriate test coverage, invoked via plain go test

In addition, several mechanical checks are enforced. See the lint script for details.

Getting Help

If you have any questions about Flux and continuous delivery:

Your feedback is always welcome!

Documentation

Index

Constants

View Source
const (
	RepoNoConfig GitRepoStatus = "unconfigured" // configuration is empty
	RepoNew                    = "new"          // no attempt made to clone it yet
	RepoCloned                 = "cloned"       // has been read (cloned); no attempt made to write
	RepoReady                  = "ready"        // has been written to, so ready to sync
)

Variables

View Source
var (
	ErrInvalidServiceID = errors.New("invalid service ID")

	LegacyServiceIDRegexp       = regexp.MustCompile("^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$")
	ResourceIDRegexp            = regexp.MustCompile("^([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$")
	UnqualifiedResourceIDRegexp = regexp.MustCompile("^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$")
)

Functions

This section is empty.

Types

type Container

type Container struct {
	Name      string
	Current   image.Info
	Available []image.Info
}

type ControllerStatus

type ControllerStatus struct {
	ID         ResourceID
	Containers []Container
	Status     string
	Automated  bool
	Locked     bool
	Ignore     bool
	Policies   map[string]string
}

type GitConfig

type GitConfig struct {
	Remote       GitRemoteConfig `json:"remote"`
	PublicSSHKey ssh.PublicKey   `json:"publicSSHKey"`
	Status       GitRepoStatus   `json:"status"`
}

type GitRemoteConfig

type GitRemoteConfig struct {
	URL    string `json:"url"`
	Branch string `json:"branch"`
	Path   string `json:"path"`
}

func NewGitRemoteConfig

func NewGitRemoteConfig(url, branch, path string) (GitRemoteConfig, error)

type GitRepoStatus

type GitRepoStatus string

GitRepoStatus represents the progress made synchronising with a git repo. These are given below in expected order, but the status may go backwards if e.g., a deploy key is deleted.

type ImageStatus

type ImageStatus struct {
	ID         ResourceID
	Containers []Container
}

type ResourceID

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

ResourceID is an opaque type which uniquely identifies a resource in an orchestrator.

func MakeResourceID

func MakeResourceID(namespace, kind, name string) ResourceID

MakeResourceID constructs a ResourceID from constituent components.

func MustParseResourceID

func MustParseResourceID(s string) ResourceID

MustParseResourceID constructs a ResourceID from a string representation, panicing if the format is invalid.

func ParseResourceID

func ParseResourceID(s string) (ResourceID, error)

ParseResourceID constructs a ResourceID from a string representation if possible, returning an error value otherwise.

func ParseResourceIDOptionalNamespace

func ParseResourceIDOptionalNamespace(namespace, s string) (ResourceID, error)

ParseResourceIDOptionalNamespace constructs a ResourceID from either a fully qualified string representation, or an unqualified kind/name representation and the supplied namespace.

func (ResourceID) Components

func (id ResourceID) Components() (namespace, kind, name string)

Components returns the constituent components of a ResourceID

func (ResourceID) MarshalJSON

func (id ResourceID) MarshalJSON() ([]byte, error)

MarshalJSON encodes a ResourceID as a JSON string. This is done to maintain backwards compatibility with previous flux versions where the ResourceID is a plain string.

func (ResourceID) MarshalText

func (id ResourceID) MarshalText() (text []byte, err error)

MarshalText encodes a ResourceID as a flat string; this is required because ResourceIDs are sometimes used as map keys.

func (*ResourceID) UnmarshalJSON

func (id *ResourceID) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON decodes a ResourceID from a JSON string. This is done to maintain backwards compatibility with previous flux versions where the ResourceID is a plain string.

func (*ResourceID) UnmarshalText

func (id *ResourceID) UnmarshalText(text []byte) error

MarshalText decodes a ResourceID from a flat string; this is required because ResourceIDs are sometimes used as map keys.

type ResourceIDSet

type ResourceIDSet map[ResourceID]struct{}

func (ResourceIDSet) Add

func (s ResourceIDSet) Add(ids []ResourceID)

func (ResourceIDSet) Contains

func (s ResourceIDSet) Contains(id ResourceID) bool

func (ResourceIDSet) Intersection

func (s ResourceIDSet) Intersection(others ResourceIDSet) ResourceIDSet

func (ResourceIDSet) String

func (s ResourceIDSet) String() string

func (ResourceIDSet) ToSlice

func (s ResourceIDSet) ToSlice() ResourceIDs

func (ResourceIDSet) Without

func (s ResourceIDSet) Without(others ResourceIDSet) ResourceIDSet

type ResourceIDs

type ResourceIDs []ResourceID

func (ResourceIDs) Contains

func (ids ResourceIDs) Contains(id ResourceID) bool

func (ResourceIDs) Intersection

func (ids ResourceIDs) Intersection(others ResourceIDSet) ResourceIDSet

func (ResourceIDs) Len

func (p ResourceIDs) Len() int

func (ResourceIDs) Less

func (p ResourceIDs) Less(i, j int) bool

func (ResourceIDs) Sort

func (p ResourceIDs) Sort()

func (ResourceIDs) Swap

func (p ResourceIDs) Swap(i, j int)

func (ResourceIDs) Without

func (ids ResourceIDs) Without(others ResourceIDSet) (res ResourceIDs)

type Token

type Token string

func (Token) Set

func (t Token) Set(req *http.Request)

Directories

Path Synopsis
cmd
git
This package has types for dealing with image registries (e.g., quay.io, DockerHub, Google Container Registry, ..).
This package has types for dealing with image registries (e.g., quay.io, DockerHub, Google Container Registry, ..).
cache
This package implements an image metadata cache given a backing k-v store.
This package implements an image metadata cache given a backing k-v store.
rpc
This is a `net/rpc`-compatible implementation of a client and server for `flux/remote.Platform`.
This is a `net/rpc`-compatible implementation of a client and server for `flux/remote.Platform`.

Jump to

Keyboard shortcuts

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