Skip to content

Commit

Permalink
Merge pull request #2516 from 2uasimojo/HIVE-2214/valueJSON-string
Browse files Browse the repository at this point in the history
BREAKING: make `PatchEntity.ValueJSON` a `string`
  • Loading branch information
openshift-merge-bot[bot] authored Nov 11, 2024
2 parents 00f84cc + 4eaf5fd commit 85c2c4f
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 23 deletions.
4 changes: 2 additions & 2 deletions apis/hive/v1/clusterdeploymentcustomization_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ type PatchEntity struct {
// ValueJSON is a string representing a JSON object to be used in the operation. As such,
// internal quotes must be escaped. If nonempty, Value is ignored.
// +optional
ValueJSON []byte `json:"valueJSON,omitempty"`
ValueJSON string `json:"valueJSON,omitempty"`
}

// Encode returns a string representation of the RFC6902 patching operation represented by the
Expand All @@ -74,7 +74,7 @@ func (pe *PatchEntity) Encode() string {
// Prefer ValueJSON
if len(pe.ValueJSON) != 0 {
// ValueJSON will be a raw JSON object in the patch; don't quote it.
val = string(pe.ValueJSON)
val = pe.ValueJSON
} else {
// Value will be a JSON string value in the patch; quote it.
val = fmt.Sprintf("%q", pe.Value)
Expand Down
9 changes: 1 addition & 8 deletions apis/hive/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ spec:
description: |-
ValueJSON is a string representing a JSON object to be used in the operation. As such,
internal quotes must be escaped. If nonempty, Value is ignored.
format: byte
type: string
required:
- op
Expand Down
1 change: 0 additions & 1 deletion hack/app-sre/saas-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,6 @@ objects:
to be used in the operation. As such,
internal quotes must be escaped. If nonempty, Value is ignored.'
format: byte
type: string
required:
- op
Expand Down
2 changes: 1 addition & 1 deletion pkg/installmanager/installmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,7 @@ func patchWorkerMachineSetManifest(manifestBytes []byte, pool *hivev1.MachinePoo
{
Op: "add",
Path: fmt.Sprintf("/spec/template/spec/providerSpec/value/securityGroups/%d/filters/-", idx),
ValueJSON: vpcIDFilterValueJSON,
ValueJSON: string(vpcIDFilterValueJSON),
},
}
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 85c2c4f

Please sign in to comment.