kyma-project / kyma-project/cli
kyma-cli: Add yaml format support for external community modules
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 125
- Forks
- 124
- PR merge metrics
- No merged PRs in 30d
Description
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.ModuleTemplateconsider 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with ExternalModuleTemplateRepository, which serves alpha module catalog --remote and --remote=url1,url2, and inspect kyma.ModuleTemplate serialization metadata. Add YAML deserialization alongside JSON, using the URL extension when available and fallback parsing otherwise; done means remote community modules in YAML are accepted and their ModuleTemplate fields deserialize correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100