validAttach checks object types to see if the attach is allowed. Objects can only be attached to objects higher in the hierarchy. However, to the nature of iota Application is 0, RC is 1, ...
(e Entity)
| 88 | // validAttach checks object types to see if the attach is allowed. Objects can |
| 89 | // only be attached to objects higher in the hierarchy. However, to the nature of iota Application is 0, RC is 1, ... |
| 90 | func (base base) validAttach(e Entity) error { |
| 91 | if e == nil { |
| 92 | return ErrorNilEntity |
| 93 | } |
| 94 | if e.Type() > EntityImage { |
| 95 | return ErrorInvalidAttachType |
| 96 | } else if base.Type() > e.Type() { |
| 97 | return ErrorBadAttachOrder |
| 98 | } |
| 99 | return nil |
| 100 | } |
| 101 | |
| 102 | // setDefaults sets the bases defaults on an object |
| 103 | func (base base) setDefaults(obj deploy.KubeObject) { |