Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions patch/annotation.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func (a *Annotator) GetModifiedConfiguration(obj runtime.Object, annotate bool)
a.metadataAccessor.SetAnnotations(obj, nil)
}

modified, err = json.Marshal(obj)
modified, err = json.ConfigCompatibleWithStandardLibrary.Marshal(obj)
if err != nil {
return nil, err
}
Expand All @@ -126,7 +126,7 @@ func (a *Annotator) GetModifiedConfiguration(obj runtime.Object, annotate bool)
return nil, err
}

modified, err = json.Marshal(obj)
modified, err = json.ConfigCompatibleWithStandardLibrary.Marshal(obj)
if err != nil {
return nil, err
}
Expand Down
6 changes: 3 additions & 3 deletions patch/deletenull.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func DeleteNullInJson(jsonBytes []byte) ([]byte, map[string]interface{}, error)
return nil, nil, emperror.Wrap(err, "could not delete null values from patch map")
}

o, err := json.Marshal(filteredMap)
o, err := json.ConfigCompatibleWithStandardLibrary.Marshal(filteredMap)
if err != nil {
return nil, nil, emperror.Wrap(err, "could not marshal filtered patch map")
}
Expand Down Expand Up @@ -183,7 +183,7 @@ func deleteStatusField(obj []byte) ([]byte, error) {
return []byte{}, emperror.Wrap(err, "could not unmarshal byte sequence")
}
delete(objectMap, "status")
obj, err = json.Marshal(objectMap)
obj, err = json.ConfigCompatibleWithStandardLibrary.Marshal(objectMap)
if err != nil {
return []byte{}, emperror.Wrap(err, "could not marshal byte sequence")
}
Expand All @@ -206,7 +206,7 @@ func deleteVolumeClaimTemplateFields(obj []byte) ([]byte, error) {
}
}

obj, err = json.Marshal(sts)
obj, err = json.ConfigCompatibleWithStandardLibrary.Marshal(sts)
if err != nil {
return []byte{}, emperror.Wrap(err, "could not marshal byte sequence")
}
Expand Down
4 changes: 2 additions & 2 deletions patch/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ func NewPatchMaker(annotator *Annotator) *PatchMaker {
}

func (p *PatchMaker) Calculate(currentObject, modifiedObject runtime.Object, opts ...CalculateOption) (*PatchResult, error) {
current, err := json.Marshal(currentObject)
current, err := json.ConfigCompatibleWithStandardLibrary.Marshal(currentObject)
if err != nil {
return nil, emperror.Wrap(err, "Failed to convert current object to byte sequence")
}

modified, err := json.Marshal(modifiedObject)
modified, err := json.ConfigCompatibleWithStandardLibrary.Marshal(modifiedObject)
if err != nil {
return nil, emperror.Wrap(err, "Failed to convert current object to byte sequence")
}
Expand Down