spec

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2020 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEPLOYMENT_NAME_KEY = "kubefaas-name"
	DEPLOYMENT_UID_KEY  = "kubefaas-uid"

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

)

Variables

This section is empty.

Functions

func Apply

func Apply(input cli.Input) error

Apply compares the specs in the spec/config/ directory to the deployed resources on the cluster, and reconciles the differences by creating, updating or deleting resources on the cluster.

Apply is idempotent.

Apply is *not* transactional -- if the user hits Ctrl-C, or their laptop dies etc, while doing an apply, they will get a partially applied deployment. However, they can retry their apply command once they're back online.

func Commands

func Commands() *cobra.Command

func Destroy

func Destroy(input cli.Input) error

Destroy destroys everything in the spec.

func Init

func Init(input cli.Input) error

func List

func List(input cli.Input) error

List lists resources in the spec.

func MapKey

func MapKey(m *metav1.ObjectMeta) string

func ShowAppliedKubeWatchers

func ShowAppliedKubeWatchers(ws []fv1.KubernetesWatchTrigger)

ShowAppliedKubeWatchers displays info of kube watchers

func ShowCanaryConfigs

func ShowCanaryConfigs(canaryCfgs []fv1.CanaryConfig)

ShowCanaryConfigs displays info of Canary Configs

func ShowEnvironments

func ShowEnvironments(envs []fv1.Environment)

ShowEnvironments displays info of Environments

func ShowFunctions

func ShowFunctions(fns []fv1.Function)

ShowFunctions displays info of Functions

func ShowHTTPTriggers

func ShowHTTPTriggers(hts []fv1.HTTPTrigger)

ShowHTTPTriggers displays info of HTTP Triggers

func ShowMQTriggers

func ShowMQTriggers(mqts []fv1.MessageQueueTrigger)

ShowMQTriggers displays info of MessageQueue Triggers

func ShowPackages

func ShowPackages(pkgList []fv1.Package)

ShowPackages displays info of Packages

func ShowTimeTriggers

func ShowTimeTriggers(tts []fv1.TimeTrigger)

ShowTimeTriggers displays info of Time Triggers

func SpecDry

func SpecDry(resource interface{}) error

func SpecSave

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

called from `kubefaas * create --spec`

func Validate

func Validate(input cli.Input) error

Validate parses a set of specs and checks for references to resources that don't exist.

Types

type ApplySubCommand

type ApplySubCommand struct {
	cmd.CommandActioner
}

type DestroySubCommand

type DestroySubCommand struct {
	cmd.CommandActioner
}

type FissionResources

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

	SourceMap SourceMap
}

CLI spec types

func ReadSpecs

func ReadSpecs(specDir string) (*FissionResources, error)

ReadSpecs reads all specs in the specified directory and returns a parsed set of kubefaas resources.

func (*FissionResources) ExistsInSpecs

func (fr *FissionResources) ExistsInSpecs(resource interface{}) (bool, error)

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 kubefaas resources set.

func (*FissionResources) SpecExists

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

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

func (*FissionResources) Validate

func (fr *FissionResources) Validate(input cli.Input) ([]string, error)

Validate validates the spec file for irregular references

type InitSubCommand

type InitSubCommand struct {
	cmd.CommandActioner
	// contains filtered or unexported fields
}

type ListSubCommand

type ListSubCommand struct {
	cmd.CommandActioner
}

ListSubCommand struct

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 ValidateSubCommand

type ValidateSubCommand struct {
	cmd.CommandActioner
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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