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

Patcher.Apply should respect the type of the given file #11

Open
twelho opened this issue Jun 15, 2020 · 2 comments
Open

Patcher.Apply should respect the type of the given file #11

twelho opened this issue Jun 15, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@twelho
Copy link
Contributor

twelho commented Jun 15, 2020

Currently serializerEncode in the patcher is hard-configured to handle patching the manifests as JSON, e.g. https://github.com/weaveworks/libgitops/blob/master/pkg/util/patch/patch.go#L94. This is used by both Apply and ApplyOnFile.

There should either be a way to configure these in the patcher, or file type detection could be performed to support YAML output in the case of YAML input.

@twelho twelho added the enhancement New feature or request label Jun 15, 2020
@twelho
Copy link
Contributor Author

twelho commented Jun 15, 2020

This is actually a limitation of API Machinery's StrategicMergePatch, see here:

func StrategicMergePatch(original, patch []byte, dataStruct interface{}) ([]byte, error) {

So we need to work with this in Ignite. Closing.

@twelho twelho closed this as completed Jun 15, 2020
@luxas luxas reopened this Jun 29, 2020
@luxas
Copy link
Contributor

luxas commented Jun 29, 2020

We could add ContentType in here by automatically converting YAML to JSON whenever needed though.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants