oam

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: Apache-2.0 Imports: 39 Imported by: 10

Documentation

Index

Constants

View Source
const (
	DefaultChosenAllSvc = "ALL SERVICES"
	FlagNotSet          = "FlagNotSet"
	FlagIsInvalid       = "FlagIsInvalid"
	FlagIsValid         = "FlagIsValid"
)
View Source
const (
	StatusChecking = "checking"
	StatusDone     = "done"
)

Variables

This section is empty.

Functions

func AddCapabilityCenter

func AddCapabilityCenter(capName, capURL, capToken string) error

func AddCapabilityIntoCluster

func AddCapabilityIntoCluster(c client.Client, mapper discoverymapper.DiscoveryMapper, capability string) (string, error)

func AddOrUpdateTrait

func AddOrUpdateTrait(env *types.EnvMeta, appName string, componentName string, flagSet *pflag.FlagSet, template types.Capability) (*application.Application, error)

AddOrUpdateTrait attach trait to workload

func BaseComplete

func BaseComplete(envName string, workloadName string, appName string, flagSet *pflag.FlagSet, workloadType string) (*application.Application, error)

func BaseRun

func BaseRun(staging bool, app *application.Application, kubeClient client.Client, env *types.EnvMeta, io cmdutil.IOStreams) (string, error)

func CheckInstallStatus

func CheckInstallStatus(repoName string, tmp types.Capability) string

func ConvertApplyTo

func ConvertApplyTo(applyTo []string, workloads []types.Capability) []string

func GatherWorkloads

func GatherWorkloads(templates []types.Capability) []types.Capability

func GetServicesWhenDescribingApplication added in v0.0.9

func GetServicesWhenDescribingApplication(cmd *cobra.Command, app *application.Application) ([]string, error)

GetServicesWhenDescribingApplication gets the target services list either from cli `--svc` flag or from survey

func GetStatusFromObject added in v0.0.9

func GetStatusFromObject(resource *unstructured.Unstructured) (string, error)

func GetSyncedCapabilities

func GetSyncedCapabilities(repoName, addonName string) (types.Capability, error)

func GetTraitDefinition

func GetTraitDefinition(workloadName *string, capabilityAlias string) (types.Capability, error)

func GetUnstructured added in v0.0.9

func GetUnstructured(ctx context.Context, c client.Client, ns string, resourceRef runtimev1alpha1.TypedReference) (*unstructured.Unstructured, error)

func In

func In(l []string, v string) bool

func InstallCapability

func InstallCapability(client client.Client, mapper discoverymapper.DiscoveryMapper, centerName, capabilityName string, ioStreams cmdutil.IOStreams) error

func ListApplicationConfigurations added in v0.0.8

func ListApplicationConfigurations(ctx context.Context, c client.Reader, opt Option) (corev1alpha2.ApplicationConfigurationList, error)

ListApplicationConfigurations lists all OAM ApplicationConfiguration

func ListApplications added in v0.0.8

func ListApplications(ctx context.Context, c client.Client, opt Option) ([]apis.ApplicationMeta, error)

ListApplications lists all applications

func ListCapabilities

func ListCapabilities(capabilityCenterName string) ([]types.Capability, error)

func ListCapabilityCenters

func ListCapabilityCenters() ([]apis.CapabilityCenterMeta, error)

func ListCenterCapabilities

func ListCenterCapabilities(repoDir string) ([]types.Capability, error)

func ListComponents

func ListComponents(ctx context.Context, c client.Client, opt Option) ([]apis.ComponentMeta, error)

func ListTraitDefinitions

func ListTraitDefinitions(workloadName *string) ([]types.Capability, error)

func LoadIfExist

func LoadIfExist(envName string, workloadName string, appGroup string) (*application.Application, error)

func Parse

func Parse(applyTo string) string

func PrepareDetachTrait

func PrepareDetachTrait(envName string, traitType string, componentName string, appName string) (*application.Application, error)

func RemoveCapability

func RemoveCapability(client client.Client, capabilityName string, ioStreams cmdutil.IOStreams) error

func RemoveCapabilityCenter

func RemoveCapabilityCenter(centerName string) (string, error)

func RemoveCapabilityFromCluster

func RemoveCapabilityFromCluster(client client.Client, capabilityName string) (string, error)

func RetrieveApplicationStatusByName

func RetrieveApplicationStatusByName(ctx context.Context, c client.Client, applicationName string, namespace string) (apis.ApplicationMeta, error)

func RetrieveComponent added in v0.0.8

func RetrieveComponent(ctx context.Context, c client.Client, applicationName, componentName, namespace string) (apis.ComponentMeta, error)

func SimplifyCapabilityStruct

func SimplifyCapabilityStruct(capabilityList []types.Capability) []apis.TraitMeta

func SyncCapabilityCenter

func SyncCapabilityCenter(capabilityCenterName string) error

func SyncCapabilityFromCenter

func SyncCapabilityFromCenter(capName, capURL, capToken string) error

func TraitOperationRun

func TraitOperationRun(ctx context.Context, c client.Client, env *types.EnvMeta, appObj *application.Application,
	staging bool, io cmdutil.IOStreams) (string, error)

func UninstallCap

func UninstallCap(client client.Client, cap types.Capability, ioStreams cmdutil.IOStreams) error

func ValidateAndMutateForCore added in v0.0.5

func ValidateAndMutateForCore(traitType, workloadName string, flags *pflag.FlagSet, env *types.EnvMeta) error

Types

type ApplicationMetaList added in v0.0.8

type ApplicationMetaList []apis.ApplicationMeta

func (ApplicationMetaList) Len added in v0.0.8

func (a ApplicationMetaList) Len() int

func (ApplicationMetaList) Less added in v0.0.8

func (a ApplicationMetaList) Less(i, j int) bool

func (ApplicationMetaList) Swap added in v0.0.8

func (a ApplicationMetaList) Swap(i, j int)

type AutoscalerChecker added in v0.0.9

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

func (*AutoscalerChecker) Check added in v0.0.9

type CheckStatus added in v0.0.9

type CheckStatus string

type Checker added in v0.0.9

type Checker interface {
	Check(ctx context.Context, reference runtimev1alpha1.TypedReference, compName string, appConfig *v1alpha2.ApplicationConfiguration, app *application.Application) (CheckStatus, string, error)
}

func GetChecker added in v0.0.9

func GetChecker(traitType string, c client.Client) Checker

type DefaultChecker added in v0.0.9

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

func (*DefaultChecker) Check added in v0.0.9

type DeleteOptions

type DeleteOptions struct {
	AppName  string
	CompName string
	Client   client.Client
	Env      *types.EnvMeta
}

func (*DeleteOptions) DeleteApp

func (o *DeleteOptions) DeleteApp() (string, error)

func (*DeleteOptions) DeleteComponent

func (o *DeleteOptions) DeleteComponent(io cmdutil.IOStreams) (string, error)

type MetricChecker added in v0.0.9

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

func (*MetricChecker) Check added in v0.0.9

type Option

type Option struct {
	// Optional filter, if specified, only components in such app will be listed
	AppName string

	Namespace string
}

type RouteChecker added in v0.0.9

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

func (*RouteChecker) Check added in v0.0.9

type RunOptions

type RunOptions struct {
	Env          *types.EnvMeta
	WorkloadName string
	KubeClient   client.Client
	App          *application.Application
	AppName      string
	Staging      bool
	util.IOStreams
}

Jump to

Keyboard shortcuts

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