diff options
| author | KubeEdge Bot <48982446+kubeedge-bot@users.noreply.github.com> | 2024-01-17 17:50:27 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-17 17:50:27 +0800 |
| commit | dadbeb0e72565822afca48cb3f66a17473d7d585 (patch) | |
| tree | 253eded79262e2f0d83a3da66ae945c9985eec0f /common | |
| parent | Merge pull request #5321 from luomengY/ci-cri (diff) | |
| parent | support edge nodes upgrade and image pre pull (diff) | |
| download | kubeedge-dadbeb0e72565822afca48cb3f66a17473d7d585.tar.gz | |
Merge pull request #5330 from ZhengXinwei-F/task-manager
Implement task manager to complete cloud edge task execution
Diffstat (limited to 'common')
| -rw-r--r-- | common/constants/default.go | 3 | ||||
| -rw-r--r-- | common/types/types.go | 35 |
2 files changed, 36 insertions, 2 deletions
diff --git a/common/constants/default.go b/common/constants/default.go index fab460eee..6b1e5c9da 100644 --- a/common/constants/default.go +++ b/common/constants/default.go @@ -28,6 +28,7 @@ const ( DefaultCAURL = "/ca.crt" DefaultCertURL = "/edge.crt" DefaultNodeUpgradeURL = "/nodeupgrade" + DefaultTaskStateReportURL = "/task/{taskType}/name/{taskID}/node/{nodeID}/status" DefaultServiceAccountIssuer = "https://kubernetes.default.svc.cluster.local" // Edged @@ -112,7 +113,7 @@ const ( DefaultDeviceModelEventBuffer = 1 DefaultUpdateDeviceStatusWorkers = 1 - // NodeUpgradeJobController + // TaskManager DefaultNodeUpgradeJobStatusBuffer = 1024 DefaultNodeUpgradeJobEventBuffer = 1 DefaultNodeUpgradeJobWorkers = 1 diff --git a/common/types/types.go b/common/types/types.go index e03667a1b..dfe14dad1 100644 --- a/common/types/types.go +++ b/common/types/types.go @@ -6,6 +6,7 @@ import ( metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + api "github.com/kubeedge/kubeedge/pkg/apis/fsm/v1alpha1" "github.com/kubeedge/kubeedge/pkg/apis/operations/v1alpha1" ) @@ -50,6 +51,38 @@ type NodeUpgradeJobResponse struct { Reason string } +// NodePreCheckRequest is pre-check msg coming from cloud to edge +type NodePreCheckRequest struct { + CheckItem []string +} + +type NodeTaskRequest struct { + TaskID string + Type string + State string + Item interface{} +} + +type NodeTaskResponse struct { + // NodeName is the name of edge node. + NodeName string + // State represents for the upgrade state phase of the edge node. + // There are several possible state values: "", Upgrading, BackingUp, RollingBack and Checking. + State api.State + // Event represents for the event of the ImagePrePullJob. + // There are three possible event values: Init, Check, Pull. + Event string + // Action represents for the action of the ImagePrePullJob. + // There are three possible action values: Success, Failure, TimeOut. + Action api.Action + // Reason represents for the reason of the ImagePrePullJob. + Reason string + // Time represents for the running time of the ImagePrePullJob. + Time string + + ExternalMessage string +} + // ObjectResp is the object that api-server response type ObjectResp struct { Object metaV1.Object @@ -68,7 +101,7 @@ type ImagePrePullJobRequest struct { // ImagePrePullJobResponse is used to report status msg to cloudhub https service from each node type ImagePrePullJobResponse struct { NodeName string - State v1alpha1.PrePullState + State string Reason string ImageStatus []v1alpha1.ImageStatus } |
