Documentation ¶
Index ¶
- func GetAPIResource(restMapper meta.RESTMapper, gvk schema.GroupVersionKind) (schema.GroupVersionResource, bool, error)
- func JSONToUnstructured(in []byte) (unstructured.Unstructured, error)
- func NewRestMapper(config *rest.Config) (meta.RESTMapper, error)
- func YAMLToUnstructured(in []byte) (u unstructured.Unstructured, err error)
- func YAMLToUnstructuredSlice(in []byte) ([]*unstructured.Unstructured, error)
- type DryRunVerifier
- type OwnerInNamespacePredicate
- type OwnersOwnerInNamespacePredicate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAPIResource ¶
func GetAPIResource(restMapper meta.RESTMapper, gvk schema.GroupVersionKind) (schema.GroupVersionResource, bool, error)
GetAPIResource uses a rest mapper to get the GroupVersionResource and determine whether an object is namespaced or not
func JSONToUnstructured ¶
func JSONToUnstructured(in []byte) (unstructured.Unstructured, error)
JSONToUnstructured converts a raw json document into an Unstructured object
func NewRestMapper ¶
func NewRestMapper(config *rest.Config) (meta.RESTMapper, error)
NewRestMapper creates a restMapper from the discovery client
func YAMLToUnstructured ¶
func YAMLToUnstructured(in []byte) (u unstructured.Unstructured, err error)
YAMLToUnstructured converts a raw yaml document into an Unstructured object
func YAMLToUnstructuredSlice ¶
func YAMLToUnstructuredSlice(in []byte) ([]*unstructured.Unstructured, error)
YAMLToUnstructuredSlice converts a raw yaml document into a slice of pointers to Unstructured objects
Types ¶
type DryRunVerifier ¶ added in v0.4.0
type DryRunVerifier struct { Finder cmdutil.CRDFinder OpenAPIGetter discovery.OpenAPISchemaInterface }
DryRunVerifier verifies if a given group-version-kind supports DryRun against the current server. Sending dryRun requests to apiserver that don't support it will result in objects being unwillingly persisted.
It reads the OpenAPI to see if the given GVK supports dryRun. If the GVK can not be found, we assume that CRDs will have the same level of support as "namespaces", and non-CRDs will not be supported. We delay the check for CRDs as much as possible though, since it requires an extra round-trip to the server.
func NewDryRunVerifier ¶ added in v0.4.0
func NewDryRunVerifier(config *rest.Config) (*DryRunVerifier, error)
NewDryRunVerifier constructs a new DryRunVerifier
func (*DryRunVerifier) HasSupport ¶ added in v0.4.0
func (v *DryRunVerifier) HasSupport(gvk schema.GroupVersionKind) error
HasSupport verifies if the given gvk supports DryRun. An error is returned if it doesn't.
type OwnerInNamespacePredicate ¶
type OwnerInNamespacePredicate struct {
// contains filtered or unexported fields
}
OwnerInNamespacePredicate filters events to check the owner of the event object is in the controller's namespace
func NewOwnerInNamespacePredicate ¶
func NewOwnerInNamespacePredicate(client client.Client) OwnerInNamespacePredicate
NewOwnerInNamespacePredicate constructs a new OwnerInNamespacePredicate
func (OwnerInNamespacePredicate) Create ¶
func (p OwnerInNamespacePredicate) Create(e event.CreateEvent) bool
Create returns true if the event object's owner is in the same namespace
func (OwnerInNamespacePredicate) Delete ¶
func (p OwnerInNamespacePredicate) Delete(e event.DeleteEvent) bool
Delete returns true if the event object's owner is in the same namespace
func (OwnerInNamespacePredicate) Generic ¶
func (p OwnerInNamespacePredicate) Generic(e event.GenericEvent) bool
Generic returns true if the event object's owner is in the same namespace
func (OwnerInNamespacePredicate) Update ¶
func (p OwnerInNamespacePredicate) Update(e event.UpdateEvent) bool
Update returns true if the event object's owner is in the same namespace
type OwnersOwnerInNamespacePredicate ¶ added in v0.2.2
type OwnersOwnerInNamespacePredicate struct {
// contains filtered or unexported fields
}
OwnersOwnerInNamespacePredicate filters events to check the owners owner of the event object is in the controller's namespace
func NewOwnersOwnerInNamespacePredicate ¶ added in v0.2.2
func NewOwnersOwnerInNamespacePredicate(client client.Client) OwnersOwnerInNamespacePredicate
NewOwnersOwnerInNamespacePredicate constructs a new OwnersOwnerInNamespacePredicate
func (OwnersOwnerInNamespacePredicate) Create ¶ added in v0.2.2
func (p OwnersOwnerInNamespacePredicate) Create(e event.CreateEvent) bool
Create returns true if the event object owners owner is in the same namespace
func (OwnersOwnerInNamespacePredicate) Delete ¶ added in v0.2.2
func (p OwnersOwnerInNamespacePredicate) Delete(e event.DeleteEvent) bool
Delete returns true if the event object owners owner is in the same namespace
func (OwnersOwnerInNamespacePredicate) Generic ¶ added in v0.2.2
func (p OwnersOwnerInNamespacePredicate) Generic(e event.GenericEvent) bool
Generic returns true if the event object owners owner is in the same namespace
func (OwnersOwnerInNamespacePredicate) Update ¶ added in v0.2.2
func (p OwnersOwnerInNamespacePredicate) Update(e event.UpdateEvent) bool
Update returns true if the event object owners owner is in the same namespace
Directories ¶
Path | Synopsis |
---|---|
Package client has been copied from kubectl code almost verbatim Some methods have been moved from k/k into the utils.go file to remove the dependency on K/K https://github.com/kubernetes/kubernetes/blob/v1.13.1/pkg/kubectl/cmd/apply/apply.go
|
Package client has been copied from kubectl code almost verbatim Some methods have been moved from k/k into the utils.go file to remove the dependency on K/K https://github.com/kubernetes/kubernetes/blob/v1.13.1/pkg/kubectl/cmd/apply/apply.go |