Skip to content

Commit

Permalink
Fix the typo and change the validate type
Browse files Browse the repository at this point in the history
  • Loading branch information
hwchiu committed Aug 16, 2018
1 parent bb98b12 commit c29e014
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion API.md
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ For each Pod, we have fileds need to handle.
- Always,OnFailure,Never
9. networkType: the string options for network type, support "host", "custom" and "cluster".
10. nodeAffinity: the string array to indicate whchi nodes I want my Pod can run in.

2. envVars: the environment variables for containers and it's map (string to stirng) form.

Example:

Expand All @@ -641,6 +641,8 @@ Request Data:
```json
{
"name": "awesome",
"labels": {},
"envVars":{},
"containers": [{
"name": "busybox",
"image": "busybox",
Expand Down
4 changes: 2 additions & 2 deletions src/entity/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ type Pod struct {
ID bson.ObjectId `bson:"_id,omitempty" json:"id" validate:"-"`
Name string `bson:"name" json:"name" validate:"required,k8sname"`
Namespace string `bson:"namespace" json:"namespace" validate:"required"`
Labels map[string]string `bson:"labels,omitempty" json:"labels" validate:"required,dive,keys,alphanum,endkeys,required,alphanum"`
EnvVars map[string]string `bson:"envVars,omitempty" json:"envVars" validate:"required,dive,keys,alphanum,endkeys,required,alphanum"`
Labels map[string]string `bson:"labels,omitempty" json:"labels" validate:"required,dive,keys,printascii,endkeys,required,printascii"`
EnvVars map[string]string `bson:"envVars,omitempty" json:"envVars" validate:"required,dive,keys,printascii,endkeys,required,printascii"`
Containers []Container `bson:"containers" json:"containers" validate:"required,dive,required"`
Volumes []PodVolume `bson:"volumes,omitempty" json:"volumes" validate:"required,dive,required"`
Networks []PodNetwork `bson:"networks,omitempty" json:"networks" validate:"required,dive,required"`
Expand Down
2 changes: 1 addition & 1 deletion tests/01-multiple-interface/pod.info
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@PODNAME@",
"labels":{},
"envVars:{},
"envVars":{},
"namespace":"default",
"containers":[
{
Expand Down
2 changes: 1 addition & 1 deletion tests/02-hoet-network/pod.info
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@PODNAME@",
"labels":{},
"envVars:{
"envVars":{
"myip":"1.2.3.4"
},
"namespace":"default",
Expand Down
2 changes: 1 addition & 1 deletion tests/03-storage-pod/pod.info
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@PODNAME@",
"labels":{},
"envVars:{},
"envVars":{},
"namespace":"default",
"containers":[
{
Expand Down

0 comments on commit c29e014

Please sign in to comment.