Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
31 changes: 30 additions & 1 deletion docs-v2/content/en/schemas/v4beta12.json
Original file line number Diff line number Diff line change
Expand Up @@ -4639,6 +4639,14 @@
"x-intellij-html-description": "entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided.",
"default": "[]"
},
"env": {
"items": {
"$ref": "#/definitions/VerifyEnvVar"
},
"type": "array",
"description": "list of environment variables to set in the container.",
"x-intellij-html-description": "list of environment variables to set in the container."
},
"image": {
"type": "string",
"description": "container image name.",
Expand All @@ -4654,14 +4662,35 @@
"name",
"image",
"command",
"args"
"args",
"env"
],
"additionalProperties": false,
"type": "object",
"description": "a list of tests to run on images that Skaffold builds.",
"x-intellij-html-description": "a list of tests to run on images that Skaffold builds."
},
"VerifyEnvVar": {
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"description": "of the environment variable. Must be a C_IDENTIFIER.",
"x-intellij-html-description": "of the environment variable. Must be a C_IDENTIFIER."
},
"value": {
"type": "string",
"description": "of the environment variable.",
"x-intellij-html-description": "of the environment variable."
}
},
"preferredOrder": [
"name",
"value"
],
"additionalProperties": false,
"type": "object",
"description": "represents an environment variable present in a Container.",
"x-intellij-html-description": "represents an environment variable present in a Container."
Expand Down
15 changes: 9 additions & 6 deletions pkg/skaffold/inspect/jobManifestPaths/modify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ verify:
container:
name: foo
image: foo
env: []
env:
- name: key
value: value
executionMode:
kubernetesCluster:
jobManifestPath: modified-foo.yaml
Expand All @@ -60,6 +62,12 @@ verify:
Container: latest.VerifyContainer{
Name: "foo",
Image: "foo",
Env: []latest.VerifyEnvVar{
{
Name: "key",
Value: "value",
},
},
},
ExecutionMode: latest.VerifyExecutionModeConfig{
VerifyExecutionModeType: latest.VerifyExecutionModeType{
Expand Down Expand Up @@ -88,7 +96,6 @@ verify:
container:
name: foo
image: foo
env: []
executionMode:
kubernetesCluster:
jobManifestPath: verify-manifest.yaml
Expand All @@ -100,15 +107,13 @@ customActions:
containers:
- name: task1
image: task1-img
env: []
- name: action2
executionMode:
kubernetesCluster:
jobManifestPath: custom-action-job-manifest.yaml
containers:
- name: task2
image: task2-img
env: []
`,
originalCfg: latest.SkaffoldConfig{
APIVersion: "skaffold/v4beta5",
Expand Down Expand Up @@ -177,7 +182,6 @@ verify:
container:
name: foo
image: foo
env: []
executionMode:
kubernetesCluster:
jobManifestPath: modified-foo.yaml
Expand All @@ -189,7 +193,6 @@ customActions:
containers:
- name: task1
image: task1-img
env: []
`,
originalCfg: latest.SkaffoldConfig{
APIVersion: "skaffold/v4beta5",
Expand Down
8 changes: 4 additions & 4 deletions pkg/skaffold/schema/latest/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -724,16 +724,16 @@ type VerifyContainer struct {
// The container image's CMD is used if this is not provided.
Args []string `yaml:"args,omitempty"`
// Env is the list of environment variables to set in the container.
Env []VerifyEnvVar `json:"env,omitempty"`
Env []VerifyEnvVar `yaml:"env,omitempty"`
}

// VerifyEnvVar represents an environment variable present in a Container.
type VerifyEnvVar struct {
// Name of the environment variable. Must be a C_IDENTIFIER.
Name string `json:"name" yamltags:"required"`
Name string `yaml:"name" yamltags:"required"`

// Value of the environment variable
Value string `json:"value"`
// Value of the environment variable.
Value string `yaml:"value"`
}

// RenderConfig contains all the configuration needed by the render steps.
Expand Down