mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-12-07 16:45:35 +00:00
fix(timezone): the timezone is standardized to UTC
Signed-off-by: cndoit18 <cndoit18@outlook.com>
This commit is contained in:
@@ -23,7 +23,7 @@ import (
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"k8s.io/api/core/v1"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
@@ -79,9 +79,9 @@ func addSecretExpiration(s *v1.Secret, expiration string) {
|
||||
}
|
||||
|
||||
// TimeStringFromNow returns the time as a string from now.
|
||||
// e.g: 2019-12-03T14:30:40+08:00.
|
||||
// e.g: 2019-12-03T06:30:40Z.
|
||||
func TimeStringFromNow(delta time.Duration) string {
|
||||
return time.Now().Add(delta).Format(time.RFC3339)
|
||||
return time.Now().Add(delta).UTC().Format(time.RFC3339)
|
||||
}
|
||||
|
||||
// WaitforSignedClusterInfoByBootStrapToken waits for signed cluster info by bootstrap token.
|
||||
|
||||
@@ -72,7 +72,7 @@ func TestBootstrapTokenAuth(t *testing.T) {
|
||||
bootstrapapi.BootstrapTokenUsageAuthentication: []byte("true"),
|
||||
},
|
||||
}
|
||||
tokenExpiredTime := time.Now().Add(-time.Hour).Format(time.RFC3339)
|
||||
tokenExpiredTime := time.Now().UTC().Add(-time.Hour).Format(time.RFC3339)
|
||||
var expiredBootstrapToken = &corev1.Secret{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Namespace: metav1.NamespaceSystem,
|
||||
|
||||
Reference in New Issue
Block a user