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

feat: area/cli: Add support for cyctl create --output flag #528

Merged
merged 2 commits into from
Aug 26, 2024

Conversation

Sheikh-Abubaker
Copy link
Contributor

@Sheikh-Abubaker Sheikh-Abubaker commented Aug 25, 2024

closes #322

📑 Description

✅ Checks

  • I have updated the documentation as required
  • I have performed a self-review of my code

ℹ Additional context

Brief Insights on --output flag test

$ ./cyctl create module my-module -f values.yaml --repo='https://github.com/cyclops-ui/templates' --path='demo' --version='main' -o yaml
---
apiVersion: cyclops-ui.com/v1alpha1
kind: Module
metadata:
  creationTimestamp: null
  name: my-module
  namespace: cyclops
spec:
  template:
    path: demo
    repo: https://github.com/cyclops-ui/templates
    version: main
  values:
    image: nginx
    name: demo-app
    replicas: 1
    service: true
    version: 1.14.2
status:
  reconciliationStatus:
    reason: ""
    status: ""

$ ./cyctl create module my-module -f values.yaml --repo='https://github.com/cyclops-ui/templates' --path='demo' --version='main' -o json
{
  "kind": "Module",
  "apiVersion": "cyclops-ui.com/v1alpha1",
  "metadata": {
    "name": "my-module",
    "namespace": "cyclops",
    "creationTimestamp": null
  },
  "spec": {
    "template": {
      "repo": "https://github.com/cyclops-ui/templates",
      "path": "demo",
      "version": "main"
    },
    "values": {
      "image": "nginx",
      "name": "demo-app",
      "replicas": 1,
      "service": true,
      "version": "1.14.2"
    }
  },
  "status": {
    "reconciliationStatus": {
      "status": "",
      "reason": ""
    }
  }
}
$ ./cyctl create template test-2 --repo='https://github.com/cyclops-ui/templates' --path='demo' --version='main' -o yaml
---
apiVersion: cyclops-ui.com/v1alpha1
kind: TemplateStore
metadata:
  creationTimestamp: null
  name: test-2
  namespace: cyclops
spec:
  path: demo
  repo: https://github.com/cyclops-ui/templates
  version: main

$ ./cyctl create template test-2 --repo='https://github.com/cyclops-ui/templates' --path='demo' --version='main' -o json
{
  "kind": "TemplateStore",
  "apiVersion": "cyclops-ui.com/v1alpha1",
  "metadata": {
    "name": "test-2",
    "namespace": "cyclops",
    "creationTimestamp": null
  },
  "spec": {
    "repo": "https://github.com/cyclops-ui/templates",
    "path": "demo",
    "version": "main"
  }
}
$ ./cyctl create templateauthrule demo-templateauthrule --repo='https://github.com/cyclops-ui/templates' --username='name:john' --password='name:random' -o yaml
---
apiVersion: cyclops-ui.com/v1alpha1
kind: TemplateAuthRule
metadata:
  creationTimestamp: null
  name: demo-templateauthrule
  namespace: cyclops
spec:
  password:
    key: random
    name: name
  repo: https://github.com/cyclops-ui/templates
  username:
    key: john
    name: name

$ ./cyctl create templateauthrule demo-templateauthrule --repo='https://github.com/cyclops-ui/templates' --username='name:john' --password='name:random' -o json
{
  "kind": "TemplateAuthRule",
  "apiVersion": "cyclops-ui.com/v1alpha1",
  "metadata": {
    "name": "demo-templateauthrule",
    "namespace": "cyclops",
    "creationTimestamp": null
  },
  "spec": {
    "repo": "https://github.com/cyclops-ui/templates",
    "username": {
      "name": "name",
      "key": "john"
    },
    "password": {
      "name": "name",
      "key": "random"
    }
  }
}

@Sheikh-Abubaker Sheikh-Abubaker requested a review from a team as a code owner August 25, 2024 18:20
@Sheikh-Abubaker Sheikh-Abubaker changed the title feat(cli): Add support for cyctl create --output flag feat: area/cli: Add support for cyctl create --output flag Aug 25, 2024
Copy link
Collaborator

@petar-cvit petar-cvit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Sheikh-Abubaker 🧡

@petar-cvit petar-cvit merged commit c8ad7df into cyclops-ui:main Aug 26, 2024
1 check passed
@Sheikh-Abubaker
Copy link
Contributor Author

@petar-cvit I was not able to update the documentation for this one as I didn't know how to auto generate the docs, would be happy to do it if you could tell me.

@petar-cvit
Copy link
Collaborator

@Sheikh-Abubaker Thanks for the nudge. I usually generate cli docs using a script each time there is a new release, so don't worry about it 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add output flag to cyctl create
2 participants