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 Jpaths for jsonnet #2679 #2678

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions assets/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -3206,6 +3206,13 @@
"$ref": "#/definitions/v1alpha1JsonnetVar"
}
},
"jpaths": {
"type": "array",
"title": "JPaths is a list of Jsonnet additional library search dirs",
"items": {
"type": "string"
}
},
"tlas": {
"type": "array",
"title": "TLAS is a list of Jsonnet Top-level Arguments",
Expand Down
11 changes: 11 additions & 0 deletions cmd/argocd/commands/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,8 @@ func setAppSpecOptions(flags *pflag.FlagSet, spec *argoappv1.ApplicationSpec, ap
setJsonnetOptExtVar(&spec.Source, appOpts.jsonnetExtVarStr, false)
case "jsonnet-ext-var-code":
setJsonnetOptExtVar(&spec.Source, appOpts.jsonnetExtVarCode, true)
case "jsonnet-path":
setJsonnetOptJPath(&spec.Source, appOpts.jsonnetJPath)
case "sync-policy":
switch appOpts.syncPolicy {
case "automated":
Expand Down Expand Up @@ -655,6 +657,13 @@ func setJsonnetOptExtVar(src *argoappv1.ApplicationSource, jsonnetExtVar []strin
}
}

func setJsonnetOptJPath(src *argoappv1.ApplicationSource, jpath []string) {
if src.Directory == nil {
src.Directory = &argoappv1.ApplicationSourceDirectory{}
}
src.Directory.Jsonnet.JPaths = append(src.Directory.Jsonnet.JPaths, jpath...)
}

type appOptions struct {
repoURL string
appPath string
Expand All @@ -680,6 +689,7 @@ type appOptions struct {
jsonnetTlaCode []string
jsonnetExtVarStr []string
jsonnetExtVarCode []string
jsonnetJPath []string
kustomizeImages []string
}

Expand Down Expand Up @@ -708,6 +718,7 @@ func addAppFlags(command *cobra.Command, opts *appOptions) {
command.Flags().StringArrayVar(&opts.jsonnetTlaCode, "jsonnet-tla-code", []string{}, "Jsonnet top level code arguments")
command.Flags().StringArrayVar(&opts.jsonnetExtVarStr, "jsonnet-ext-var-str", []string{}, "Jsonnet string ext var")
command.Flags().StringArrayVar(&opts.jsonnetExtVarCode, "jsonnet-ext-var-code", []string{}, "Jsonnet ext var")
command.Flags().StringArrayVar(&opts.jsonnetJPath, "jsonnet-jpath", []string{}, "Jsonnet jpath")
command.Flags().StringArrayVar(&opts.kustomizeImages, "kustomize-image", []string{}, "Kustomize images (e.g. --kustomize-image node:8.15.0 --kustomize-image mysql=mariadb,alpine@sha256:24a0c4b4a4c0eb97a1aabb8e29f18e917d05abfe1b7a7c07857230879ce7d3d)")
}

Expand Down
36 changes: 36 additions & 0 deletions manifests/crds/application-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,12 @@ spec:
- value
type: object
type: array
jpaths:
description: JPaths is a list of Jsonnet additional
library search dirs
items:
type: string
type: array
tlas:
description: TLAS is a list of Jsonnet Top-level Arguments
items:
Expand Down Expand Up @@ -688,6 +694,12 @@ spec:
- value
type: object
type: array
jpaths:
description: JPaths is a list of Jsonnet additional library
search dirs
items:
type: string
type: array
tlas:
description: TLAS is a list of Jsonnet Top-level Arguments
items:
Expand Down Expand Up @@ -907,6 +919,12 @@ spec:
- value
type: object
type: array
jpaths:
description: JPaths is a list of Jsonnet additional
library search dirs
items:
type: string
type: array
tlas:
description: TLAS is a list of Jsonnet Top-level Arguments
items:
Expand Down Expand Up @@ -1132,6 +1150,12 @@ spec:
- value
type: object
type: array
jpaths:
description: JPaths is a list of Jsonnet additional
library search dirs
items:
type: string
type: array
tlas:
description: TLAS is a list of Jsonnet Top-level
Arguments
Expand Down Expand Up @@ -1389,6 +1413,12 @@ spec:
- value
type: object
type: array
jpaths:
description: JPaths is a list of Jsonnet additional
library search dirs
items:
type: string
type: array
tlas:
description: TLAS is a list of Jsonnet Top-level
Arguments
Expand Down Expand Up @@ -1625,6 +1655,12 @@ spec:
- value
type: object
type: array
jpaths:
description: JPaths is a list of Jsonnet additional
library search dirs
items:
type: string
type: array
tlas:
description: TLAS is a list of Jsonnet Top-level
Arguments
Expand Down
36 changes: 36 additions & 0 deletions manifests/ha/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,12 @@ spec:
- value
type: object
type: array
jpaths:
description: JPaths is a list of Jsonnet additional
library search dirs
items:
type: string
type: array
tlas:
description: TLAS is a list of Jsonnet Top-level Arguments
items:
Expand Down Expand Up @@ -689,6 +695,12 @@ spec:
- value
type: object
type: array
jpaths:
description: JPaths is a list of Jsonnet additional library
search dirs
items:
type: string
type: array
tlas:
description: TLAS is a list of Jsonnet Top-level Arguments
items:
Expand Down Expand Up @@ -908,6 +920,12 @@ spec:
- value
type: object
type: array
jpaths:
description: JPaths is a list of Jsonnet additional
library search dirs
items:
type: string
type: array
tlas:
description: TLAS is a list of Jsonnet Top-level Arguments
items:
Expand Down Expand Up @@ -1133,6 +1151,12 @@ spec:
- value
type: object
type: array
jpaths:
description: JPaths is a list of Jsonnet additional
library search dirs
items:
type: string
type: array
tlas:
description: TLAS is a list of Jsonnet Top-level
Arguments
Expand Down Expand Up @@ -1390,6 +1414,12 @@ spec:
- value
type: object
type: array
jpaths:
description: JPaths is a list of Jsonnet additional
library search dirs
items:
type: string
type: array
tlas:
description: TLAS is a list of Jsonnet Top-level
Arguments
Expand Down Expand Up @@ -1626,6 +1656,12 @@ spec:
- value
type: object
type: array
jpaths:
description: JPaths is a list of Jsonnet additional
library search dirs
items:
type: string
type: array
tlas:
description: TLAS is a list of Jsonnet Top-level
Arguments
Expand Down
36 changes: 36 additions & 0 deletions manifests/ha/namespace-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,12 @@ spec:
- value
type: object
type: array
jpaths:
description: JPaths is a list of Jsonnet additional
library search dirs
items:
type: string
type: array
tlas:
description: TLAS is a list of Jsonnet Top-level Arguments
items:
Expand Down Expand Up @@ -689,6 +695,12 @@ spec:
- value
type: object
type: array
jpaths:
description: JPaths is a list of Jsonnet additional library
search dirs
items:
type: string
type: array
tlas:
description: TLAS is a list of Jsonnet Top-level Arguments
items:
Expand Down Expand Up @@ -908,6 +920,12 @@ spec:
- value
type: object
type: array
jpaths:
description: JPaths is a list of Jsonnet additional
library search dirs
items:
type: string
type: array
tlas:
description: TLAS is a list of Jsonnet Top-level Arguments
items:
Expand Down Expand Up @@ -1133,6 +1151,12 @@ spec:
- value
type: object
type: array
jpaths:
description: JPaths is a list of Jsonnet additional
library search dirs
items:
type: string
type: array
tlas:
description: TLAS is a list of Jsonnet Top-level
Arguments
Expand Down Expand Up @@ -1390,6 +1414,12 @@ spec:
- value
type: object
type: array
jpaths:
description: JPaths is a list of Jsonnet additional
library search dirs
items:
type: string
type: array
tlas:
description: TLAS is a list of Jsonnet Top-level
Arguments
Expand Down Expand Up @@ -1626,6 +1656,12 @@ spec:
- value
type: object
type: array
jpaths:
description: JPaths is a list of Jsonnet additional
library search dirs
items:
type: string
type: array
tlas:
description: TLAS is a list of Jsonnet Top-level
Arguments
Expand Down
36 changes: 36 additions & 0 deletions manifests/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,12 @@ spec:
- value
type: object
type: array
jpaths:
description: JPaths is a list of Jsonnet additional
library search dirs
items:
type: string
type: array
tlas:
description: TLAS is a list of Jsonnet Top-level Arguments
items:
Expand Down Expand Up @@ -689,6 +695,12 @@ spec:
- value
type: object
type: array
jpaths:
description: JPaths is a list of Jsonnet additional library
search dirs
items:
type: string
type: array
tlas:
description: TLAS is a list of Jsonnet Top-level Arguments
items:
Expand Down Expand Up @@ -908,6 +920,12 @@ spec:
- value
type: object
type: array
jpaths:
description: JPaths is a list of Jsonnet additional
library search dirs
items:
type: string
type: array
tlas:
description: TLAS is a list of Jsonnet Top-level Arguments
items:
Expand Down Expand Up @@ -1133,6 +1151,12 @@ spec:
- value
type: object
type: array
jpaths:
description: JPaths is a list of Jsonnet additional
library search dirs
items:
type: string
type: array
tlas:
description: TLAS is a list of Jsonnet Top-level
Arguments
Expand Down Expand Up @@ -1390,6 +1414,12 @@ spec:
- value
type: object
type: array
jpaths:
description: JPaths is a list of Jsonnet additional
library search dirs
items:
type: string
type: array
tlas:
description: TLAS is a list of Jsonnet Top-level
Arguments
Expand Down Expand Up @@ -1626,6 +1656,12 @@ spec:
- value
type: object
type: array
jpaths:
description: JPaths is a list of Jsonnet additional
library search dirs
items:
type: string
type: array
tlas:
description: TLAS is a list of Jsonnet Top-level
Arguments
Expand Down
Loading