Skip to content

Commit

Permalink
Merge pull request #204 from ibuildthecloud/master
Browse files Browse the repository at this point in the history
Random
  • Loading branch information
ibuildthecloud authored Oct 4, 2018
2 parents 8e5e5a6 + d5ff49f commit 3bda206
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/changeset/changeset.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func watch(name string, enq Enqueuer, resolve Resolver, genericController contro

ro, ok := obj.(runtime.Object)
if !ok {
return nil
ro = nil
}

keys, err := resolve(ns, name, ro)
Expand Down
6 changes: 5 additions & 1 deletion types/convert/merge/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func APIUpdateMerge(schema *types.Schema, schemas *types.Schemas, dest, src map[string]interface{}, replace bool) map[string]interface{} {
result := mergeMaps("", nil, schema, schemas, replace, dest, src)
result := UpdateMerge(schema, schemas, dest, src, replace)
if s, ok := dest["status"]; ok {
result["status"] = s
}
Expand All @@ -19,6 +19,10 @@ func APIUpdateMerge(schema *types.Schema, schemas *types.Schemas, dest, src map[
return result
}

func UpdateMerge(schema *types.Schema, schemas *types.Schemas, dest, src map[string]interface{}, replace bool) map[string]interface{} {
return mergeMaps("", nil, schema, schemas, replace, dest, src)
}

func isProtected(k string) bool {
if !strings.Contains(k, "cattle.io/") || (isField(k) && k != "field.cattle.io/creatorId") {
return false
Expand Down
11 changes: 11 additions & 0 deletions types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ type Resource struct {
Actions map[string]string `json:"actions"`
}

type NamedResource struct {
Resource
Name string `json:"name"`
Description string `json:"description"`
}

type NamedResourceCollection struct {
Collection
Data []NamedResource `json:"data,omitempty"`
}

type APIVersion struct {
Group string `json:"group,omitempty"`
Version string `json:"version,omitempty"`
Expand Down

0 comments on commit 3bda206

Please sign in to comment.