kyma-project / modulectl

Internal tool for module management and operations
Apache License 2.0
0 stars 9 forks source link

Implement the `modulectl create module` logic #28

Closed c-pius closed 3 weeks ago

c-pius commented 4 months ago

Description

Implement the service for creating modules. This should provide the same functionality as in CLI, but the implementation should be clean and follow high code quality standards.

Flags

--module-config-file string          Specifies the module configuration file
-c, --credentials string                 Basic authentication credentials for the given registry in the user:password format
--git-remote string                  Specifies the remote name of the wanted GitHub repository. For Example "origin" or "upstream" (default "origin")
--insecure                           Uses an insecure connection to access the registry.
-o, --output string                      File to write the module template if the module is uploaded to a registry. (default "template.yaml")
--registry string                    Context URL of the repository. The repository URL will be automatically added to the repository contexts in the module descriptor.
--registry-cred-selector string      Label selector to identify an externally created Secret of type "kubernetes.io/dockerconfigjson". It allows the image to be accessed in private image registries. It can be used when you push your module to a registry with authenticated access. For example, "label1=value1,label2=value2".
--sec-scanners-config string         Path to the file holding the security scan configuration. (default "sec-scanners-config.yaml")

module configuration file

type Config struct {
    Name              string                     `yaml:"name" comment:"required, the name of the Module"`
    Version           string                     `yaml:"version" comment:"required, the version of the Module"`
    Channel           string                     `yaml:"channel" comment:"required, channel that should be used in the ModuleTemplate"`
    ManifestPath      string                     `yaml:"manifest" comment:"required, relative path or remote URL to the manifests"`
    Mandatory         bool                       `yaml:"mandatory" comment:"optional, default=false, indicates whether the module is mandatory to be installed on all clusters"`
    DefaultCRPath     string                     `yaml:"defaultCR" comment:"optional, relative path or remote URL to a YAML file containing the default CR for the module"`
    ResourceName      string                     `yaml:"resourceName" comment:"optional, default={name}-{channel}, when channel is 'none', the default is {name}-{version}, the name for the ModuleTemplate that will be created"`
    Namespace         string                     `yaml:"namespace" comment:"optional, default=kcp-system, the namespace where the ModuleTemplate will be deployed"`
    Security          string                     `yaml:"security" comment:"optional, name of the security scanners config file"`
    Internal          bool                       `yaml:"internal" comment:"optional, default=false, determines whether the ModuleTemplate should have the internal flag or not"`
    Beta              bool                       `yaml:"beta" comment:"optional, default=false, determines whether the ModuleTemplate should have the beta flag or not"`
    Labels            map[string]string          `yaml:"labels" comment:"optional, additional labels for the ModuleTemplate"`
    Annotations       map[string]string          `yaml:"annotations" comment:"optional, additional annotations for the ModuleTemplate"`
}

Acceptance Criteria

github-actions[bot] commented 2 months ago

This issue has been automatically marked as stale due to the lack of recent activity. It will soon be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 2 months ago

This issue has been automatically closed due to the lack of recent activity. /lifecycle rotten