Skip to content

Commit

Permalink
Merge pull request volcano-sh#321 from k82cn/ka_318_3
Browse files Browse the repository at this point in the history
Added PodGroup status.
  • Loading branch information
k82cn authored Aug 10, 2018
2 parents 0c30228 + 0908a38 commit af42ff4
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 3 deletions.
12 changes: 12 additions & 0 deletions config/crds/core_v1alpha1_podgroup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,17 @@ spec:
format: int32
type: integer
type: object
status:
properties:
succeeded:
format: int32
type: integer
failed:
format: int32
type: integer
running:
format: int32
type: integer
type: object
type: object
version: v1alpha1
4 changes: 2 additions & 2 deletions config/crds/extensions_v1alpha1_job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spec:
type: object
status:
properties:
Succeeded:
succeeded:
format: int32
type: integer
failed:
Expand All @@ -56,4 +56,4 @@ spec:
type: integer
type: object
type: object
version: v1alpha1
version: v1alpha1
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ type PodGroup struct {
// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
// +optional
Spec PodGroupSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`

// Status represents the current information about a pod group.
// This data may not be up to date.
// +optional
Status PodGroupStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}

// PodGroupSpec represents the template of a pod group.
Expand All @@ -45,6 +50,19 @@ type PodGroupSpec struct {
NumMember int32 `json:"numMember,omitempty" protobuf:"bytes,1,opt,name=numMember"`
}

// PodGroupStatus represents the current state of a pod group.
type PodGroupStatus struct {
// The number of actively running pods.
// +optional
Running int32 `json:"running,omitempty" protobuf:"bytes,3,opt,name=running"`
// The number of pods which reached phase Succeeded.
// +optional
Succeeded int32 `json:"succeeded,omitempty" protobuf:"bytes,3,opt,name=succeeded"`
// The number of pods which reached phase Failed.
// +optional
Failed int32 `json:"failed,omitempty" protobuf:"bytes,3,opt,name=failed"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// PodGroupList is a collection of pod groups.
Expand Down
17 changes: 17 additions & 0 deletions pkg/apis/core/v1alpha1/zz_generated.deepcopy.go

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

2 changes: 1 addition & 1 deletion pkg/apis/extensions/v1alpha1/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ type JobStatus struct {

// The number of pods which reached phase Succeeded.
// +optional
Succeeded int32 `json:"Succeeded,omitempty" protobuf:"bytes,3,opt,name=succeeded"`
Succeeded int32 `json:"succeeded,omitempty" protobuf:"bytes,3,opt,name=succeeded"`

// The number of pods which reached phase Failed.
// +optional
Expand Down

0 comments on commit af42ff4

Please sign in to comment.