Documentation ¶
Index ¶
- Constants
- func AddOwnerRefToObject(o metav1.Object, r metav1.OwnerReference)
- func CascadeDeleteOptions(gracePeriodSeconds int64) *metav1.DeleteOptions
- func ClusterListOpt(clusterName string) metav1.ListOptions
- func CreateAndWaitPod(kubecli kubernetes.Interface, ns string, pod *v1.Pod, timeout time.Duration) (*v1.Pod, error)
- func CreateCRD(clientset apiextensionsclient.Interface, ...) error
- func CreateOrUpdateService(sclient clientv1.ServiceInterface, svc *v1.Service) error
- func CreatePatch(o, n, datastruct interface{}) ([]byte, error)
- func ExecCommandInContainer(context *ExecContext, namespace string, podName string, containerName string, ...) (string, string, error)
- func ExecCommandInPod(context *ExecContext, namespace string, podName string, cmd ...string) (string, string, error)
- func ExecWithOptions(context *ExecContext, options ExecOptions) (string, string, error)
- func FakeClusterConfig() (*rest.Config, error)
- func GetClusterList(restcli rest.Interface, ns string) (*api.ReplicatedStatefulSetList, error)
- func GetOutput(pReader *io.PipeReader, result *bytes.Buffer, wg *sync.WaitGroup, tag string)
- func GetPodNames(pods []*v1.Pod) []string
- func GetPodsForStatefulSet(cli kubernetes.Interface, sts *apps.StatefulSet) (*api.PodList, error)
- func GetStatefulSet(cli kubernetes.Interface, namespace string, setName string) (*apps.StatefulSet, error)
- func ImageName(baseImage, version string) string
- func InClusterConfig() (*rest.Config, error)
- func IsKubernetesResourceAlreadyExistError(err error) bool
- func IsKubernetesResourceNotFoundError(err error) bool
- func IsNodeReady(n v1.Node) bool
- func IsPodReady(pod *v1.Pod) bool
- func LabelsForActiveCluster(clusterName string) map[string]string
- func LabelsForCluster(clusterName string) map[string]string
- func MemberRemoveEvent(memberName string, cl *api.ReplicatedStatefulSet) *v1.Event
- func MemberUpgradedEvent(memberName, oldVersion, newVersion string, cl *api.ReplicatedStatefulSet) *v1.Event
- func MustNewKubeClient() kubernetes.Interface
- func MustNewKubeClientFromConfig(cfg *rest.Config) kubernetes.Interface
- func MustNewKubeExtClient() apiextensionsclient.Interface
- func NewMemberAddEvent(memberName string, cl *api.ReplicatedStatefulSet) *v1.Event
- func PatchDeployment(kubecli kubernetes.Interface, namespace, name string, ...) error
- func PodSpecToPrettyJSON(pod *v1.Pod) (string, error)
- func PodWithNodeSelector(p *v1.Pod, ns map[string]string) *v1.Pod
- func ReplacingDeadMemberEvent(memberName string, cl *api.ReplicatedStatefulSet) *v1.Event
- func TestConfig() (*rest.Config, error)
- func WaitCRDReady(clientset apiextensionsclient.Interface, crdName string) error
- type ExecContext
- type ExecOptions
- type ReplicatedStatefulSetCRUpdateFunc
- type TLSData
Constants ¶
const TolerateUnreadyEndpointsAnnotation = "service.alpha.kubernetes.io/tolerate-unready-endpoints"
Variables ¶
This section is empty.
Functions ¶
func AddOwnerRefToObject ¶
func AddOwnerRefToObject(o metav1.Object, r metav1.OwnerReference)
func CascadeDeleteOptions ¶
func CascadeDeleteOptions(gracePeriodSeconds int64) *metav1.DeleteOptions
func ClusterListOpt ¶
func ClusterListOpt(clusterName string) metav1.ListOptions
We are using internal api types for cluster related.
func CreateAndWaitPod ¶
func CreateAndWaitPod(kubecli kubernetes.Interface, ns string, pod *v1.Pod, timeout time.Duration) (*v1.Pod, error)
CreateAndWaitPod is a workaround for self hosted and util for testing. We should eventually get rid of this in critical code path and move it to test util.
func CreateCRD ¶
func CreateCRD(clientset apiextensionsclient.Interface, crdName, rkind, rplural, shortName string) error
func CreateOrUpdateService ¶
func CreateOrUpdateService(sclient clientv1.ServiceInterface, svc *v1.Service) error
func CreatePatch ¶
func ExecCommandInContainer ¶
func ExecCommandInContainer(context *ExecContext, namespace string, podName string, containerName string, cmd ...string) (string, string, error)
ExecCommandInContainerWithFullOutput executes a command in the specified container and return stdout, stderr and error
func ExecCommandInPod ¶
func ExecWithOptions ¶
func ExecWithOptions(context *ExecContext, options ExecOptions) (string, string, error)
ExecWithOptions executes a command in the specified container, returning stdout, stderr and error. `options` allowed for additional parameters to be passed.
func FakeClusterConfig ¶
func GetClusterList ¶
func GetPodNames ¶
func GetPodsForStatefulSet ¶
func GetPodsForStatefulSet(cli kubernetes.Interface, sts *apps.StatefulSet) (*api.PodList, error)
func GetStatefulSet ¶
func GetStatefulSet(cli kubernetes.Interface, namespace string, setName string) (*apps.StatefulSet, error)
func InClusterConfig ¶
func IsNodeReady ¶
IsNodeReady checks if the Node condition is ready.
func IsPodReady ¶
IsPodReady returns false if the Pod Status is nil
func LabelsForActiveCluster ¶
func LabelsForCluster ¶
func MemberRemoveEvent ¶
func MemberRemoveEvent(memberName string, cl *api.ReplicatedStatefulSet) *v1.Event
func MemberUpgradedEvent ¶
func MemberUpgradedEvent(memberName, oldVersion, newVersion string, cl *api.ReplicatedStatefulSet) *v1.Event
func MustNewKubeClient ¶
func MustNewKubeClient() kubernetes.Interface
func MustNewKubeClientFromConfig ¶
func MustNewKubeClientFromConfig(cfg *rest.Config) kubernetes.Interface
func MustNewKubeExtClient ¶
func MustNewKubeExtClient() apiextensionsclient.Interface
func NewMemberAddEvent ¶
func NewMemberAddEvent(memberName string, cl *api.ReplicatedStatefulSet) *v1.Event
func PatchDeployment ¶
func PatchDeployment(kubecli kubernetes.Interface, namespace, name string, updateFunc func(*appsv1beta1.Deployment)) error
func ReplacingDeadMemberEvent ¶
func ReplacingDeadMemberEvent(memberName string, cl *api.ReplicatedStatefulSet) *v1.Event
func TestConfig ¶
func WaitCRDReady ¶
func WaitCRDReady(clientset apiextensionsclient.Interface, crdName string) error
Types ¶
type ExecContext ¶
type ExecOptions ¶
type ExecOptions struct { Command []string Namespace string PodName string ContainerName string Stdin io.Reader StdinText *string CaptureStdout bool CaptureStderr bool // If false, whitespace in std{err,out} will be removed. PreserveWhitespace bool Timeout time.Duration }
ExecOptions passed to ExecWithOptions
type ReplicatedStatefulSetCRUpdateFunc ¶
type ReplicatedStatefulSetCRUpdateFunc func(*api.ReplicatedStatefulSet)
ReplicatedStatefulSetCRUpdateFunc is a function to be used when atomically updating a Cluster CR.