Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClientConfigFromKubeConfig ¶ added in v0.2.10
Types ¶
type Client ¶
type Client struct {
KubeClient kubernetes.Interface
CSIClient csi.Interface
// contains filtered or unexported fields
}
Client encapsulates a client for a Kubernetes cluster.
func NewClient ¶
NewClient builds a kubernetes client to interact with the live cluster. The kube config file path or the kubeconfig yaml must be specified If not specified, defaults are assumed - configPath: ~/.kube/config, configContext: current context
func (*Client) FetchObjects ¶
FetchObjects returns the objects from a Kubernetes cluster. ctx is currently unused during API calls. More info: https://github.com/kubernetes/community/pull/1166
type Identifier ¶
Identifier is used to identify a specific namspace scoped object.
type ObjectFilter ¶ added in v0.1.4
ObjectFilter stores k8s object's fields that needs to be included or excluded while running checks
func NewObjectFilter ¶ added in v0.1.4
func NewObjectFilter(includeNamespace, excludeNamespace string) (ObjectFilter, error)
NewObjectFilter is a constructor to initialize an instance of ObjectFilter
func (ObjectFilter) NamespaceOptions ¶ added in v0.1.4
func (f ObjectFilter) NamespaceOptions(opts metav1.ListOptions) metav1.ListOptions
NamespaceOptions returns ListOptions for filtering by namespace
type Objects ¶
type Objects struct {
Nodes *corev1.NodeList
PersistentVolumes *corev1.PersistentVolumeList
SystemNamespace *corev1.Namespace
Pods *corev1.PodList
PodTemplates *corev1.PodTemplateList
PersistentVolumeClaims *corev1.PersistentVolumeClaimList
ConfigMaps *corev1.ConfigMapList
Services *corev1.ServiceList
Secrets *corev1.SecretList
ServiceAccounts *corev1.ServiceAccountList
ResourceQuotas *corev1.ResourceQuotaList
LimitRanges *corev1.LimitRangeList
VolumeSnapshotsV1 *csitypes.VolumeSnapshotList
VolumeSnapshotsV1Content *csitypes.VolumeSnapshotContentList
VolumeSnapshotsBeta *csitypesbeta.VolumeSnapshotList
VolumeSnapshotsBetaContent *csitypesbeta.VolumeSnapshotContentList
StorageClasses *st.StorageClassList
DefaultStorageClass *st.StorageClass
MutatingWebhookConfigurations *arv1.MutatingWebhookConfigurationList
ValidatingWebhookConfigurations *arv1.ValidatingWebhookConfigurationList
Namespaces *corev1.NamespaceList
CronJobs *batchv1beta1.CronJobList
}
Objects encapsulates all the objects from a Kubernetes cluster.
type Option ¶
type Option func(*options) error
Option function that allows injecting options while building kube.Client.
func InCluster ¶ added in v0.2.10
func InCluster() Option
InCluster indicates that we are accessing the Kubernetes API from a Pod
func WithConfigFile ¶
WithConfigFile returns an Option injected with a config file path.
func WithKubeContext ¶
WithKubeContext returns an Option injected with a kubernetes context.
func WithMergedConfigFiles ¶ added in v0.1.1
WithMergedConfigFiles returns an Option injected with value of $KUBECONFIG
func WithTimeout ¶
WithTimeout returns an Option injected with a timeout option while building client.
func WithTransportWrapper ¶ added in v0.1.3
func WithTransportWrapper(f TransportWrapper) Option
WithTransportWrapper allows wrapping the underlying http.RoundTripper
type TransportWrapper ¶ added in v0.1.3
type TransportWrapper = func(http.RoundTripper) http.RoundTripper
TransportWrapper wraps an http.RoundTripper