diff --git a/Makefile b/Makefile index 1a36a410..29a4c608 100644 --- a/Makefile +++ b/Makefile @@ -82,13 +82,13 @@ vet: $(config) .PHONY: test test: $(config) - go test ./... + TZ=UTC go test ./... .PHONY: test-cover test-cover: $(config) rm -rf coverage mkdir coverage - go list -f '{{if gt (len .TestGoFiles) 0}}"go test -covermode count -coverprofile {{.Name}}.coverprofile -coverpkg ./... {{.ImportPath}}"{{end}}' ./... | xargs -I {} bash -c {} + go list -f '{{if gt (len .TestGoFiles) 0}}"TZ=UTC go test -covermode count -coverprofile {{.Name}}.coverprofile -coverpkg ./... {{.ImportPath}}"{{end}}' ./... | xargs -I {} bash -c {} echo "mode: count" >coverage/cover.out grep -h -v "^mode:" *.coverprofile >>"coverage/cover.out" rm *.coverprofile diff --git a/internal/app/wwctl/container/list/main.go b/internal/app/wwctl/container/list/main.go index 59a30c5a..8e91e1f3 100644 --- a/internal/app/wwctl/container/list/main.go +++ b/internal/app/wwctl/container/list/main.go @@ -27,10 +27,6 @@ func CobraRunE(vars *variables) func(cmd *cobra.Command, args []string) (err err for i := 0; i < len(containerInfo); i++ { createTime := time.Unix(int64(containerInfo[i].CreateDate), 0) modTime := time.Unix(int64(containerInfo[i].ModDate), 0) - if vars.utc { - createTime = createTime.UTC() - modTime = modTime.UTC() - } sz := util.ByteToString(int64(containerInfo[i].ImgSize)) if vars.compressed { sz = util.ByteToString(int64(containerInfo[i].ImgSizeComp)) diff --git a/internal/app/wwctl/container/list/main_test.go b/internal/app/wwctl/container/list/main_test.go index 3816cb2e..35d52955 100644 --- a/internal/app/wwctl/container/list/main_test.go +++ b/internal/app/wwctl/container/list/main_test.go @@ -27,7 +27,7 @@ func Test_List_Args(t *testing.T) { `, fail: false, }, - {args: []string{"-ul"}, + {args: []string{"-l"}, output: ` CONTAINER NAME NODES KERNEL VERSION CREATION TIME MODIFICATION TIME SIZE test 0 02 Jan 00 03:04 UTC 01 Jan 70 00:00 UTC 0 B `, diff --git a/internal/app/wwctl/container/list/root.go b/internal/app/wwctl/container/list/root.go index 09b9d82b..04c8db95 100644 --- a/internal/app/wwctl/container/list/root.go +++ b/internal/app/wwctl/container/list/root.go @@ -10,7 +10,6 @@ type variables struct { kernel bool chroot bool compressed bool - utc bool } // GetRootCommand returns the root cobra.Command for the application. @@ -29,6 +28,5 @@ func GetCommand() *cobra.Command { baseCmd.PersistentFlags().BoolVarP(&vars.size, "size", "s", false, "show size information") baseCmd.PersistentFlags().BoolVarP(&vars.chroot, "chroot", "c", false, "show size of chroot") baseCmd.PersistentFlags().BoolVar(&vars.compressed, "compressed", false, "show size of the compressed image") - baseCmd.PersistentFlags().BoolVarP(&vars.utc, "utc", "u", false, "use UTC for time output") return baseCmd }