MCPcopy
hub / github.com/kubernetes/kubectl / watchTestData

Function watchTestData

pkg/cmd/get/get_test.go:1829–1933  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1827}
1828
1829func watchTestData() ([]corev1.Pod, []watch.Event) {
1830 pods := []corev1.Pod{
1831 {
1832 ObjectMeta: metav1.ObjectMeta{
1833 Name: "bar",
1834 Namespace: "test",
1835 ResourceVersion: "9",
1836 },
1837 Spec: corev1.PodSpec{
1838 RestartPolicy: corev1.RestartPolicyAlways,
1839 DNSPolicy: corev1.DNSClusterFirst,
1840 TerminationGracePeriodSeconds: &grace,
1841 SecurityContext: &corev1.PodSecurityContext{},
1842 EnableServiceLinks: &enableServiceLinks,
1843 },
1844 },
1845 {
1846 ObjectMeta: metav1.ObjectMeta{
1847 Name: "foo",
1848 Namespace: "test",
1849 ResourceVersion: "10",
1850 },
1851 Spec: corev1.PodSpec{
1852 RestartPolicy: corev1.RestartPolicyAlways,
1853 DNSPolicy: corev1.DNSClusterFirst,
1854 TerminationGracePeriodSeconds: &grace,
1855 SecurityContext: &corev1.PodSecurityContext{},
1856 EnableServiceLinks: &enableServiceLinks,
1857 },
1858 },
1859 }
1860 events := []watch.Event{
1861 // current state events
1862 {
1863 Type: watch.Added,
1864 Object: &corev1.Pod{
1865 ObjectMeta: metav1.ObjectMeta{
1866 Name: "bar",
1867 Namespace: "test",
1868 ResourceVersion: "9",
1869 },
1870 Spec: corev1.PodSpec{
1871 RestartPolicy: corev1.RestartPolicyAlways,
1872 DNSPolicy: corev1.DNSClusterFirst,
1873 TerminationGracePeriodSeconds: &grace,
1874 SecurityContext: &corev1.PodSecurityContext{},
1875 EnableServiceLinks: &enableServiceLinks,
1876 },
1877 },
1878 },
1879 {
1880 Type: watch.Added,
1881 Object: &corev1.Pod{
1882 ObjectMeta: metav1.ObjectMeta{
1883 Name: "foo",
1884 Namespace: "test",
1885 ResourceVersion: "10",
1886 },

Callers 15

TestWatchLabelSelectorFunction · 0.85
TestWatchFieldSelectorFunction · 0.85
TestWatchResourceFunction · 0.85
TestWatchNonExistObjectFunction · 0.85
TestWatchStatusFunction · 0.85
TestWatchTableResourceFunction · 0.85
TestWatchOnlyResourceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…