spec

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FISSION_DEPLOYMENT_NAME_KEY = "fission-name"
	FISSION_DEPLOYMENT_UID_KEY  = "fission-uid"

	SPEC_API_VERSION          = "fission.io/v1"
	ARCHIVE_URL_PREFIX string = "archive://"
	SPEC_README               = `` /* 1789-byte string literal not displayed */

)

Variables

This section is empty.

Functions

func MapKey

func MapKey(m *metav1.ObjectMeta) string

func Save

func Save(data []byte, specDir string, specFile string) error

Save saves object encoded value to spec file under given spec directory

func SpecSave

func SpecSave(resource interface{}, specFile string) error

called from `fission * create --spec`

Types

type ArchiveUploadSpec

type ArchiveUploadSpec struct {
	// TypeMeta describes the type of this object. It is inlined. The Kind
	// field should always be "ArchiveUploadSpec".
	TypeMeta `json:",inline"`

	// Name is a local name that can be used to reference this archive. It
	// must be unique; duplicate names will cause an error while handling
	// specs.
	Name string `json:"name"`

	// RootDir specifies the root that the globs below are relative to. It
	// is optional and defaults to the parent directory of the spec
	// directory: for example, if the deployment config is at
	// /path/to/project/specs/config.yaml, the RootDir is /path/to/project.
	RootDir string `json:"rootdir,omitempty"`

	// IncludeGlobs is a list of Unix shell globs to include
	IncludeGlobs []string `json:"include,omitempty"`

	// ExcludeGlobs is a list of globs to exclude from the set specified by
	// IncludeGlobs.
	ExcludeGlobs []string `json:"exclude,omitempty"`
}

ArchiveUploadSpec specifies a set of files to be archived and uploaded.

The resulting archive can be referenced as archive://<Name> in PackageSpecs, using the name specified in the archive. The fission spec applier will replace the archive:// URL with a real HTTP URL after uploading the file.

type DeploymentConfig

type DeploymentConfig struct {
	// TypeMeta describes the type of this object. It is inlined. The Kind
	// field should always be "DeploymentConfig".
	TypeMeta `json:",inline"`

	// Name is a user-friendly name for the deployment. It is also stored in
	// all uploaded resources as an annotation.
	Name string `json:"name"`

	// UID uniquely identifies the deployment. It is stored as a label and
	// used to find resources to clean up when local specs are changed.
	UID string `json:"uid"`
}

DeploymentConfig is the global configuration for a set of Fission specs.

type FissionResources

type FissionResources struct {
	DeploymentConfig        DeploymentConfig
	Packages                []fv1.Package
	Functions               []fv1.Function
	Environments            []fv1.Environment
	HttpTriggers            []fv1.HTTPTrigger
	KubernetesWatchTriggers []fv1.KubernetesWatchTrigger
	TimeTriggers            []fv1.TimeTrigger
	MessageQueueTriggers    []fv1.MessageQueueTrigger
	ArchiveUploadSpecs      []ArchiveUploadSpec

	SourceMap SourceMap
}

CLI spec types

func (*FissionResources) ParseYaml

func (fr *FissionResources) ParseYaml(b []byte, loc *Location) error

ParseYaml takes one yaml document, figures out its type, parses it, and puts it in the right list in the given fission resources set.

func (*FissionResources) SpecExists

func (fr *FissionResources) SpecExists(resource interface{}, compareMetadata bool, compareSpec bool) *metav1.ObjectMeta

Returns metadata if the given resource exists in the specs, nil otherwise. compareMetadata and compareSpec control how the equality check is performed.

func (*FissionResources) Validate

func (fr *FissionResources) Validate(c *cli.Context) error

type Location

type Location struct {
	Path string
	Line int
}

CLI spec types

func (Location) String

func (loc Location) String() string

type ResourceApplyStatus

type ResourceApplyStatus struct {
	Created []*metav1.ObjectMeta
	Updated []*metav1.ObjectMeta
	Deleted []*metav1.ObjectMeta
}

CLI spec types

type SourceMap

type SourceMap struct {
	// kind -> namespace -> name -> location
	Locations map[string](map[string](map[string]Location))
}

CLI spec types

type TypeMeta

type TypeMeta struct {
	Kind       string `json:"kind,omitempty"`
	APIVersion string `json:"apiVersion,omitempty"`
}

TypeMeta is the same as Kubernetes' TypeMeta, and allows us to version and unmarshal local-only objects (like ArchiveUploadSpec) the same way that Kubernetes does.

Jump to

Keyboard shortcuts

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