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

wip: add validargs for param validation #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tuananh
Copy link

@tuananh tuananh commented Nov 30, 2021

Allow param validation with validargs

needs a workaround for this issue in cobra https://github.com/spf13/cobra/issues/745\

i think i need to fix more case for other type (int , list, etc...) but what do you think about this feature?

job "echo" {
  parameter "color" {
    type = string
    validargs = ["red", "yellow"]
  }
  
  exec {
    command = "echo"
    args = [param.color]
  }
}

Signed-off-by: Tuan Anh Tran me@tuananh.org

Signed-off-by: Tuan Anh Tran <me@tuananh.org>
@tuananh tuananh changed the title feat: add validargs for param validation wip: add validargs for param validation Nov 30, 2021
@mumoshu
Copy link
Owner

mumoshu commented Jan 10, 2022

@tuananh Looks awesome!

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.

2 participants