Skip to content

kyma-cli: Add yaml format support for external community modules #2898

Description

@kwiatekus

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:

  1. 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.
  2. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/cliRelated to all activities around CLI

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions