Skip to content

Commit

Permalink
refactor: add more documents.
Browse files Browse the repository at this point in the history
  • Loading branch information
Peefy committed Mar 23, 2023
1 parent a1a324f commit db08aa0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
20 changes: 16 additions & 4 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,28 @@ import (
)

const (
KCLRunGroup = "fn.kpt.dev"
KCLRunVersion = "v1alpha1"
// KCLRunGroup represents the API group for the KCLRun resource.
KCLRunGroup = "fn.kpt.dev"

// KCLRunVersion represents the API version for the KCLRun resource.
KCLRunVersion = "v1alpha1"

// KCLRunAPIVersion is a combination of the API group and version for the KCLRun resource.
KCLRunAPIVersion = KCLRunGroup + "/" + KCLRunVersion
KCLRunKind = "KCLRun"

// KCLRunKind represents the kind of resource for the KCLRun resource.
KCLRunKind = "KCLRun"

// ConfigMapAPIVersion represents the API version for the ConfigMap resource.
ConfigMapAPIVersion = "v1"
ConfigMapKind = "ConfigMap"

// ConfigMapKind represents the kind of resource for the ConfigMap resource.
ConfigMapKind = "ConfigMap"

// SourceKey is the key for the source field in a ConfigMap.
SourceKey = "source"

// defaultProgramName is the default name for the KCL function program.
defaultProgramName = "kcl-function-run"
)

Expand Down
3 changes: 3 additions & 0 deletions pkg/process/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import (
"kusionstack.io/kpt-kcl-sdk/pkg/config"
)

// Process is a function that takes a pointer to a ResourceList and processes
// it using the KCL function. It returns a boolean indicating whether the
// processing was successful, and an error (if any).
func Process(resourceList *fn.ResourceList) (bool, error) {
err := func() error {
r := &config.KCLRun{}
Expand Down

0 comments on commit db08aa0

Please sign in to comment.