Documentation ¶
Index ¶
- func CalculateHash(obj interface{}) (string, error)
- func CheckObjByGroupKindName(objs []*uns.Unstructured, group, kind, namespace, name string) bool
- func GenerateKubeProxyConfiguration(args map[string]operv1.ProxyArgumentList) (string, error)
- func MergeKubeProxyArguments(defaults, overrides map[string]operv1.ProxyArgumentList) map[string]operv1.ProxyArgumentList
- func NewDynamicRESTMapper(cfg *rest.Config) (meta.RESTMapper, error)
- func RemoveObjByGroupKindName(objs []*uns.Unstructured, group, kind, namespace, name string) []*uns.Unstructured
- func ReplaceObj(objs []*uns.Unstructured, new *uns.Unstructured) []*uns.Unstructured
- func Same(obj1, obj2 *uns.Unstructured) bool
- func ToUnstructured(obj interface{}) (*uns.Unstructured, error)
- func UpdateObjByGroupKindName(objs []*uns.Unstructured, group, kind, namespace, name string, ...)
- type DynamicRESTMapper
- func (drm *DynamicRESTMapper) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error)
- func (drm *DynamicRESTMapper) KindsFor(resource schema.GroupVersionResource) ([]schema.GroupVersionKind, error)
- func (drm *DynamicRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) (*meta.RESTMapping, error)
- func (drm *DynamicRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string) ([]*meta.RESTMapping, error)
- func (drm *DynamicRESTMapper) ResourceFor(input schema.GroupVersionResource) (schema.GroupVersionResource, error)
- func (drm *DynamicRESTMapper) ResourceSingularizer(resource string) (singular string, err error)
- func (drm *DynamicRESTMapper) ResourcesFor(input schema.GroupVersionResource) ([]schema.GroupVersionResource, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateHash ¶
CalculateHash computes MD5 sum of the JSONfied object passed as obj.
func CheckObjByGroupKindName ¶
func CheckObjByGroupKindName(objs []*uns.Unstructured, group, kind, namespace, name string) bool
func GenerateKubeProxyConfiguration ¶
func GenerateKubeProxyConfiguration(args map[string]operv1.ProxyArgumentList) (string, error)
GenerateKubeProxyConfiguration takes a set of defaults and a set of overrides in the form of kube-proxy command-line arguments, and returns a YAML kube-proxy config file.
func MergeKubeProxyArguments ¶
func MergeKubeProxyArguments(defaults, overrides map[string]operv1.ProxyArgumentList) map[string]operv1.ProxyArgumentList
MergeKubeProxyArguments merges a set of default kube-proxy command-line arguments with a set of overrides, keeping only the last-specified copy of each argument.
func NewDynamicRESTMapper ¶
func NewDynamicRESTMapper(cfg *rest.Config) (meta.RESTMapper, error)
NewDynamicRESTMapper returns a RESTMapper that dynamically discovers resource types at runtime. This is in contrast to controller-manager's default RESTMapper, which only checks resource types at startup, and so can't handle the case of first creating a CRD and then creating an instance of that CRD.
func RemoveObjByGroupKindName ¶
func RemoveObjByGroupKindName(objs []*uns.Unstructured, group, kind, namespace, name string) []*uns.Unstructured
RemoveObjByGroupKindName will remove a given object from the list of objects. It will match on the object's kind, namespace and name. If the object isn't found in the list, it will not be removed.
func ReplaceObj ¶
func ReplaceObj(objs []*uns.Unstructured, new *uns.Unstructured) []*uns.Unstructured
ReplaceObj will replace a given object in a list of objects with another. It will match on the object's group, kind, and identity. If the object isn't found in the list, `new` will not be added.
func Same ¶
func Same(obj1, obj2 *uns.Unstructured) bool
Same returns true if two objects are the "same" - that is to say, they would point to the same object in the apiserver. Specifically, they have the same group, kind, namespace, and name
func ToUnstructured ¶
func ToUnstructured(obj interface{}) (*uns.Unstructured, error)
ToUnstructured converts an arbitrary object (which MUST obey the k8s object conventions) to an Unstructured
func UpdateObjByGroupKindName ¶
func UpdateObjByGroupKindName(objs []*uns.Unstructured, group, kind, namespace, name string, f func(*uns.Unstructured))
UpdateObjByGroupKindName calls f on the object that matches the group, kind, namespace, and name. F is allowed to mutate the object.
Types ¶
type DynamicRESTMapper ¶
type DynamicRESTMapper struct {
// contains filtered or unexported fields
}
func (*DynamicRESTMapper) KindFor ¶
func (drm *DynamicRESTMapper) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error)
func (*DynamicRESTMapper) KindsFor ¶
func (drm *DynamicRESTMapper) KindsFor(resource schema.GroupVersionResource) ([]schema.GroupVersionKind, error)
func (*DynamicRESTMapper) RESTMapping ¶
func (drm *DynamicRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) (*meta.RESTMapping, error)
func (*DynamicRESTMapper) RESTMappings ¶
func (drm *DynamicRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string) ([]*meta.RESTMapping, error)
func (*DynamicRESTMapper) ResourceFor ¶
func (drm *DynamicRESTMapper) ResourceFor(input schema.GroupVersionResource) (schema.GroupVersionResource, error)
func (*DynamicRESTMapper) ResourceSingularizer ¶
func (drm *DynamicRESTMapper) ResourceSingularizer(resource string) (singular string, err error)
func (*DynamicRESTMapper) ResourcesFor ¶
func (drm *DynamicRESTMapper) ResourcesFor(input schema.GroupVersionResource) ([]schema.GroupVersionResource, error)