Skip to content

Commit

Permalink
update api
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksontong committed Apr 5, 2024
1 parent d536fc7 commit 0960705
Show file tree
Hide file tree
Showing 19 changed files with 1,966 additions and 175 deletions.
41 changes: 39 additions & 2 deletions api/application/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,43 @@ type UpgradeJob struct {
metav1.TypeMeta
metav1.ObjectMeta

Spec UpgradePolicySpec
Status UpgradePolicyStatus
Spec UpgradeJobSpec
Status UpgradeJobStatus
}

// UpgradeJobSpec is the specification of a upgradeJob.
type UpgradeJobSpec struct {
// TODO: remove to Job
TenantID string // TODO: 全局的,不存在租户间的隔离,也不用对外
Target string
AppRefer string

BatchNum *int32
BatchIntervalSeconds *int32
MaxFailed *int32
MaxSurge *int32
}

// UpgradeJobStatus is the status of a upgradeJob.
type UpgradeJobStatus struct {
// +optional
BatchCompleteNum int32

// +optional
BatchOrder int32

// +optional
BatchUpdatedNode []string

// +optional
BatchStartTime metav1.Time

// +optional
BatchCompleteTime metav1.Time

// +optional
BatchCompleteNodes int32

// +optional
Reason *string
}
1,100 changes: 938 additions & 162 deletions api/application/v1/generated.pb.go

Large diffs are not rendered by default.

62 changes: 60 additions & 2 deletions api/application/v1/generated.proto

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

59 changes: 57 additions & 2 deletions api/application/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,61 @@ type UpgradeJob struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`

Spec UpgradePolicySpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
Status UpgradePolicyStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
Spec UpgradeJobSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
Status UpgradeJobStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}

// UpgradeJobSpec is the specification of a upgradeJob.
type UpgradeJobSpec struct {
TenantID string `json:"tenantID" protobuf:"bytes,1,opt,name=tenantID"`

Target string `json:"target" protobuf:"bytes,2,opt,name=target"`

// +optional
AppRefer string `json:"appRefer" protobuf:"bytes,3,opt,name=appRefer"`

BatchNum *int32 `json:"batchNum" protobuf:"varint,4,opt,name=batchNum"`

// this is set to 30 by default
// +optional
BatchIntervalSeconds *int32 `json:"batchIntervalSeconds" protobuf:"varint,5,opt,name=batchIntervalSeconds"`

// this is set to 0 by default
// +optional
MaxFailed *int32 `json:"maxFailed" protobuf:"varint,6,opt,name=maxFailed"`

// this is set to 3 by default
// +optional
MaxSurge *int32 `json:"maxSurge" protobuf:"varint,7,opt,name=maxSurge"`
}

// UpgradeJobStatus is the status of a upgradeJob.
type UpgradeJobStatus struct {
// number of batches completed currently
// +optional
BatchCompleteNum int32 `json:"batchCompleteNum" protobuf:"varint,1,opt,name=batchCompleteNum"`

// batch num which is being processed
// +optional
BatchOrder int32 `json:"batchOrder" protobuf:"varint,2,opt,name=batchOrder"`

// list of nodes upgraded in the current batch
// +optional
BatchUpdatedNode []string `json:"batchUpdatedNode" protobuf:"bytes,3,opt,name=batchUpdatedNode"`

// start time of the current batch
// +optional
BatchStartTime metav1.Time `json:"batchStartTime" protobuf:"bytes,4,opt,name=batchStartTime"`

// end time of the current batch
// +optional
BatchCompleteTime metav1.Time `json:"batchCompleteTime" protobuf:"bytes,5,opt,name=batchCompleteTime"`

// total number of nodes upgraded
// +optional
BatchCompleteNodes int32 `json:"batchCompleteNodes" protobuf:"varint,6,opt,name=batchCompleteNodes"`

// failed reason
// +optional
Reason *string `json:"reason" protobuf:"varint,7,opt,name=reason"`
}
26 changes: 26 additions & 0 deletions api/application/v1/types_swagger_doc_generated.go

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

94 changes: 90 additions & 4 deletions api/application/v1/zz_generated.conversion.go

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

Loading

0 comments on commit 0960705

Please sign in to comment.