// GetDaemonSetPodsEvents gets events associated to pods in daemon set.
func GetDaemonSetPodsEvents(client client.Interface, namespace, daemonSetName string) (
	[]api.Event, error) {

	daemonSet, err := client.Extensions().DaemonSets(namespace).Get(daemonSetName)

	if err != nil {
		return nil, err
	}

	podEvents, err := event.GetPodsEvents(client, namespace, daemonSet.Spec.Selector.MatchLabels)

	if err != nil {
		return nil, err
	}

	return podEvents, nil
}
Esempio n. 2
0
// GetStatefulSetPodsEvents gets events associated to pods in pet set.
func GetStatefulSetPodsEvents(client *client.Clientset, namespace, statefulSetName string) (
	[]api.Event, error) {

	statefulSet, err := client.Apps().StatefulSets(namespace).Get(statefulSetName)

	if err != nil {
		return nil, err
	}

	podEvents, err := event.GetPodsEvents(client, namespace, statefulSet.Spec.Selector.MatchLabels)

	if err != nil {
		return nil, err
	}

	return podEvents, nil
}
Esempio n. 3
0
// GetJobPodsEvents gets events associated to pods in job.
func GetJobPodsEvents(client client.Interface, namespace, jobName string) (
	[]api.Event, error) {

	job, err := client.Extensions().Jobs(namespace).Get(jobName)

	if err != nil {
		return nil, err
	}

	podEvents, err := event.GetPodsEvents(client, namespace, job.Spec.Selector.MatchLabels)

	if err != nil {
		return nil, err
	}

	return podEvents, nil
}
func getReplicationControllerPodsEvents(client client.Interface, namespace,
	replicationControllerName string) ([]api.Event, error) {

	replicationController, err := client.ReplicationControllers(namespace).Get(replicationControllerName)

	if err != nil {
		return nil, err
	}

	podEvents, err := resourceEvent.GetPodsEvents(client, namespace,
		replicationController.Spec.Selector)

	if err != nil {
		return nil, err
	}

	return podEvents, nil
}