From 808ba2472dff6953f333247d8884625a843cff54 Mon Sep 17 00:00:00 2001 From: Ben Perry Date: Mon, 6 Jul 2026 13:10:22 -0500 Subject: [PATCH] go mod vendor for node replacement fix --- go.mod | 2 ++ go.sum | 4 ++-- operator/applyconfigurations/internal/internal.go | 3 +++ .../applyconfigurations/operator/v1/nodestatus.go | 15 +++++++++++++++ .../openshift/api/envtest-releases.yaml | 13 +++++++++++++ .../github.com/openshift/api/openapi/openapi.json | 4 ++++ .../github.com/openshift/api/operator/v1/types.go | 12 ++++++++++++ .../v1/zz_generated.swagger_doc_generated.go | 1 + vendor/modules.txt | 3 ++- 9 files changed, 54 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 98c079b25b..0edeb8b7c1 100644 --- a/go.mod +++ b/go.mod @@ -2,6 +2,8 @@ module github.com/openshift/client-go go 1.26.0 +replace github.com/openshift/api => github.com/bhperry/openshift-api v0.0.0-20260721140502-5bd0b76d24f2 + require ( github.com/openshift/api v0.0.0-20260721120239-14262bf791c8 github.com/openshift/build-machinery-go v0.0.0-20250530140348-dc5b2804eeee diff --git a/go.sum b/go.sum index 903a6a73dc..f6645a9bb5 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,5 @@ +github.com/bhperry/openshift-api v0.0.0-20260721140502-5bd0b76d24f2 h1:t/7kxLDFVIVsOKSYrRo3dtyd99TXmpvtjPWQOUbMpF0= +github.com/bhperry/openshift-api v0.0.0-20260721140502-5bd0b76d24f2/go.mod h1:k6qH5QOVa5GDln2VVm8Jz4NV3Z7R2SATHFLwGS6Wh3M= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -71,8 +73,6 @@ github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFd github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/openshift/api v0.0.0-20260721120239-14262bf791c8 h1:5U/YDvxGl5u8R576BOi4okum/m7UN4coDSm2UNo3ed8= -github.com/openshift/api v0.0.0-20260721120239-14262bf791c8/go.mod h1:k6qH5QOVa5GDln2VVm8Jz4NV3Z7R2SATHFLwGS6Wh3M= github.com/openshift/build-machinery-go v0.0.0-20250530140348-dc5b2804eeee h1:+Sp5GGnjHDhT/a/nQ1xdp43UscBMr7G5wxsYotyhzJ4= github.com/openshift/build-machinery-go v0.0.0-20250530140348-dc5b2804eeee/go.mod h1:8jcm8UPtg2mCAsxfqKil1xrmRMI3a+XU2TZ9fF8A7TE= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= diff --git a/operator/applyconfigurations/internal/internal.go b/operator/applyconfigurations/internal/internal.go index fac2f41a76..a64eb39f08 100644 --- a/operator/applyconfigurations/internal/internal.go +++ b/operator/applyconfigurations/internal/internal.go @@ -3207,6 +3207,9 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" + - name: nodeUID + type: + scalar: string - name: targetRevision type: scalar: numeric diff --git a/operator/applyconfigurations/operator/v1/nodestatus.go b/operator/applyconfigurations/operator/v1/nodestatus.go index f107c370d2..ab2db04ade 100644 --- a/operator/applyconfigurations/operator/v1/nodestatus.go +++ b/operator/applyconfigurations/operator/v1/nodestatus.go @@ -13,6 +13,13 @@ import ( type NodeStatusApplyConfiguration struct { // nodeName is the name of the node NodeName *string `json:"nodeName,omitempty"` + // nodeUID is the UID of the node. + // This field is used to detect that a node has been deleted and recreated + // with the same name. When the UID changes, it indicates the node is a + // new instance and the controller should treat this status entry as stale. + // When omitted, UID-based node replacement detection is not available + // for this entry. + NodeUID *string `json:"nodeUID,omitempty"` // currentRevision is the generation of the most recently successful deployment. // Can not be set on creation of a nodeStatus. Updates must only increase the value. CurrentRevision *int32 `json:"currentRevision,omitempty"` @@ -47,6 +54,14 @@ func (b *NodeStatusApplyConfiguration) WithNodeName(value string) *NodeStatusApp return b } +// WithNodeUID sets the NodeUID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeUID field is set to the value of the last call. +func (b *NodeStatusApplyConfiguration) WithNodeUID(value string) *NodeStatusApplyConfiguration { + b.NodeUID = &value + return b +} + // WithCurrentRevision sets the CurrentRevision field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CurrentRevision field is set to the value of the last call. diff --git a/vendor/github.com/openshift/api/envtest-releases.yaml b/vendor/github.com/openshift/api/envtest-releases.yaml index ea376ded55..4705c327e0 100644 --- a/vendor/github.com/openshift/api/envtest-releases.yaml +++ b/vendor/github.com/openshift/api/envtest-releases.yaml @@ -116,3 +116,16 @@ releases: envtest-v1.35.1-linux-arm64.tar.gz: hash: 309308f9c66f9e2e5192c65a333a388faaaa903841f26f8a96b8f13a5eb3039bcbb818ef6ddbb5803a9cfa9b25e37249a0aed5d472badb25539696569923f87f selfLink: https://storage.googleapis.com/openshift-kubebuilder-tools/envtest-v1.35.1-linux-arm64.tar.gz + v1.36.2: + envtest-v1.36.2-darwin-amd64.tar.gz: + hash: ca924b4435784f12ac3c2513a78d9c6527bb83f2cece48e07d017616843cb67d2ec5836b7a83818f8817c3e0b4de1319c55ead061f3e41c05553a40bf240017a + selfLink: https://storage.googleapis.com/openshift-kubebuilder-tools/envtest-v1.36.2-darwin-amd64.tar.gz + envtest-v1.36.2-darwin-arm64.tar.gz: + hash: f5e45f660fb2abb05a55093bfd3f9594ca91b074a86126112b4645d463bc4b0e0b10261da26420c4dfbef18d189ab92da6c881c347159541481185e157d37d92 + selfLink: https://storage.googleapis.com/openshift-kubebuilder-tools/envtest-v1.36.2-darwin-arm64.tar.gz + envtest-v1.36.2-linux-amd64.tar.gz: + hash: 4322b73b1d43c7a16fb46819d2e8a95e34ab2412bcc502c75231c61bdd799a2b43916e12c11f5f0251573260e60a641e34f67e81da37d2726abfcca1720b1e73 + selfLink: https://storage.googleapis.com/openshift-kubebuilder-tools/envtest-v1.36.2-linux-amd64.tar.gz + envtest-v1.36.2-linux-arm64.tar.gz: + hash: bbe6810d76c91349cdee6daf65a6a9289010d48ddc2c42d9e163897a927b6ff7de9d0addc75bd54721cfa5048f8aafcac06a950efa59f4a686f037d1386811de + selfLink: https://storage.googleapis.com/openshift-kubebuilder-tools/envtest-v1.36.2-linux-arm64.tar.gz diff --git a/vendor/github.com/openshift/api/openapi/openapi.json b/vendor/github.com/openshift/api/openapi/openapi.json index 0ebc0f67dc..1d5f85b2fb 100644 --- a/vendor/github.com/openshift/api/openapi/openapi.json +++ b/vendor/github.com/openshift/api/openapi/openapi.json @@ -35890,6 +35890,10 @@ "type": "string", "default": "" }, + "nodeUID": { + "description": "nodeUID is the UID of the node. This field is used to detect that a node has been deleted and recreated with the same name. When the UID changes, it indicates the node is a new instance and the controller should treat this status entry as stale. When omitted, UID-based node replacement detection is not available for this entry.", + "type": "string" + }, "targetRevision": { "description": "targetRevision is the generation of the deployment we're trying to apply. Can not be set on creation of a nodeStatus.", "type": "integer", diff --git a/vendor/github.com/openshift/api/operator/v1/types.go b/vendor/github.com/openshift/api/operator/v1/types.go index 3a2141abb9..599ceb03e1 100644 --- a/vendor/github.com/openshift/api/operator/v1/types.go +++ b/vendor/github.com/openshift/api/operator/v1/types.go @@ -266,6 +266,18 @@ type NodeStatus struct { // +required NodeName string `json:"nodeName"` + // nodeUID is the UID of the node. + // This field is used to detect that a node has been deleted and recreated + // with the same name. When the UID changes, it indicates the node is a + // new instance and the controller should treat this status entry as stale. + // When omitted, UID-based node replacement detection is not available + // for this entry. + // +kubebuilder:validation:MinLength=36 + // +kubebuilder:validation:MaxLength=36 + // +kubebuilder:validation:Format=uuid + // +optional + NodeUID string `json:"nodeUID,omitempty"` + // currentRevision is the generation of the most recently successful deployment. // Can not be set on creation of a nodeStatus. Updates must only increase the value. // +kubebuilder:validation:XValidation:rule="self >= oldSelf",message="must only increase" diff --git a/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go b/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go index 1dbaf9d9b9..2b07b6859d 100644 --- a/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go +++ b/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go @@ -37,6 +37,7 @@ func (MyOperatorResource) SwaggerDoc() map[string]string { var map_NodeStatus = map[string]string{ "": "NodeStatus provides information about the current state of a particular node managed by this operator.", "nodeName": "nodeName is the name of the node", + "nodeUID": "nodeUID is the UID of the node. This field is used to detect that a node has been deleted and recreated with the same name. When the UID changes, it indicates the node is a new instance and the controller should treat this status entry as stale. When omitted, UID-based node replacement detection is not available for this entry.", "currentRevision": "currentRevision is the generation of the most recently successful deployment. Can not be set on creation of a nodeStatus. Updates must only increase the value.", "targetRevision": "targetRevision is the generation of the deployment we're trying to apply. Can not be set on creation of a nodeStatus.", "lastFailedRevision": "lastFailedRevision is the generation of the deployment we tried and failed to deploy.", diff --git a/vendor/modules.txt b/vendor/modules.txt index b42e345ff0..9ab487e167 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -79,7 +79,7 @@ github.com/modern-go/reflect2 # github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 ## explicit github.com/munnerz/goautoneg -# github.com/openshift/api v0.0.0-20260721120239-14262bf791c8 +# github.com/openshift/api v0.0.0-20260721120239-14262bf791c8 => github.com/bhperry/openshift-api v0.0.0-20260721140502-5bd0b76d24f2 ## explicit; go 1.26.0 github.com/openshift/api github.com/openshift/api/apiextensions @@ -557,3 +557,4 @@ sigs.k8s.io/structured-merge-diff/v6/value # sigs.k8s.io/yaml v1.6.0 ## explicit; go 1.22 sigs.k8s.io/yaml +# github.com/openshift/api => github.com/bhperry/openshift-api v0.0.0-20260721140502-5bd0b76d24f2