Remove sub-path from container registry realm (#31293) (#31300)

Backport #31293 by wxiaoguang

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Giteabot 2024-06-10 12:04:49 +08:00 committed by GitHub
parent bbe98a3254
commit 1dc8a66074
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 23 additions and 14 deletions

View file

@ -34,8 +34,10 @@ func IsNormalPageCompleted(s string) bool {
return strings.Contains(s, `<footer class="page-footer"`) && strings.Contains(s, `</html>`)
}
func MockVariableValue[T any](p *T, v T) (reset func()) {
func MockVariableValue[T any](p *T, v ...T) (reset func()) {
old := *p
*p = v
if len(v) > 0 {
*p = v[0]
}
return func() { *p = old }
}