Skip to content

Commit

Permalink
fix yaml format
Browse files Browse the repository at this point in the history
  • Loading branch information
sunny0826 committed Aug 5, 2019
1 parent 1a76c08 commit b23a8dc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
19 changes: 10 additions & 9 deletions cmd/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ var cover bool

type (
Config struct {
ApiVersion string `yaml:"apiVersion"`
Kind string `yaml:"kind"`
Clusters []Clusters `yaml:"clusters"`
Contexts []Contexts `yaml:"contexts"`
CurrentContext string `yaml:"current-context"`
Users []Users `yaml:"users"`
ApiVersion string `yaml:"apiVersion"`
Kind string `yaml:"kind"`
Clusters []Clusters `yaml:"clusters"`
Contexts []Contexts `yaml:"contexts"`
CurrentContext string `yaml:"current-context"`
Users []Users `yaml:"users"`
}
Clusters struct {
Cluster Cluster `yaml:"cluster"`
Expand All @@ -47,12 +47,13 @@ type (
CertificateAuthorityData string `yaml:"certificate-authority-data"`
}
Contexts struct {
Context Context `yaml:"context"`
Name string `yaml:"name"`
Context Context `yaml:"context"`
Name string `yaml:"name"`
}
Context struct {
Cluster string `yaml:"cluster"`
User string `yaml:"user"`
NameSpace string `yaml:"namespace,omitempty"`
}
Users struct {
Name string `yaml:"name"`
Expand Down Expand Up @@ -185,4 +186,4 @@ func (c *Config) Check(name string) error {
}
}
return nil
}
}
3 changes: 2 additions & 1 deletion example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ contexts:
- context:
cluster: development
user: developer
namespace: frontend
name: dev-frontend
current-context: dev-frontend
kind: Config
preferences: {}
preferences: {123}
users:
- name: developer
user:
Expand Down

0 comments on commit b23a8dc

Please sign in to comment.