Skip to content

Commit

Permalink
update poddecoration additionalPrinterColumns
Browse files Browse the repository at this point in the history
  • Loading branch information
Eikykun committed Dec 28, 2023
1 parent 85dc33c commit 3a8ec6b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 29 deletions.
17 changes: 8 additions & 9 deletions apis/apps/v1alpha1/poddecoration_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ type PodDecorationWorkloadDetail struct {
}

type PodDecorationPodInfo struct {
Name string `json:"name,omitempty"`
Revision string `json:"revision,omitempty"`
IsNotInjected bool `json:"isNotInjected,omitempty"`
Name string `json:"name,omitempty"`
Revision string `json:"revision,omitempty"`
Escaped bool `json:"escaped,omitempty"`
}

type PodDecorationCondition struct {
Expand Down Expand Up @@ -276,12 +276,11 @@ type PodDecorationCondition struct {
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:resource:shortName=pd
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="DESIRED",type="integer",JSONPath=".spec.replicas",description="The desired number of pods."
// +kubebuilder:printcolumn:name="CURRENT",type="integer",JSONPath=".status.replicas",description="The number of currently all pods."
// +kubebuilder:printcolumn:name="AVAILABLE",type="integer",JSONPath=".status.availableReplicas",description="The number of pods available."
// +kubebuilder:printcolumn:name="UPDATED",type="integer",JSONPath=".status.updatedReplicas",description="The number of pods updated."
// +kubebuilder:printcolumn:name="UPDATED_READY",type="integer",JSONPath=".status.updatedReadyReplicas",description="The number of pods ready."
// +kubebuilder:printcolumn:name="UPDATED_AVAILABLE",type="integer",JSONPath=".status.updatedAvailableReplicas",description="The number of pods updated available."
// +kubebuilder:printcolumn:name="EFFECTIVE",type="boolean",JSONPath=".status.isEffective",description="The number of pods updated."
// +kubebuilder:printcolumn:name="MATCHED",type="integer",JSONPath=".status.matchedPods",description="The number of selected pods."
// +kubebuilder:printcolumn:name="INJECTED",type="integer",JSONPath=".status.injectedPods",description="The number of injected pods."
// +kubebuilder:printcolumn:name="UPDATED",type="integer",JSONPath=".status.updatedPods",description="The number of updated pods."
// +kubebuilder:printcolumn:name="UPDATED_READY",type="integer",JSONPath=".status.updatedReadyPods",description="The number of pods ready."
// +kubebuilder:printcolumn:name="CURRENT_REVISION",type="string",JSONPath=".status.currentRevision",description="The current revision."
// +kubebuilder:printcolumn:name="UPDATED_REVISION",type="string",JSONPath=".status.updatedRevision",description="The updated revision."
// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp"
Expand Down
32 changes: 14 additions & 18 deletions config/crd/bases/apps.kusionstack.io_poddecorations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,26 @@ spec:
scope: Namespaced
versions:
- additionalPrinterColumns:
- description: The desired number of pods.
jsonPath: .spec.replicas
name: DESIRED
type: integer
- description: The number of currently all pods.
jsonPath: .status.replicas
name: CURRENT
- description: The number of pods updated.
jsonPath: .status.isEffective
name: EFFECTIVE
type: boolean
- description: The number of selected pods.
jsonPath: .status.matchedPods
name: MATCHED
type: integer
- description: The number of pods available.
jsonPath: .status.availableReplicas
name: AVAILABLE
- description: The number of injected pods.
jsonPath: .status.injectedPods
name: INJECTED
type: integer
- description: The number of pods updated.
jsonPath: .status.updatedReplicas
- description: The number of updated pods.
jsonPath: .status.updatedPods
name: UPDATED
type: integer
- description: The number of pods ready.
jsonPath: .status.updatedReadyReplicas
jsonPath: .status.updatedReadyPods
name: UPDATED_READY
type: integer
- description: The number of pods updated available.
jsonPath: .status.updatedAvailableReplicas
name: UPDATED_AVAILABLE
type: integer
- description: The current revision.
jsonPath: .status.currentRevision
name: CURRENT_REVISION
Expand Down Expand Up @@ -5425,7 +5421,7 @@ spec:
pods:
items:
properties:
isNotInjected:
escaped:
type: boolean
name:
type: string
Expand Down
4 changes: 2 additions & 2 deletions pkg/controllers/poddecoration/poddecoration_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ func (r *ReconcilePodDecoration) calculateStatus(
}
if !disablePodDetail {
podInfo := appsv1alpha1.PodDecorationPodInfo{
Name: pod.Name,
IsNotInjected: currentRevision == nil,
Name: pod.Name,
Escaped: currentRevision == nil,
}
if currentRevision != nil {
podInfo.Revision = *currentRevision
Expand Down

0 comments on commit 3a8ec6b

Please sign in to comment.