
client-go
基础
|
63
// be serialized or have unique requirements, this interface may be a no-op.
type ObjectKind interface {
// SetGroupVersionKind sets or clears the intended serialized kind of an
// object. Passing kind nil should clear the current setting.
SetGroupVersionKind(kind GroupVersionKind)
// GroupVersionKind returns the stored group, version, and kind of an
// object, or nil if the object does not expose or provide these fields.
GroupVersionKind() GroupVersionKind
}
换句话说,
Go
语言中的
Kubernetes
对象就是一个数据结构,它可以:
•
返回或设置
GroupVersionKind
。
•
可以被深拷贝。
所谓深拷贝是指把数据结构完整地复制成一个新对象,新旧对象完全不共
享内存。如果你想修改一个对象而又不影响原始对象,就需要在修改前进
行一次深拷贝。请参考“
5.3.1
全局标签”中有关代码生成的内容,来了解 ...