Documentation
¶
Index ¶
- Variables
- func NewInCluster() (*kubernetes.Clientset, error)
- func PullPolicyFromString(ppStr string) (v1.PullPolicy, error)
- func SecurityContextFromPrivileged(privileged bool) v1.SecurityContext
- type ErrInvalidPullPolicy
- type FakeSecret
- func (f *FakeSecret) Apply(context.Context, *applyconfigurationscorev1.SecretApplyConfiguration, ...) (result *v1.Secret, err error)
- func (f *FakeSecret) Create(_ context.Context, secret *v1.Secret, _ metav1.CreateOptions) (*v1.Secret, error)
- func (f *FakeSecret) Delete(context.Context, string, metav1.DeleteOptions) error
- func (f *FakeSecret) DeleteCollection(context.Context, metav1.DeleteOptions, metav1.ListOptions) error
- func (f *FakeSecret) Get(_ context.Context, name string, _ metav1.GetOptions) (*v1.Secret, error)
- func (f *FakeSecret) List(context.Context, metav1.ListOptions) (*v1.SecretList, error)
- func (f *FakeSecret) Patch(context.Context, string, types.PatchType, []byte, metav1.PatchOptions, ...) (*v1.Secret, error)
- func (f *FakeSecret) Update(_ context.Context, secret *v1.Secret, _ metav1.UpdateOptions) (*v1.Secret, error)
- func (f *FakeSecret) Watch(context.Context, metav1.ListOptions) (watch.Interface, error)
- type FakeSecretsGetter
- type NamespaceLister
- type PodWatcher
- type StoreToPodLister
Constants ¶
This section is empty.
Variables ¶
var ( // ValidPullPolicies is the set of pull policies that this package considers valid ValidPullPolicies = map[v1.PullPolicy]struct{}{ v1.PullAlways: {}, v1.PullIfNotPresent: {}, v1.PullNever: {}, } )
Functions ¶
func NewInCluster ¶ added in v1.2.0
func NewInCluster() (*kubernetes.Clientset, error)
func PullPolicyFromString ¶
func PullPolicyFromString(ppStr string) (v1.PullPolicy, error)
PullPolicyFromString converts a string into an api.PullPolicy. returns an error if the string does not match a pull policy in ValidPullPolicies()
func SecurityContextFromPrivileged ¶ added in v1.3.0
func SecurityContextFromPrivileged(privileged bool) v1.SecurityContext
SecurityContextFromPrivileged create api.SecurityContext by privileged.
Types ¶
type ErrInvalidPullPolicy ¶
type ErrInvalidPullPolicy struct {
// contains filtered or unexported fields
}
ErrInvalidPullPolicy is the error returned when trying to convert an unknown string to an api.PullPolicy
func (ErrInvalidPullPolicy) Error ¶
func (e ErrInvalidPullPolicy) Error() string
Error is the error interface implementation
type FakeSecret ¶
type FakeSecret struct { FnGet func(string) (*corev1.Secret, error) FnCreate func(*v1.Secret) (*corev1.Secret, error) FnUpdate func(*v1.Secret) (*corev1.Secret, error) }
FakeSecret is a mock function that can be swapped in for (k8s.io/kubernetes/pkg/client/unversioned).SecretsInterface, so you can unit test your code.
func (*FakeSecret) Apply ¶ added in v1.3.0
func (f *FakeSecret) Apply(context.Context, *applyconfigurationscorev1.SecretApplyConfiguration, metav1.ApplyOptions) (result *v1.Secret, err error)
func (*FakeSecret) Create ¶
func (f *FakeSecret) Create(_ context.Context, secret *v1.Secret, _ metav1.CreateOptions) (*v1.Secret, error)
Create is the interface definition.
func (*FakeSecret) Delete ¶
func (f *FakeSecret) Delete(context.Context, string, metav1.DeleteOptions) error
Delete is the interface definition.
func (*FakeSecret) DeleteCollection ¶ added in v1.2.0
func (f *FakeSecret) DeleteCollection(context.Context, metav1.DeleteOptions, metav1.ListOptions) error
DeleteCollection is the interface definition.
func (*FakeSecret) Get ¶
func (f *FakeSecret) Get(_ context.Context, name string, _ metav1.GetOptions) (*v1.Secret, error)
Get is the interface definition.
func (*FakeSecret) List ¶
func (f *FakeSecret) List(context.Context, metav1.ListOptions) (*v1.SecretList, error)
List is the interface definition.
func (*FakeSecret) Patch ¶ added in v1.2.0
func (f *FakeSecret) Patch(context.Context, string, types.PatchType, []byte, metav1.PatchOptions, ...string) (*v1.Secret, error)
Patch is the interface definition.
func (*FakeSecret) Update ¶
func (f *FakeSecret) Update(_ context.Context, secret *v1.Secret, _ metav1.UpdateOptions) (*v1.Secret, error)
Update is the interface definition.
func (*FakeSecret) Watch ¶
func (f *FakeSecret) Watch(context.Context, metav1.ListOptions) (watch.Interface, error)
Watch is the interface definition.
type FakeSecretsGetter ¶ added in v1.2.0
type FakeSecretsGetter struct {
Fn func(string) typedcorev1.SecretInterface
}
func (*FakeSecretsGetter) Secrets ¶ added in v1.2.0
func (f *FakeSecretsGetter) Secrets(namespace string) typedcorev1.SecretInterface
Secrets is the interface definition.Secret
type NamespaceLister ¶
type NamespaceLister interface {
List(ctx context.Context, opts metav1.ListOptions) (*corev1.NamespaceList, error)
}
NamespaceLister is a (k8s.io/kubernetes/pkg/client/unversioned).NamespaceInterface compatible interface which only has the List function. It's used in places that only need List to make them easier to test and more easily swappable with other implementations (should the need arise).
Example usage:
var nsl NamespaceLister nsl = kubeClient.Namespaces()
type PodWatcher ¶
type PodWatcher struct { Store StoreToPodLister Controller cache.Controller }
PodWatcher is a struct which holds the return values of (k8s.io/kubernetes/pkg/controller/framework).NewIndexerInformer together.
func NewPodWatcher ¶
func NewPodWatcher(c kubernetes.Clientset, ns string) *PodWatcher
NewPodWatcher creates a new BuildPodWatcher useful to list the pods using a cache which gets updated based on the watch func.