Skip to content

Commit

Permalink
feat: add printcolumn to RAG Engine (#623)
Browse files Browse the repository at this point in the history
**Reason for Change**:
add printcolumn to RAG Engine

**Requirements**

- [ ] added unit tests and e2e tests (if applicable).

**Issue Fixed**:
<!-- If this PR fixes GitHub issue 4321, add "Fixes #4321" to the next
line. -->

**Notes for Reviewers**:

Signed-off-by: Bangqi Zhu <bangqizhu@microsoft.com>
Co-authored-by: Bangqi Zhu <bangqizhu@microsoft.com>
  • Loading branch information
bangqipropel and Bangqi Zhu authored Oct 23, 2024
1 parent 0abe5d7 commit 791c175
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 3 deletions.
3 changes: 3 additions & 0 deletions api/v1alpha1/ragengine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ type RAGEngineStatus struct {
// +kubebuilder:subresource:status
// +kubebuilder:resource:path=ragengines,scope=Namespaced,categories=ragengine
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="Instance",type="string",JSONPath=".spec.compute.instanceType",description=""
// +kubebuilder:printcolumn:name="ResourceReady",type="string",JSONPath=".status.conditions[?(@.type==\"ResourceReady\")].status",description=""
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description=""
type RAGEngine struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
12 changes: 11 additions & 1 deletion charts/kaito/ragengine/crds/kaito.sh_ragengines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,17 @@ spec:
singular: ragengine
scope: Namespaced
versions:
- name: v1alpha1
- additionalPrinterColumns:
- jsonPath: .spec.compute.instanceType
name: Instance
type: string
- jsonPath: .status.conditions[?(@.type=="ResourceReady")].status
name: ResourceReady
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: RAGEngine is the Schema for the ragengine API
Expand Down
3 changes: 3 additions & 0 deletions charts/kaito/ragengine/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ rules:
- apiGroups: ["karpenter.sh"]
resources: ["machines", "machines/status", "nodeclaims", "nodeclaims/status"]
verbs: ["get","list","watch","create", "delete", "update", "patch"]
- apiGroups: [ "karpenter.azure.com" ]
resources: [ "aksnodeclasses"]
verbs: [ "get","list","watch","create", "delete", "update", "patch" ]
- apiGroups: ["admissionregistration.k8s.io"]
resources: ["validatingwebhookconfigurations"]
verbs: ["get","list","watch"]
Expand Down
12 changes: 11 additions & 1 deletion config/crd/bases/kaito.sh_ragengines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,17 @@ spec:
singular: ragengine
scope: Namespaced
versions:
- name: v1alpha1
- additionalPrinterColumns:
- jsonPath: .spec.compute.instanceType
name: Instance
type: string
- jsonPath: .status.conditions[?(@.type=="ResourceReady")].status
name: ResourceReady
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: RAGEngine is the Schema for the ragengine API
Expand Down
2 changes: 1 addition & 1 deletion pkg/webhooks/webhooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func NewRAGEngineCRDValidationWebhook(ctx context.Context, _ configmap.Watcher)
return validation.NewAdmissionController(ctx,
"validation.ragengine.kaito.sh",
"/validate/ragengine.kaito.sh",
WorkspaceResources,
RAGEngineResources,
func(ctx context.Context) context.Context { return ctx },
true,
)
Expand Down

0 comments on commit 791c175

Please sign in to comment.