Skip to content

Commit

Permalink
Merge pull request #59 from kcl-lang/add-more-krm-kcl-resource-tests
Browse files Browse the repository at this point in the history
test: add more krm-kcl resource test
  • Loading branch information
Peefy authored Nov 7, 2024
2 parents e7ebe56 + d035641 commit 92de99c
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 11 deletions.
2 changes: 1 addition & 1 deletion api/kclrun/v1alpha1/kclrun_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type KCLRunSpec struct {
// Source is a required field for providing a KCL script inline.
Source string `json:"source" yaml:"source"`
// Params are the parameters in key-value pairs format.
Params map[string]runtime.RawExtension `json:"params,omitempty" yaml:"params,omitempty"`
Params runtime.RawExtension `json:"params,omitempty" yaml:"params,omitempty"`
}

// KCLRunStatus defines the observed state of KCLRun
Expand Down
7 changes: 0 additions & 7 deletions api/kclrun/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions config/crd/bases/krm.kcl.dev_kclruns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@ spec:
description: KCLRunSpec defines the desired state of KCLRun
properties:
params:
additionalProperties:
type: object
x-kubernetes-preserve-unknown-fields: true
description: Params are the parameters in key-value pairs format.
type: object
x-kubernetes-preserve-unknown-fields: true
source:
description: Source is a required field for providing a KCL script
inline.
Expand Down
25 changes: 25 additions & 0 deletions scripts/deploy_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,29 @@ EOF
else
echo -e "${RED}The annotation 'managed-by: kcl-operator' is not added to the pod.${NC}"
fi
kubectl apply -f- << EOF
apiVersion: krm.kcl.dev/v1alpha1
kind: KCLRun
metadata:
name: web-service
annotations:
krm.kcl.dev/version: 0.0.1
krm.kcl.dev/type: abstraction
documentation: >-
Web service application abstraction
spec:
params:
name: app
containers:
nginx:
image: nginx
ports:
- containerPort: 80
service:
ports:
- port: 80
labels:
name: app
source: ./examples/abstraction/web-service/main.k
EOF
fi

0 comments on commit 92de99c

Please sign in to comment.