Documentation ¶
Index ¶
- func KubeObjectToApplyYAML(data runtime.Object) (string, error)
- func MapEtcHosts(pod *v1.Pod, container *v1.Container, readOnly bool)
- func MarkPodAsClusterCritical(pod *v1.Pod)
- func MarkPodAsCritical(pod *v1.Pod)
- func MarkPodAsNodeCritical(pod *v1.Pod)
- type HostPathMapping
- type ImageRemapFunction
- type Object
- func (m *Object) APIVersion() string
- func (m *Object) GetName() string
- func (m *Object) GetNamespace() string
- func (m *Object) IsEmptyObject() bool
- func (m *Object) Kind() string
- func (m *Object) RemapImages(mapper ImageRemapFunction) error
- func (m *Object) Reparse(obj interface{}, fields ...string) error
- func (m *Object) Set(newValue interface{}, fieldPath ...string) error
- func (o *Object) ToUnstructured() *unstructured.Unstructured
- func (m *Object) ToYAML() ([]byte, error)
- type ObjectList
- type Visitor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KubeObjectToApplyYAML ¶ added in v1.23.0
KubeObjectToApplyYAML returns the kubernetes object converted to YAML, with "noisy" fields removed.
We remove:
- status (can't be applied, shouldn't be specified)
- metadata.creationTimestamp (can't be applied, shouldn't be specified)
func MapEtcHosts ¶
MapEtcHosts maps the /etc/hosts file into the pod (useful for gossip DNS)
func MarkPodAsClusterCritical ¶ added in v1.15.1
MarkPodAsClusterCritical sets the pod priority to system-cluster-critical
func MarkPodAsCritical ¶
MarkPodAsCritical adds the required annotations for a pod to be considered critical
func MarkPodAsNodeCritical ¶ added in v1.15.1
MarkPodAsNodeCritical sets the pod priority to system-node-critical
Types ¶
type HostPathMapping ¶ added in v1.24.0
type HostPathMapping struct { VolumeMount *v1.VolumeMount Volume *v1.Volume }
HostPathMapping allows fluent construction of a hostpath mount
func AddHostPathMapping ¶ added in v1.24.0
AddHostPathMapping is a helper function for mapping a host path into a container It returns a HostPathMapping for tweaking the defaults (which are notably read-only)
func (*HostPathMapping) WithHostPath ¶ added in v1.24.0
func (m *HostPathMapping) WithHostPath(p string) *HostPathMapping
WithHostPath changes the hostpath path
func (*HostPathMapping) WithReadWrite ¶ added in v1.24.0
func (m *HostPathMapping) WithReadWrite() *HostPathMapping
WithReadWrite changes the hostpath mapping to be read-write (the default is read-only)
func (*HostPathMapping) WithType ¶ added in v1.24.0
func (m *HostPathMapping) WithType(t v1.HostPathType) *HostPathMapping
WithType changes the hostpath mount type
type ImageRemapFunction ¶
type Object ¶ added in v1.19.0
type Object struct {
// contains filtered or unexported fields
}
Object holds arbitrary untyped kubernetes objects; it is used when we don't have the type definitions for them
func FromRuntimeObject ¶ added in v1.24.0
FromRuntimeObject converts from a runtime.Object.
func (*Object) APIVersion ¶ added in v1.19.0
APIVersion returns the apiVersion field of the object, or "" if it cannot be found or is invalid
func (*Object) GetName ¶ added in v1.23.0
GetName returns the namespace field of the object, or "" if it cannot be found or is invalid
func (*Object) GetNamespace ¶ added in v1.23.0
GetNamespace returns the namespace field of the object, or "" if it cannot be found or is invalid
func (*Object) IsEmptyObject ¶ added in v1.19.0
IsEmptyObject checks if the object has no keys set (i.e. `== {}`)
func (*Object) Kind ¶ added in v1.19.0
Kind returns the kind field of the object, or "" if it cannot be found or is invalid
func (*Object) RemapImages ¶ added in v1.19.0
func (m *Object) RemapImages(mapper ImageRemapFunction) error
func (*Object) ToUnstructured ¶ added in v1.23.0
func (o *Object) ToUnstructured() *unstructured.Unstructured
ToUnstructured converts the object to an unstructured.Unstructured
type ObjectList ¶ added in v1.19.0
type ObjectList []*Object
ObjectList describes a list of objects, allowing us to add bulk-methods
func LoadObjectsFrom ¶ added in v1.19.0
func LoadObjectsFrom(contents []byte) (ObjectList, error)
LoadObjectsFrom parses multiple objects from a yaml file
func (ObjectList) ToYAML ¶ added in v1.19.0
func (l ObjectList) ToYAML() ([]byte, error)
ToYAML serializes a list of objects back to bytes; it is the opposite of LoadObjectsFrom