Skip to content

Commit

Permalink
Merge pull request #360 from bjwswang/gql
Browse files Browse the repository at this point in the history
chore: use a more simplified reason Running instead of WorkingRunnig
  • Loading branch information
bjwswang authored Dec 13, 2023
2 parents da12bf8 + 679ad16 commit 5059ecf
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion api/base/v1alpha1/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (worker Worker) ReadyCondition() Condition {
return Condition{
Type: TypeReady,
Status: corev1.ConditionTrue,
Reason: "WorkerRunning",
Reason: "Running",
Message: "Work has been actively running",
LastTransitionTime: metav1.Now(),
LastSuccessfulTime: metav1.Now(),
Expand Down
2 changes: 1 addition & 1 deletion graphql-server/go-server/graph/generated/generated.go

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

2 changes: 1 addition & 1 deletion graphql-server/go-server/graph/generated/models_gen.go

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

2 changes: 1 addition & 1 deletion graphql-server/go-server/graph/schema/worker.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ type Worker {
规则: 目前分为四种状态
- Unknown: 未知
- Pending: 发布中
- WorkerRunning: 已发布
- Running: 已发布
- Error: 异常
"""
status: String
Expand Down
2 changes: 0 additions & 2 deletions graphql-server/go-server/pkg/model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ func obj2model(obj *unstructured.Unstructured) *generated.Model {
// conditioned status
condition := model.Status.GetCondition(v1alpha1.TypeReady)
updateTime := condition.LastTransitionTime.Time

// Unknown,Pending ,WorkerRunning ,Error
status := string(condition.Status)

var systemModel bool
Expand Down
2 changes: 1 addition & 1 deletion graphql-server/go-server/pkg/worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func worker2model(ctx context.Context, c dynamic.Interface, obj *unstructured.Un
condition := worker.Status.GetCondition(v1alpha1.TypeReady)
updateTime := condition.LastTransitionTime.Time

// Unknown,Pending ,WorkerRunning ,Error
// Unknown,Pending ,Running ,Error
status := string(condition.Reason)

// resources
Expand Down

0 comments on commit 5059ecf

Please sign in to comment.