Documentation
¶
Index ¶
- func InitLogger()
- func KubeApply(c client.Client, obj runtime.Object) bool
- func KubeCheck(c client.Client, obj runtime.Object) bool
- func KubeClient() client.Client
- func KubeConfig() *rest.Config
- func KubeCreateSkipExisting(c client.Client, obj runtime.Object) bool
- func KubeDelete(c client.Client, obj runtime.Object) bool
- func KubeObject(text string) runtime.Object
- func KubeRest() *rest.RESTClient
- func NewFastRESTMapper(dc discovery.DiscoveryInterface, filter APIGroupFilterFunc) meta.RESTMapper
- func Panic(err error)
- type APIGroupFilterFunc
- type FastRESTMapper
- func (m *FastRESTMapper) Discover() error
- func (m *FastRESTMapper) DiscoverGroup(gr *restmapper.APIGroupResources) error
- func (m *FastRESTMapper) DiscoverOnError(err error) bool
- func (m *FastRESTMapper) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error)
- func (m *FastRESTMapper) KindsFor(resource schema.GroupVersionResource) ([]schema.GroupVersionKind, error)
- func (m *FastRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) (*meta.RESTMapping, error)
- func (m *FastRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string) ([]*meta.RESTMapping, error)
- func (m *FastRESTMapper) ResourceFor(input schema.GroupVersionResource) (schema.GroupVersionResource, error)
- func (m *FastRESTMapper) ResourceSingularizer(resource string) (string, error)
- func (m *FastRESTMapper) ResourcesFor(input schema.GroupVersionResource) ([]schema.GroupVersionResource, error)
- type PrintColumn
- type PrintTable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitLogger ¶ added in v1.0.1
func InitLogger()
InitLogger initializes the logrus logger with defaults
func KubeApply ¶
KubeApply will check if the object exists and will create/update accordingly and report the object status.
func KubeClient ¶
KubeClient resturns a controller-runtime client We use a lazy mapper and a specialized implementation of fast mapper in order to avoid lags when running a CLI client to a far away cluster.
func KubeConfig ¶
KubeConfig loads kubernetes client config from default locations (flags, user dir, etc)
func KubeCreateSkipExisting ¶
KubeCreateSkipExisting will check if the object exists and will create/skip accordingly and report the object status.
func KubeDelete ¶
KubeDelete deletes an object and reports the object status.
func KubeObject ¶
KubeObject loads a text yaml/json to a kubernets object.
func KubeRest ¶ added in v1.0.1
func KubeRest() *rest.RESTClient
KubeRest returns a configured kubernetes REST client
func NewFastRESTMapper ¶
func NewFastRESTMapper(dc discovery.DiscoveryInterface, filter APIGroupFilterFunc) meta.RESTMapper
NewFastRESTMapper initializes a FastRESTMapper
Types ¶
type APIGroupFilterFunc ¶
APIGroupFilterFunc is a filtering function to limit the amount of server groups we load
type FastRESTMapper ¶
type FastRESTMapper struct {
Discovery discovery.DiscoveryInterface
Filter APIGroupFilterFunc
Mapper meta.RESTMapper
}
FastRESTMapper loads the mapper data from the server with filter and concurrency and rediscovers the mapping on meta.NoKindMatchError errors See https://github.com/kubernetes-sigs/controller-runtime/issues/537
func (*FastRESTMapper) Discover ¶ added in v1.0.1
func (m *FastRESTMapper) Discover() error
Discover reads server groups and then reads each group to initialize the mapper groups.
func (*FastRESTMapper) DiscoverGroup ¶ added in v1.0.1
func (m *FastRESTMapper) DiscoverGroup(gr *restmapper.APIGroupResources) error
DiscoverGroup reads the server group
func (*FastRESTMapper) DiscoverOnError ¶ added in v1.0.1
func (m *FastRESTMapper) DiscoverOnError(err error) bool
DiscoverOnError check if the error is NoMatchError and calls discover
func (*FastRESTMapper) KindFor ¶
func (m *FastRESTMapper) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error)
KindFor implements Mapper.KindFor
func (*FastRESTMapper) KindsFor ¶
func (m *FastRESTMapper) KindsFor(resource schema.GroupVersionResource) ([]schema.GroupVersionKind, error)
KindsFor implements Mapper.KindsFor
func (*FastRESTMapper) RESTMapping ¶
func (m *FastRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) (*meta.RESTMapping, error)
RESTMapping implements Mapper.RESTMapping
func (*FastRESTMapper) RESTMappings ¶
func (m *FastRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string) ([]*meta.RESTMapping, error)
RESTMappings implements Mapper.RESTMappings
func (*FastRESTMapper) ResourceFor ¶
func (m *FastRESTMapper) ResourceFor(input schema.GroupVersionResource) (schema.GroupVersionResource, error)
ResourceFor implements Mapper.ResourceFor
func (*FastRESTMapper) ResourceSingularizer ¶
func (m *FastRESTMapper) ResourceSingularizer(resource string) (string, error)
ResourceSingularizer implements Mapper.ResourceSingularizer
func (*FastRESTMapper) ResourcesFor ¶
func (m *FastRESTMapper) ResourcesFor(input schema.GroupVersionResource) ([]schema.GroupVersionResource, error)
ResourcesFor implements Mapper.ResourcesFor
type PrintColumn ¶ added in v1.0.1
PrintColumn is a column in PrintTable
func (*PrintColumn) Pad ¶ added in v1.0.1
func (c *PrintColumn) Pad(s string) string
Pad adds padding the provided string to make it print nicely as a table cell
func (*PrintColumn) RecalcWidth ¶ added in v1.0.1
func (c *PrintColumn) RecalcWidth()
RecalcWidth can be called to recalculate the column width after manual updates are made
type PrintTable ¶ added in v1.0.1
type PrintTable struct {
Columns []PrintColumn
NumRows int
}
PrintTable is a table for printing with fixed column width and padding
func (*PrintTable) AddRow ¶ added in v1.0.1
func (t *PrintTable) AddRow(items ...string) *PrintTable
AddRow adds a row of headers/values to the table
func (*PrintTable) RecalcWidth ¶ added in v1.0.1
func (t *PrintTable) RecalcWidth() *PrintTable
RecalcWidth can be called to recalculate the columns width after manual updates are made
func (*PrintTable) String ¶ added in v1.0.1
func (t *PrintTable) String() string