mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-04-27 11:21:44 +00:00
Allow overriding the schema version number (#19)
This commit is contained in:
parent
cda46877ba
commit
0b7fd24bc7
14
main.go
14
main.go
@ -464,9 +464,21 @@ The validate command expects a configuration file as its only argument. Local fi
|
||||
},
|
||||
{
|
||||
Name: "print-schema",
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "version",
|
||||
Usage: "Print the current schema but with another version number, instead of using the agent version number.",
|
||||
},
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
var version string
|
||||
if c.String("version") != "" {
|
||||
version = c.String("version")
|
||||
} else {
|
||||
version = common.VERSION
|
||||
}
|
||||
|
||||
json, err := agent.JSONSchema(common.VERSION)
|
||||
json, err := agent.JSONSchema(version)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user