oam

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCapabilityCenter

func AddCapabilityCenter(capName, capURL, capToken string) error

func AddCapabilityIntoCluster

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

func AddHelmRepository

func AddHelmRepository(name, url, username, password, certFile, keyFile, caFile string, insecureSkipTLSverify bool, out io.Writer) error

func AddOrUpdateTrait

func AddOrUpdateTrait(envName string, appName string, workloadName string, flagSet *pflag.FlagSet, template types.Capability) (*application.Application, error)

AddOrUpdateTrait attach trait to workload

func AttachTrait

func AttachTrait(c *gin.Context, body apis.TraitBody) (string, error)

func BaseComplete

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

func BaseRun

func BaseRun(staging bool, App *application.Application, kubeClient client.Client, Env *types.EnvMeta) (string, error)

func CheckInstallStatus

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

func ConvertApplyTo

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

func CreateEnv

func CreateEnv(ctx context.Context, c client.Client, envName string, namespace string) (string, error)

Create env. If env already exists, return error

func CreateOrUpdateEnv

func CreateOrUpdateEnv(ctx context.Context, c client.Client, envName string, namespace string) (string, error)

Create or update env. If it does not exist, create it and switch to the new env. If it exists, update it and switch to the new env.

func DeleteEnv

func DeleteEnv(envName string) (string, error)

func DetachTrait

func DetachTrait(c *gin.Context, envName string, traitType string, workloadName string, appName string, staging bool) (string, error)

func GatherWorkloads

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

func GetChart

func GetChart(client *action.Install, name string) (*chart.Chart, error)

func GetCurrentEnvName

func GetCurrentEnvName() (string, error)

func GetEnvByName

func GetEnvByName(name string) (*types.EnvMeta, error)

func GetGVKFromRawExtension

func GetGVKFromRawExtension(extension runtime.RawExtension) (string, string, string)

func GetHelmRelease

func GetHelmRelease() ([]*release.Release, error)

func GetHelmRepositoryList

func GetHelmRepositoryList() []*repo.Entry

func GetSyncedCapabilities

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

func GetTraitAliasByComponentTraitList

func GetTraitAliasByComponentTraitList(componentTraitList []corev1alpha2.ComponentTrait) []string

func GetTraitAliasByKind

func GetTraitAliasByKind(ctx context.Context, c client.Client, traitKind string) string

func GetTraitAliasByTraitDefinition

func GetTraitAliasByTraitDefinition(traitDefinition corev1alpha2.TraitDefinition) (string, error)

func GetTraitDefNameFromRaw

func GetTraitDefNameFromRaw(extension runtime.RawExtension) string

func GetTraitDefinition

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

func GetTraitDefinitionByKind

func GetTraitDefinitionByKind(ctx context.Context, c client.Client, traitKind string) (corev1alpha2.TraitDefinition, error)

func HelmInstall

func HelmInstall(ioStreams cmdutil.IOStreams, repoName, repoURL, chartName, version, releaseName string, vals map[string]interface{}) error

func HelmUninstall

func HelmUninstall(ioStreams cmdutil.IOStreams, chartName, releaseName string) error

func In

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

func InstallCapability

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

func InstallHelmChart

func InstallHelmChart(ioStreams cmdutil.IOStreams, c types.Chart) error

func IsHelmReleaseRunning

func IsHelmReleaseRunning(releaseName, chartName string, streams cmdutil.IOStreams) bool

func IsHelmRepositoryExist

func IsHelmRepositoryExist(name, url string) bool

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 ListEnvs

func ListEnvs(envName string) ([]*types.EnvMeta, error)

func ListTraitDefinitions

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

func LoadIfExist

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

func NewHelmInstall

func NewHelmInstall(version, releaseName string, ioStreams cmdutil.IOStreams) (*action.Install, error)

func NewHelmUninstall

func NewHelmUninstall() (*action.Uninstall, error)

func Parse

func Parse(applyTo string) string

func PrepareDetachTrait

func PrepareDetachTrait(envName string, traitType string, workloadName 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.ApplicationStatusMeta, error)

func SimplifyCapabilityStruct

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

func SwitchEnv

func SwitchEnv(envName string) (string, error)

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) (string, error)

func UninstallCap

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

func UpdateEnv

func UpdateEnv(ctx context.Context, c client.Client, envName string, namespace string) (string, error)

Update Env, if env does not exist, return error

Types

type ComponentMeta

type ComponentMeta struct {
	Name        string                                `json:"name"`
	App         string                                `json:"app"`
	Workload    string                                `json:"workload,omitempty"`
	Traits      []string                              `json:"traits,omitempty"`
	Status      string                                `json:"status,omitempty"`
	CreatedTime string                                `json:"created,omitempty"`
	AppConfig   corev1alpha2.ApplicationConfiguration `json:"-"`
	Component   corev1alpha2.Component                `json:"-"`
}

func ListComponents

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

Get component list

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() (string, error)

type Option

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

	Namespace string
}

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