Currently, when we call alpha module catalog --remote or alpha module catalog --remote=url1,url2 command it fetches community modules defined in JSON format and supports only parsing the json files. In the remote repositories (https://kyma-project.github.io/community-modules/) we also support yaml format and users could potentially provide their community modules templates serialized in yaml.
What needs to be done:
- Add yaml parsing logic to
ExternalModuleTemplateRepository.
- Solution suggestion: try detecting the extension from the provided url and select the proper parsing strategy accordingly. If the extension cannot be extracted then try parsing the file with all possible strategies.
- Serialization/deserialization metadata on
kyma.ModuleTemplate consider only json format. Example:
type ModuleTemplateSpec struct {
Channel string `json:"channel"`
Version string `json:"version"`
ModuleName string `json:"moduleName"`
Mandatory bool `json:"mandatory"`
Data unstructured.Unstructured `json:"data,omitempty"`
Descriptor runtime.RawExtension `json:"descriptor"`
CustomStateCheck []CustomStateCheck `json:"customStateCheck,omitempty"`
Resources []Resource `json:"resources,omitempty"`
Info ModuleInfo `json:"info,omitempty"`
AssociatedResources []metav1.GroupVersionKind `json:"associatedResources,omitempty"`
Manager *Manager `json:"manager,omitempty"`
}
Deserialization of yaml file should be added.
Currently, when we call
alpha module catalog --remoteoralpha module catalog --remote=url1,url2command it fetches community modules defined in JSON format and supports only parsing the json files. In the remote repositories (https://kyma-project.github.io/community-modules/) we also support yaml format and users could potentially provide their community modules templates serialized in yaml.What needs to be done:
ExternalModuleTemplateRepository.kyma.ModuleTemplateconsider only json format. Example:Deserialization of yaml file should be added.