We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libfaketime 有支援相對時間的用法:https://github.com/wolfcw/libfaketime#:~:text=4d)%20Using%20offsets%20for%20relative%20dates
如 "-120" 或是 "+120" 等等
儘管在 yaml 中看似可以傳入相對時間,但是在 plugin 中都是轉成了絕對時間:https://github.com/CloudNativeGame/fake-time-injector/blob/main/plugins/faketime/faketime.go#L56
func calculateFakeTime(t string) (string, error) { if strings.Contains(t, ":") { t_, err := time.Parse("2006-01-02 15:04:05", t) if err != nil { return "", err } s := t_.UTC().String() return s, nil } // 解析时间间隔字符串为Duration类型 duration, err := time.ParseDuration(t) if err != nil { return "", err } s := time.Now().UTC().Add(duration).String() return s, nil }
而 libFakeTimePatches 是直接使用了這個絕對時間:https://github.com/CloudNativeGame/fake-time-injector/blob/main/plugins/faketime/faketime.go#L217
Env := []apiv1.EnvVar{ {Name: "LD_PRELOAD", Value: LibFakeTimePath}, {Name: "FAKETIME", Value: fmt.Sprintf("@%s", fakeTime)}, }
這造成了在 libfaketime 中無法使用相對時間來調整,希望能加上相關功能,能夠讓 FAKETIME 也支援如 "+120" 這類的語法,或至少在 annotation 的參數如果是數字的話,就直接使用這個數字,而不是用 calculateFakeTime 回傳新的 date time
The text was updated successfully, but these errors were encountered:
@huli-ctw 已支持相对时间 #24
Sorry, something went wrong.
No branches or pull requests
libfaketime 有支援相對時間的用法:https://github.com/wolfcw/libfaketime#:~:text=4d)%20Using%20offsets%20for%20relative%20dates
如 "-120" 或是 "+120" 等等
儘管在 yaml 中看似可以傳入相對時間,但是在 plugin 中都是轉成了絕對時間:https://github.com/CloudNativeGame/fake-time-injector/blob/main/plugins/faketime/faketime.go#L56
而 libFakeTimePatches 是直接使用了這個絕對時間:https://github.com/CloudNativeGame/fake-time-injector/blob/main/plugins/faketime/faketime.go#L217
這造成了在 libfaketime 中無法使用相對時間來調整,希望能加上相關功能,能夠讓 FAKETIME 也支援如 "+120" 這類的語法,或至少在 annotation 的參數如果是數字的話,就直接使用這個數字,而不是用 calculateFakeTime 回傳新的 date time
The text was updated successfully, but these errors were encountered: