Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
don't parse resource version
Browse files Browse the repository at this point in the history
Parsing the resourceVersion as an integer is strictly prohibited by the
Kubernetes API [1]. During a review of code that would be affected by
non-numerical resourceVersions, I came upon this code. As the parsed
data is not used for anything, it looks like it's possible to simply
remove this parsing logic.

[1] https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions

Signed-off-by: Steve Kuznetsov <[email protected]>
  • Loading branch information
stevekuznetsov committed Nov 28, 2022
1 parent 21805ed commit 4157e68
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pkg/bdw/broker_deployment_wrapper_deployers.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,12 @@ func (bdw *BrokerDeploymentWrapper) DeployBrokers(count int) error {
}

func (bdw *BrokerDeploymentWrapper) Update() error {
resourceVersion := int64(0)
var err error
// getting created artemis custom resource to overwrite the resourceVersion and params.
artemisCreated, err := bdw.brokerClient.BrokerV1beta1().ActiveMQArtemises(bdw.ctx1.Namespace).Get(bdw.name, v1.GetOptions{})
gomega.Expect(err).To(gomega.BeNil())
originalSize := artemisCreated.Spec.DeploymentPlan.Size
resourceVersion, err = strconv.ParseInt(string(artemisCreated.ObjectMeta.ResourceVersion), 10, 64)
gomega.Expect(err).To(gomega.BeNil())
artemisCreated.ObjectMeta.ResourceVersion = strconv.FormatInt(int64(resourceVersion), 10)


bdw.ConfigureBroker(artemisCreated, NoChangeAcceptor)

Expand Down

0 comments on commit 4157e68

Please sign in to comment.