summaryrefslogtreecommitdiff
path: root/cloud
diff options
context:
space:
mode:
authorKubeEdge Bot <48982446+kubeedge-bot@users.noreply.github.com>2024-08-27 11:58:38 +0800
committerGitHub <noreply@github.com>2024-08-27 11:58:38 +0800
commitaa7494f677a3505e01743ac65f2d04a3b2c6a281 (patch)
treefbdcb64689b2880bd97091fcca8917898fdaa92d /cloud
parentMerge pull request #5808 from Catherine-monk/kubeedge/makefile (diff)
parentMake kubeedge time international (diff)
downloadkubeedge-origin/HEAD.tar.gz
Merge pull request #5817 from WillardHu/time-utcorigin/masterorigin/HEAD
Make the timestamps of kubeedge resources support international time
Diffstat (limited to 'cloud')
-rw-r--r--cloud/pkg/taskmanager/imageprepullcontroller/image_prepull_task.go5
-rw-r--r--cloud/pkg/taskmanager/nodeupgradecontroller/upgrade_task.go5
-rw-r--r--cloud/pkg/taskmanager/util/util.go4
3 files changed, 5 insertions, 9 deletions
diff --git a/cloud/pkg/taskmanager/imageprepullcontroller/image_prepull_task.go b/cloud/pkg/taskmanager/imageprepullcontroller/image_prepull_task.go
index aedd8fe08..dcf8988a1 100644
--- a/cloud/pkg/taskmanager/imageprepullcontroller/image_prepull_task.go
+++ b/cloud/pkg/taskmanager/imageprepullcontroller/image_prepull_task.go
@@ -27,7 +27,6 @@ import (
v1alpha12 "github.com/kubeedge/api/apis/fsm/v1alpha1"
"github.com/kubeedge/api/apis/operations/v1alpha1"
"github.com/kubeedge/kubeedge/cloud/pkg/common/client"
- "github.com/kubeedge/kubeedge/cloud/pkg/taskmanager/util"
"github.com/kubeedge/kubeedge/pkg/util/fsm"
)
@@ -71,7 +70,7 @@ func updatePrePullNodeState(id, nodeName string, state v1alpha12.State, event fs
State: state,
Event: event.Type,
Action: event.Action,
- Time: time.Now().Format(util.ISO8601UTC),
+ Time: time.Now().UTC().Format(time.RFC3339),
Reason: event.Msg,
},
ImageStatus: imagesStatus,
@@ -122,7 +121,7 @@ func updateUpgradeTaskState(id, _ string, state v1alpha12.State, event fsm.Event
status.Action = event.Action
status.Reason = event.Msg
status.State = state
- status.Time = time.Now().Format(util.ISO8601UTC)
+ status.Time = time.Now().UTC().Format(time.RFC3339)
err := patchStatus(newTask, *status, client.GetCRDClient())
diff --git a/cloud/pkg/taskmanager/nodeupgradecontroller/upgrade_task.go b/cloud/pkg/taskmanager/nodeupgradecontroller/upgrade_task.go
index 14f8873c9..ab269e744 100644
--- a/cloud/pkg/taskmanager/nodeupgradecontroller/upgrade_task.go
+++ b/cloud/pkg/taskmanager/nodeupgradecontroller/upgrade_task.go
@@ -24,7 +24,6 @@ import (
v1alpha12 "github.com/kubeedge/api/apis/fsm/v1alpha1"
"github.com/kubeedge/api/apis/operations/v1alpha1"
"github.com/kubeedge/kubeedge/cloud/pkg/common/client"
- "github.com/kubeedge/kubeedge/cloud/pkg/taskmanager/util"
"github.com/kubeedge/kubeedge/pkg/util/fsm"
)
@@ -62,7 +61,7 @@ func updateUpgradeNodeState(id, nodeName string, state v1alpha12.State, event fs
State: state,
Event: event.Type,
Action: event.Action,
- Time: time.Now().Format(util.ISO8601UTC),
+ Time: time.Now().UTC().Format(time.RFC3339),
Reason: event.Msg,
}
break
@@ -111,7 +110,7 @@ func updateUpgradeTaskState(id, _ string, state v1alpha12.State, event fsm.Event
status.Action = event.Action
status.Reason = event.Msg
status.State = state
- status.Time = time.Now().Format(util.ISO8601UTC)
+ status.Time = time.Now().UTC().Format(time.RFC3339)
err := patchStatus(newTask, *status, client.GetCRDClient())
diff --git a/cloud/pkg/taskmanager/util/util.go b/cloud/pkg/taskmanager/util/util.go
index e998047a5..400c48b67 100644
--- a/cloud/pkg/taskmanager/util/util.go
+++ b/cloud/pkg/taskmanager/util/util.go
@@ -22,7 +22,7 @@ import (
"github.com/distribution/distribution/v3/reference"
metav1 "k8s.io/api/core/v1"
- "k8s.io/apimachinery/pkg/apis/meta/v1"
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
versionutil "k8s.io/apimachinery/pkg/util/version"
"k8s.io/klog/v2"
@@ -41,8 +41,6 @@ const (
TaskRollback = "rollback"
TaskBackup = "backup"
TaskPrePull = "prepull"
-
- ISO8601UTC = "2006-01-02T15:04:05Z"
)
type TaskMessage struct {