resource

package
v0.0.0-...-c42b1bb Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PolicyPrefix = "flux.weave.works/"
)
View Source
const ReleaseContainerName = "chart-image"

ReleaseContainerName is the name used when flux interprets a FluxHelmRelease as having a container with an image, by virtue of having a `values` stanza with an image field:

spec:

...
values:
  image: some/image:version

The name refers to the source of the image value.

Variables

This section is empty.

Functions

func FindFluxHelmReleaseContainers

func FindFluxHelmReleaseContainers(values map[string]interface{}, visit func(string, image.Ref, ImageSetter) error) error

FindFluxHelmReleaseContainers examines the Values from a FluxHelmRelease (manifest, or cluster resource, or otherwise) and calls visit with each container name and image it finds, as well as procedure for changing the image value. It will return an error if it cannot interpret the values as specifying images, or if the `visit` function itself returns an error.

func Load

func Load(base string, paths []string) (map[string]resource.Resource, error)

Load takes paths to directories or files, and creates an object set based on the file(s) therein. Resources are named according to the file content, rather than the file name of directory structure.

func ParseMultidoc

func ParseMultidoc(multidoc []byte, source string) (map[string]resource.Resource, error)

ParseMultidoc takes a dump of config (a multidoc YAML) and constructs an object set from the resources represented therein.

Types

type Args

type Args []string

type ContainerPort

type ContainerPort struct {
	ContainerPort int
	Name          string
}

type ContainerSpec

type ContainerSpec struct {
	Name  string
	Image string
	Args  Args
	Ports []ContainerPort
	Env   Env
}

type CronJob

type CronJob struct {
	Spec CronJobSpec
	// contains filtered or unexported fields
}

func (CronJob) Bytes

func (o CronJob) Bytes() []byte

func (CronJob) Containers

func (c CronJob) Containers() []resource.Container

func (CronJob) Policy

func (o CronJob) Policy() policy.Set

func (CronJob) ResourceID

func (o CronJob) ResourceID() flux.ResourceID

func (CronJob) SetContainerImage

func (c CronJob) SetContainerImage(container string, ref image.Ref) error

func (CronJob) Source

func (o CronJob) Source() string

type CronJobSpec

type CronJobSpec struct {
	JobTemplate struct {
		Spec struct {
			Template PodTemplate
		}
	} `yaml:"jobTemplate"`
}

type DaemonSet

type DaemonSet struct {
	Spec struct {
		Template PodTemplate
	}
	// contains filtered or unexported fields
}

func (DaemonSet) Bytes

func (o DaemonSet) Bytes() []byte

func (DaemonSet) Containers

func (ds DaemonSet) Containers() []resource.Container

func (DaemonSet) Policy

func (o DaemonSet) Policy() policy.Set

func (DaemonSet) ResourceID

func (o DaemonSet) ResourceID() flux.ResourceID

func (DaemonSet) SetContainerImage

func (ds DaemonSet) SetContainerImage(container string, ref image.Ref) error

func (DaemonSet) Source

func (o DaemonSet) Source() string

type Deployment

type Deployment struct {
	Spec DeploymentSpec
	// contains filtered or unexported fields
}

func (Deployment) Bytes

func (o Deployment) Bytes() []byte

func (Deployment) Containers

func (d Deployment) Containers() []resource.Container

func (Deployment) Policy

func (o Deployment) Policy() policy.Set

func (Deployment) ResourceID

func (o Deployment) ResourceID() flux.ResourceID

func (Deployment) SetContainerImage

func (d Deployment) SetContainerImage(container string, ref image.Ref) error

func (Deployment) Source

func (o Deployment) Source() string

type DeploymentSpec

type DeploymentSpec struct {
	Replicas int
	Template PodTemplate
}

type Env

type Env []EnvEntry

Env is a bag of Name, Value pairs that are treated somewhat like a map.

type EnvEntry

type EnvEntry struct {
	Name, Value string
}

type FluxHelmRelease

type FluxHelmRelease struct {
	Spec struct {
		Values map[string]interface{}
	}
	// contains filtered or unexported fields
}

FluxHelmRelease echoes the generated type for the custom resource definition. It's here so we can 1. get `baseObject` in there, and 3. control the YAML serialisation of fields, which we can't do (easily?) with the generated type.

func (FluxHelmRelease) Bytes

func (o FluxHelmRelease) Bytes() []byte

func (FluxHelmRelease) Containers

func (fhr FluxHelmRelease) Containers() []resource.Container

Containers returns the containers that are defined in the FluxHelmRelease.

func (FluxHelmRelease) Policy

func (o FluxHelmRelease) Policy() policy.Set

func (FluxHelmRelease) ResourceID

func (o FluxHelmRelease) ResourceID() flux.ResourceID

func (FluxHelmRelease) SetContainerImage

func (fhr FluxHelmRelease) SetContainerImage(container string, ref image.Ref) error

SetContainerImage mutates this resource by setting the `image` field of `values`, or a subvalue therein, per one of the interpretations in `FindFluxHelmReleaseContainers` above. NB we can get away with a value-typed receiver because we set a map entry.

func (FluxHelmRelease) Source

func (o FluxHelmRelease) Source() string

type ImageSetter

type ImageSetter func(image.Ref)

type List

type List struct {
	Items []resource.Resource
	// contains filtered or unexported fields
}

func (List) Bytes

func (o List) Bytes() []byte

func (List) Policy

func (o List) Policy() policy.Set

func (List) ResourceID

func (o List) ResourceID() flux.ResourceID

func (List) Source

func (o List) Source() string

type Namespace

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

func (Namespace) Bytes

func (o Namespace) Bytes() []byte

func (Namespace) Policy

func (o Namespace) Policy() policy.Set

func (Namespace) ResourceID

func (o Namespace) ResourceID() flux.ResourceID

func (Namespace) Source

func (o Namespace) Source() string

type ObjectMeta

type ObjectMeta struct {
	Labels      map[string]string
	Annotations map[string]string
}

type PodSpec

type PodSpec struct {
	ImagePullSecrets []struct{ Name string }
	Volumes          []Volume
	Containers       []ContainerSpec
	InitContainers   []ContainerSpec `yaml:"initContainers"`
}

type PodTemplate

type PodTemplate struct {
	Metadata ObjectMeta
	Spec     PodSpec
}

func (PodTemplate) Containers

func (t PodTemplate) Containers() []resource.Container

func (PodTemplate) SetContainerImage

func (t PodTemplate) SetContainerImage(container string, ref image.Ref) error

type StatefulSet

type StatefulSet struct {
	Spec StatefulSetSpec
	// contains filtered or unexported fields
}

func (StatefulSet) Bytes

func (o StatefulSet) Bytes() []byte

func (StatefulSet) Containers

func (ss StatefulSet) Containers() []resource.Container

func (StatefulSet) Policy

func (o StatefulSet) Policy() policy.Set

func (StatefulSet) ResourceID

func (o StatefulSet) ResourceID() flux.ResourceID

func (StatefulSet) SetContainerImage

func (ss StatefulSet) SetContainerImage(container string, ref image.Ref) error

func (StatefulSet) Source

func (o StatefulSet) Source() string

type StatefulSetSpec

type StatefulSetSpec struct {
	Replicas int
	Template PodTemplate
}

type Volume

type Volume struct {
	Name   string
	Secret struct {
		SecretName string
	}
}

type VolumeMount

type VolumeMount struct {
	Name      string
	MountPath string
	ReadOnly  bool
}

Jump to

Keyboard shortcuts

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