Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the alpha <resource> create command #2320

Merged
merged 2 commits into from
Jan 21, 2025

Conversation

pPrecel
Copy link
Contributor

@pPrecel pPrecel commented Jan 20, 2025

Description

Changes proposed in this pull request:

  • make the create template command

How to run it

  1. add the following configmap to the cluster:
apiVersion: v1
data:
  rootCommand: |
    name: function
    description: Set of commands for managing Functions
    descriptionLong: Use this command manage Functions
  resource: |
    scope: namespace
    kind: Function
    version: v1alpha2
    group: serverless.kyma-project.io
  templateCommands: |
    create:
      description: create test resource
      descriptionLong: use this command to create test resource
      customFlags:
      - type: "string"
        name: "runtime"
        description: "function runtime"
        shorthand: "r"
        path: ".spec.runtime"
        default: "nodejs22"
      - type: "int64"
        name: "replicas"
        description: "function replicas"
        path: ".spec.replicas"
        default: 1
      - type: "path"
        name: "source"
        description: "function source file path"
        shorthand: "s"
        path: ".spec.source.inline.source"
        default: |
          module.exports = {
            main: function(event, context) {
              return 'Hello World!'
            }
          }
      - type: "path"
        name: "dependencies"
        description: "function dependencies file path"
        shorthand: "d"
        path: ".spec.source.inline.dependencies"
kind: ConfigMap
metadata:
  labels:
    kyma-cli/extension: resource
    kyma-project.io/module: function
  name: serverless.function.cli
  namespace: kyma-system
  1. build the cli from this PR:
go build --output kyma-dev main.go
  1. use command
./kyma-dev alpha --help

Related issue(s)

@pPrecel pPrecel requested a review from a team as a code owner January 20, 2025 10:16
@kyma-bot kyma-bot added the cla: yes Indicates the PR's author has signed the CLA. label Jan 20, 2025
@kyma-bot kyma-bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jan 20, 2025
@pPrecel pPrecel added kind/feature Categorizes issue or PR as related to a new feature. area/cli Related to all activities around CLI labels Jan 20, 2025
@pPrecel pPrecel enabled auto-merge (squash) January 20, 2025 13:01
@pPrecel pPrecel changed the title Extensions create Add the alpha <resource> create command Jan 20, 2025
@kyma-bot kyma-bot added the lgtm Looks good to me! label Jan 21, 2025
@pPrecel pPrecel merged commit a5f7df3 into kyma-project:main Jan 21, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Related to all activities around CLI cla: yes Indicates the PR's author has signed the CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm Looks good to me! size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants