Skip to content

Commit

Permalink
fix admin user time label. (#4160)
Browse files Browse the repository at this point in the history
* fix admin user time label.

Signed-off-by: yy <lingdie.yy@outlook.com>

* fix imports.

Signed-off-by: yy <lingdie.yy@outlook.com>

---------

Signed-off-by: yy <lingdie.yy@outlook.com>
  • Loading branch information
lingdie committed Oct 24, 2023
1 parent 5785d7b commit 03a3a3f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions controllers/job/init/internal/util/controller/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package controller

import (
"context"
"time"

"github.com/labring/sealos/controllers/job/init/internal/util/common"
userv1 "github.com/labring/sealos/controllers/user/api/v1"
Expand Down Expand Up @@ -44,10 +43,10 @@ func newAdminUser(ctx context.Context, c client.Client) (*userv1.User, error) {
return nil, err
}
if u.Labels == nil {
u.SetLabels(map[string]string{"uid": common.AdminUID(), "updateTime": time.Now().Format(time.RFC3339)})
u.SetLabels(map[string]string{"uid": common.AdminUID(), "updateTime": "T2301-01T00-00-00"})
} else if u.Labels["uid"] == "" {
u.Labels["uid"] = common.AdminUID()
u.Labels["updateTime"] = time.Now().Format(time.RFC3339)
u.Labels["updateTime"] = "T2301-01T00-00-00"
}
return u, nil
}
Expand Down

0 comments on commit 03a3a3f

Please sign in to comment.