From a69a16029e150ea9be7e5a308205afe7d97a13eb Mon Sep 17 00:00:00 2001 From: Steven Fairchild Date: Wed, 3 Jul 2024 12:05:55 -0400 Subject: [PATCH] Bump Hive Image to commit b1ac27b248159f179abf8c7e03e6ada5f17e86c0 - ARO-5063 Update default hive commit for config script --- cmd/aro/mirror.go | 2 +- go.mod | 8 ++-- go.sum | 4 +- hack/hive-generate-config.sh | 2 +- vendor/k8s.io/klog/v2/klog.go | 76 +++++++++++++++-------------------- vendor/modules.txt | 8 ++-- 6 files changed, 44 insertions(+), 56 deletions(-) diff --git a/cmd/aro/mirror.go b/cmd/aro/mirror.go index b64be575d..832838e92 100644 --- a/cmd/aro/mirror.go +++ b/cmd/aro/mirror.go @@ -111,7 +111,7 @@ func mirror(ctx context.Context, log *logrus.Entry) error { "quay.io/app-sre/managed-upgrade-operator:v0.1.952-44b631a", // https://quay.io/repository/app-sre/hive?tab=tags - "quay.io/app-sre/hive:d7ead609f4", + "quay.io/app-sre/hive:b1ac27b248", } { log.Printf("mirroring %s -> %s", ref, pkgmirror.Dest(dstAcr+acrDomainSuffix, ref)) diff --git a/go.mod b/go.mod index 263c8f4f1..27fafbbf0 100644 --- a/go.mod +++ b/go.mod @@ -62,7 +62,7 @@ require ( github.com/openshift/api v3.9.1-0.20191111211345-a27ff30ebf09+incompatible github.com/openshift/client-go v0.0.0-20220525160904-9e1acff93e4a github.com/openshift/cloud-credential-operator v0.0.0-00010101000000-000000000000 - github.com/openshift/hive/apis v0.0.0-20240529172037-d7ead609f495 + github.com/openshift/hive/apis v0.0.0-20240627073933-b1ac27b24815 github.com/openshift/library-go v0.0.0-20220525173854-9b950a41acdc github.com/openshift/machine-config-operator v0.0.1-0.20230519222939-1abc13efbb0d github.com/pires/go-proxyproto v0.6.2 @@ -84,9 +84,9 @@ require ( golang.org/x/text v0.16.0 golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d gopkg.in/go-jose/go-jose.v2 v2.6.1 - k8s.io/api v0.30.1 + k8s.io/api v0.30.2 k8s.io/apiextensions-apiserver v0.25.0 - k8s.io/apimachinery v0.30.1 + k8s.io/apimachinery v0.30.2 k8s.io/cli-runtime v0.25.16 k8s.io/client-go v0.26.2 k8s.io/code-generator v0.25.16 @@ -274,7 +274,7 @@ require ( k8s.io/apiserver v0.26.2 // indirect k8s.io/component-base v0.26.2 // indirect k8s.io/gengo v0.0.0-20211129171323-c02415ce4185 // indirect - k8s.io/klog/v2 v2.120.1 // indirect + k8s.io/klog/v2 v2.130.1 // indirect k8s.io/kube-aggregator v0.24.1 // indirect k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect diff --git a/go.sum b/go.sum index f15a18df0..e82e385a9 100644 --- a/go.sum +++ b/go.sum @@ -807,8 +807,8 @@ k8s.io/component-base v0.25.16 h1:ywaMQRJoCCQwWSM6z9jC+RJWBY/CcJDVgnyyIhuNAkQ= k8s.io/component-base v0.25.16/go.mod h1:ZMFrcDjbpM12U5hvZ8bXgPf9U2Wrp0McSGMhoUkA9Mo= k8s.io/gengo v0.0.0-20211129171323-c02415ce4185 h1:TT1WdmqqXareKxZ/oNXEUSwKlLiHzPMyB0t8BaFeBYI= k8s.io/gengo v0.0.0-20211129171323-c02415ce4185/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= -k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= +k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-aggregator v0.25.16 h1:yvWWF2bHyuNQ/dMwgWcbh3MkYl1hwl2A7dMwvMMwMIg= k8s.io/kube-aggregator v0.25.16/go.mod h1:fmC08uLMNFUQj1pvtCYL0cTjhq+KDC9o31p51aH9dLE= k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 h1:MQ8BAZPZlWk3S9K4a9NCkIFQtZShWqoha7snGixVgEA= diff --git a/hack/hive-generate-config.sh b/hack/hive-generate-config.sh index 3900a0df3..ef5193b55 100755 --- a/hack/hive-generate-config.sh +++ b/hack/hive-generate-config.sh @@ -9,7 +9,7 @@ main() { trap "cleanup $tmpdir" EXIT # This is the commit sha that the image was built from and ensures we use the correct configs for the release - local -r default_commit="d7ead609f4" + local -r default_commit="b1ac27b248" local -r hive_image_commit_hash="${1:-$default_commit}" log "Using hive commit: $hive_image_commit_hash" # shellcheck disable=SC2034 diff --git a/vendor/k8s.io/klog/v2/klog.go b/vendor/k8s.io/klog/v2/klog.go index 026be9e3b..47ec9466a 100644 --- a/vendor/k8s.io/klog/v2/klog.go +++ b/vendor/k8s.io/klog/v2/klog.go @@ -404,13 +404,6 @@ func (t *traceLocation) Set(value string) error { return nil } -// flushSyncWriter is the interface satisfied by logging destinations. -type flushSyncWriter interface { - Flush() error - Sync() error - io.Writer -} - var logging loggingT var commandLine flag.FlagSet @@ -486,7 +479,7 @@ type settings struct { // Access to all of the following fields must be protected via a mutex. // file holds writer for each of the log types. - file [severity.NumSeverity]flushSyncWriter + file [severity.NumSeverity]io.Writer // flushInterval is the interval for periodic flushing. If zero, // the global default will be used. flushInterval time.Duration @@ -831,32 +824,12 @@ func (l *loggingT) printS(err error, s severity.Severity, depth int, msg string, buffer.PutBuffer(b) } -// redirectBuffer is used to set an alternate destination for the logs -type redirectBuffer struct { - w io.Writer -} - -func (rb *redirectBuffer) Sync() error { - return nil -} - -func (rb *redirectBuffer) Flush() error { - return nil -} - -func (rb *redirectBuffer) Write(bytes []byte) (n int, err error) { - return rb.w.Write(bytes) -} - // SetOutput sets the output destination for all severities func SetOutput(w io.Writer) { logging.mu.Lock() defer logging.mu.Unlock() for s := severity.FatalLog; s >= severity.InfoLog; s-- { - rb := &redirectBuffer{ - w: w, - } - logging.file[s] = rb + logging.file[s] = w } } @@ -868,10 +841,7 @@ func SetOutputBySeverity(name string, w io.Writer) { if !ok { panic(fmt.Sprintf("SetOutputBySeverity(%q): unrecognized severity name", name)) } - rb := &redirectBuffer{ - w: w, - } - logging.file[sev] = rb + logging.file[sev] = w } // LogToStderr sets whether to log exclusively to stderr, bypassing outputs @@ -1011,7 +981,8 @@ func (l *loggingT) exit(err error) { logExitFunc(err) return } - l.flushAll() + needToSync := l.flushAll() + l.syncAll(needToSync) OsExit(2) } @@ -1028,10 +999,6 @@ type syncBuffer struct { maxbytes uint64 // The max number of bytes this syncBuffer.file can hold before cleaning up. } -func (sb *syncBuffer) Sync() error { - return sb.file.Sync() -} - // CalculateMaxSize returns the real max size in bytes after considering the default max size and the flag options. func CalculateMaxSize() uint64 { if logging.logFile != "" { @@ -1223,24 +1190,45 @@ func StartFlushDaemon(interval time.Duration) { // lockAndFlushAll is like flushAll but locks l.mu first. func (l *loggingT) lockAndFlushAll() { l.mu.Lock() - l.flushAll() + needToSync := l.flushAll() l.mu.Unlock() + // Some environments are slow when syncing and holding the lock might cause contention. + l.syncAll(needToSync) } -// flushAll flushes all the logs and attempts to "sync" their data to disk. +// flushAll flushes all the logs // l.mu is held. -func (l *loggingT) flushAll() { +// +// The result is the number of files which need to be synced and the pointers to them. +func (l *loggingT) flushAll() fileArray { + var needToSync fileArray + // Flush from fatal down, in case there's trouble flushing. for s := severity.FatalLog; s >= severity.InfoLog; s-- { file := l.file[s] - if file != nil { - _ = file.Flush() // ignore error - _ = file.Sync() // ignore error + if sb, ok := file.(*syncBuffer); ok && sb.file != nil { + _ = sb.Flush() // ignore error + needToSync.files[needToSync.num] = sb.file + needToSync.num++ } } if logging.loggerOptions.flush != nil { logging.loggerOptions.flush() } + return needToSync +} + +type fileArray struct { + num int + files [severity.NumSeverity]*os.File +} + +// syncAll attempts to "sync" their data to disk. +func (l *loggingT) syncAll(needToSync fileArray) { + // Flush from fatal down, in case there's trouble flushing. + for i := 0; i < needToSync.num; i++ { + _ = needToSync.files[i].Sync() // ignore error + } } // CopyStandardLogTo arranges for messages written to the Go "log" package's diff --git a/vendor/modules.txt b/vendor/modules.txt index 7f673e9ca..050adaa72 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1098,7 +1098,7 @@ github.com/openshift/cloud-credential-operator/pkg/apis/cloudcredential/v1 # github.com/openshift/custom-resource-status v1.1.3-0.20220503160415-f2fdb4999d87 ## explicit; go 1.12 github.com/openshift/custom-resource-status/conditions/v1 -# github.com/openshift/hive/apis v0.0.0-20240529172037-d7ead609f495 => github.com/openshift/hive/apis v0.0.0-20231116161336-9dd47f8bfa1f +# github.com/openshift/hive/apis v0.0.0-20240627073933-b1ac27b24815 => github.com/openshift/hive/apis v0.0.0-20231116161336-9dd47f8bfa1f ## explicit; go 1.20 github.com/openshift/hive/apis/hive/v1 github.com/openshift/hive/apis/hive/v1/agent @@ -1596,7 +1596,7 @@ gopkg.in/yaml.v2 # gopkg.in/yaml.v3 v3.0.1 ## explicit gopkg.in/yaml.v3 -# k8s.io/api v0.30.1 => k8s.io/api v0.25.16 +# k8s.io/api v0.30.2 => k8s.io/api v0.25.16 ## explicit; go 1.19 k8s.io/api/admission/v1 k8s.io/api/admission/v1beta1 @@ -1665,7 +1665,7 @@ k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1 k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1 k8s.io/apiextensions-apiserver/third_party/forked/celopenapi/model -# k8s.io/apimachinery v0.30.1 => k8s.io/apimachinery v0.25.16 +# k8s.io/apimachinery v0.30.2 => k8s.io/apimachinery v0.25.16 ## explicit; go 1.19 k8s.io/apimachinery/pkg/api/equality k8s.io/apimachinery/pkg/api/errors @@ -2058,7 +2058,7 @@ k8s.io/gengo/generator k8s.io/gengo/namer k8s.io/gengo/parser k8s.io/gengo/types -# k8s.io/klog/v2 v2.120.1 +# k8s.io/klog/v2 v2.130.1 ## explicit; go 1.18 k8s.io/klog/v2 k8s.io/klog/v2/internal/buffer