Documentation ¶
Index ¶
- Constants
- Variables
- func ComputeSpecHash(spec interface{}) (string, error)
- func ConstructRevisionName(componentName string, revision int64) string
- func ExtractRevision(revisionName string) (int, error)
- func GetAppNextRevision(app *v1beta1.Application) (string, int64)
- func GetGitSSHPublicKey(ctx context.Context, k8sClient client.Client, ...) (*gitssh.PublicKeys, error)
- func GetOpenAPISchemaFromTerraformComponentDefinition(configuration string) ([]byte, error)
- func GetTerraformConfigurationFromRemote(name, remoteURL, remotePath string, sshPublicKey *gitssh.PublicKeys) (string, error)
- type CapabilityBaseDefinition
- type CapabilityComponentDefinition
- type CapabilityDefinitionInterface
- type CapabilityPolicyDefinition
- type CapabilityStepDefinition
- type CapabilityTraitDefinition
- type ErrNoSectionParameterInCue
Constants ¶
const ( TerraformVariableString string = "string" TerraformVariableNumber string = "number" TerraformVariableBool string = "bool" TerraformVariableList string = "list" TerraformVariableTuple string = "tuple" TerraformVariableMap string = "map" TerraformVariableObject string = "object" TerraformVariableNull string = "" TerraformVariableAny string = "any" TerraformListTypePrefix string = "list(" TerraformTupleTypePrefix string = "tuple(" TerraformMapTypePrefix string = "map(" TerraformObjectTypePrefix string = "object(" TerraformSetTypePrefix string = "set(" )
data types of parameter value
const ( // GitCredsKnownHosts is a key in git credentials secret GitCredsKnownHosts string = "known_hosts" )
Variables ¶
var ExtractComponentName = util.ExtractComponentName
ExtractComponentName will extract the componentName from a revisionName
Functions ¶
func ComputeSpecHash ¶ added in v1.0.0
ComputeSpecHash computes the hash value of a k8s resource spec
func ConstructRevisionName ¶ added in v1.0.0
ConstructRevisionName will generate a revisionName given the componentName and revision will be <componentName>-v<RevisionNumber>, for example: comp-v1
func ExtractRevision ¶ added in v1.0.0
ExtractRevision will extract the revision from a revisionName
func GetAppNextRevision ¶ added in v1.0.0
func GetAppNextRevision(app *v1beta1.Application) (string, int64)
GetAppNextRevision will generate the next revision name and revision number for application
func GetGitSSHPublicKey ¶ added in v1.7.0
func GetGitSSHPublicKey(ctx context.Context, k8sClient client.Client, gitCredentialsSecretReference *v1.SecretReference) (*gitssh.PublicKeys, error)
GetGitSSHPublicKey gets a kubernetes secret containing the SSH private key based on gitCredentialsSecretReference parameters for component and trait definition
func GetOpenAPISchemaFromTerraformComponentDefinition ¶ added in v1.0.6
GetOpenAPISchemaFromTerraformComponentDefinition gets OpenAPI v3 schema by WorkloadDefinition name
func GetTerraformConfigurationFromRemote ¶ added in v1.2.0
func GetTerraformConfigurationFromRemote(name, remoteURL, remotePath string, sshPublicKey *gitssh.PublicKeys) (string, error)
GetTerraformConfigurationFromRemote gets Terraform Configuration(HCL)
Types ¶
type CapabilityBaseDefinition ¶ added in v1.0.0
type CapabilityBaseDefinition struct { }
CapabilityBaseDefinition is the base struct for CapabilityWorkloadDefinition and CapabilityTraitDefinition
func (*CapabilityBaseDefinition) CreateOrUpdateConfigMap ¶ added in v1.0.0
func (def *CapabilityBaseDefinition) CreateOrUpdateConfigMap(ctx context.Context, k8sClient client.Client, namespace, definitionName, definitionType string, labels map[string]string, appliedWorkloads []string, jsonSchema []byte, ownerReferences []metav1.OwnerReference) (string, error)
CreateOrUpdateConfigMap creates ConfigMap to store OpenAPI v3 schema or or updates data in ConfigMap
type CapabilityComponentDefinition ¶ added in v1.0.0
type CapabilityComponentDefinition struct { Name string `json:"name"` ComponentDefinition v1beta1.ComponentDefinition `json:"componentDefinition"` WorkloadType util.WorkloadType `json:"workloadType"` WorkloadDefName string `json:"workloadDefName"` Terraform *commontypes.Terraform `json:"terraform"` CapabilityBaseDefinition }
CapabilityComponentDefinition is the struct for ComponentDefinition
func NewCapabilityComponentDef ¶ added in v1.1.0
func NewCapabilityComponentDef(componentDefinition *v1beta1.ComponentDefinition) CapabilityComponentDefinition
NewCapabilityComponentDef will create a CapabilityComponentDefinition
func (*CapabilityComponentDefinition) GetOpenAPISchema ¶ added in v1.0.0
func (def *CapabilityComponentDefinition) GetOpenAPISchema(name string) ([]byte, error)
GetOpenAPISchema gets OpenAPI v3 schema by WorkloadDefinition name
func (*CapabilityComponentDefinition) StoreOpenAPISchema ¶ added in v1.0.0
func (def *CapabilityComponentDefinition) StoreOpenAPISchema(ctx context.Context, k8sClient client.Client, namespace, name, revName string) (string, error)
StoreOpenAPISchema stores OpenAPI v3 schema in ConfigMap from WorkloadDefinition
type CapabilityDefinitionInterface ¶ added in v1.0.0
type CapabilityDefinitionInterface interface { GetCapabilityObject(ctx context.Context, k8sClient client.Client, namespace, name string) (*types.Capability, error) GetOpenAPISchema(ctx context.Context, k8sClient client.Client, namespace, name string) ([]byte, error) }
CapabilityDefinitionInterface is the interface for Capability (WorkloadDefinition and TraitDefinition)
type CapabilityPolicyDefinition ¶ added in v1.4.0
type CapabilityPolicyDefinition struct { Name string `json:"name"` PolicyDefinition v1beta1.PolicyDefinition `json:"policyDefinition"` CapabilityBaseDefinition }
CapabilityPolicyDefinition is the Capability struct for PolicyDefinition
func NewCapabilityPolicyDef ¶ added in v1.4.0
func NewCapabilityPolicyDef(policydefinition *v1beta1.PolicyDefinition) CapabilityPolicyDefinition
NewCapabilityPolicyDef will create a CapabilityPolicyDefinition
func (*CapabilityPolicyDefinition) GetOpenAPISchema ¶ added in v1.4.0
func (def *CapabilityPolicyDefinition) GetOpenAPISchema(name string) ([]byte, error)
GetOpenAPISchema gets OpenAPI v3 schema by StepDefinition name
func (*CapabilityPolicyDefinition) StoreOpenAPISchema ¶ added in v1.4.0
func (def *CapabilityPolicyDefinition) StoreOpenAPISchema(ctx context.Context, k8sClient client.Client, namespace, name, revName string) (string, error)
StoreOpenAPISchema stores OpenAPI v3 schema from StepDefinition in ConfigMap
type CapabilityStepDefinition ¶ added in v1.1.8
type CapabilityStepDefinition struct { Name string `json:"name"` StepDefinition v1beta1.WorkflowStepDefinition `json:"stepDefinition"` CapabilityBaseDefinition }
CapabilityStepDefinition is the Capability struct for WorkflowStepDefinition
func NewCapabilityStepDef ¶ added in v1.1.8
func NewCapabilityStepDef(stepdefinition *v1beta1.WorkflowStepDefinition) CapabilityStepDefinition
NewCapabilityStepDef will create a CapabilityStepDefinition
func (*CapabilityStepDefinition) GetOpenAPISchema ¶ added in v1.1.8
func (def *CapabilityStepDefinition) GetOpenAPISchema(name string) ([]byte, error)
GetOpenAPISchema gets OpenAPI v3 schema by StepDefinition name
func (*CapabilityStepDefinition) StoreOpenAPISchema ¶ added in v1.1.8
func (def *CapabilityStepDefinition) StoreOpenAPISchema(ctx context.Context, k8sClient client.Client, namespace, name string, revName string) (string, error)
StoreOpenAPISchema stores OpenAPI v3 schema from StepDefinition in ConfigMap
type CapabilityTraitDefinition ¶ added in v1.0.0
type CapabilityTraitDefinition struct { Name string `json:"name"` TraitDefinition v1beta1.TraitDefinition `json:"traitDefinition"` DefCategoryType util.WorkloadType `json:"defCategoryType"` CapabilityBaseDefinition }
CapabilityTraitDefinition is the Capability struct for TraitDefinition
func NewCapabilityTraitDef ¶ added in v1.1.0
func NewCapabilityTraitDef(traitdefinition *v1beta1.TraitDefinition) CapabilityTraitDefinition
NewCapabilityTraitDef will create a CapabilityTraitDefinition
func (*CapabilityTraitDefinition) GetOpenAPISchema ¶ added in v1.0.0
func (def *CapabilityTraitDefinition) GetOpenAPISchema(name string) ([]byte, error)
GetOpenAPISchema gets OpenAPI v3 schema by TraitDefinition name
func (*CapabilityTraitDefinition) StoreOpenAPISchema ¶ added in v1.0.0
func (def *CapabilityTraitDefinition) StoreOpenAPISchema(ctx context.Context, k8sClient client.Client, namespace, name string, revName string) (string, error)
StoreOpenAPISchema stores OpenAPI v3 schema from TraitDefinition in ConfigMap
type ErrNoSectionParameterInCue ¶ added in v1.0.0
type ErrNoSectionParameterInCue struct {
// contains filtered or unexported fields
}
ErrNoSectionParameterInCue means there is not parameter section in Cue template of a workload
func (ErrNoSectionParameterInCue) Error ¶ added in v1.1.0
func (e ErrNoSectionParameterInCue) Error() string