Skip to content

Commit

Permalink
Merge pull request #189 from nathan-jenan-rancher/pluggable-driver
Browse files Browse the repository at this point in the history
Add dynamic field to field struct
  • Loading branch information
ibuildthecloud authored Sep 24, 2018
2 parents ee8e325 + e2fa956 commit 5f7e9df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion types/schemas.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,12 @@ func (s *Schemas) embed(schema *Schema) {
newSchema.ResourceFields = map[string]Field{}

for k, v := range target.ResourceFields {
newSchema.ResourceFields[k] = v
// We remove the dynamic fields off the existing schema in case
// they've been removed from the dynamic schema so they won't
// be accidentally left over
if !v.DynamicField {
newSchema.ResourceFields[k] = v
}
}
for k, v := range schema.ResourceFields {
newSchema.ResourceFields[k] = v
Expand Down
1 change: 1 addition & 0 deletions types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ type Field struct {
InvalidChars string `json:"invalidChars,omitempty"`
Description string `json:"description,omitempty"`
CodeName string `json:"-"`
DynamicField bool `json:"dynamicField,omitempty"`
}

type Action struct {
Expand Down

0 comments on commit 5f7e9df

Please sign in to comment.