You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your enhancement related to a problem? Please describe
Until now if we provide a List of objects to be serialized using the class io.quarkiverse.tekton.common.utils.Serialization and the method: asYaml() we got a wrong yaml result that we cannot install on a kubernetes cluster
Ideally, the serializer should be able to iterate through the list of the objects to trim it and add a CR as such
public void process(List<HasMetadata> resources) {
// Iterate through the list of the resources to process them individually to include ---
// as separator between them instead of a list of items
StringBuilder yamlOutput = new StringBuilder();
for (HasMetadata resource : resources) {
String yaml = Serialization.asYaml(resource).trim();
yamlOutput.append(yaml).append("\n");
}
write(yamlOutput.toString();
/**
* The array list of the kubernetes resources should be formated as such
*
* ---
* manifest1
* ---
* manifest2
* ...
*
* instead of a list as we got as error when deployed: cannot unmarshal array into Go value of type
* unstructured.detector
*
* - manifest1
* - manifest2
* ...
*
*/
return ((List<HasMetadata>) object).stream()
.map(Serialization::writeValueAsYamlSafe)
.map(s -> s.replaceAll(TAG_PATTERN, BLANK))
.collect(Collectors.joining());
Is your enhancement related to a problem? Please describe
Until now if we provide a List of objects to be serialized using the class
io.quarkiverse.tekton.common.utils.Serialization
and the method:asYaml()
we got a wrong yaml result that we cannot install on a kubernetes clusterDescribe the solution you'd like
Ideally, the serializer should be able to iterate through the list of the objects to trim it and add a CR as such
By doing that, we get as result
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: