Skip to content

Commit 015e8be

Browse files
committed
added methods to fake client
1 parent 58cf579 commit 015e8be

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

internal/k8s/fake/client.go

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,40 @@ func (client *Client) GetJobLogs(name string, opts *corev1.PodLogOptions) (*rest
5151

5252
return req, args.Error(1)
5353
}
54+
55+
// GetPodEvents simulates returning a formatted string of events for a given Pod.
56+
func (client *Client) GetPodEvents(podName string) (string, error) {
57+
args := client.Called(podName)
58+
var out string
59+
if v := args.Get(0); v != nil {
60+
out, _ = v.(string)
61+
}
62+
return out, args.Error(1)
63+
}
64+
// GetJobEvents simulates returning a formatted string of events for a given Job.
65+
func (client *Client) GetJobEvents(jobName string) (string, error) {
66+
args := client.Called(jobName)
67+
var out string
68+
if v := args.Get(0); v != nil {
69+
out, _ = v.(string)
70+
}
71+
return out, args.Error(1)
72+
}
73+
// GetPodsFromJob simulates returning the Pod names created by a Job.
74+
func (client *Client) GetPodsFromJob(jobName string) ([]string, error) {
75+
args := client.Called(jobName)
76+
var names []string
77+
if v := args.Get(0); v != nil {
78+
names, _ = v.([]string)
79+
}
80+
return names, args.Error(1)
81+
}
82+
// GetJobFromPod simulates returning the Job name associated with a Pod.
83+
func (client *Client) GetJobFromPod(podName string) (string, error) {
84+
args := client.Called(podName)
85+
var jobName string
86+
if v := args.Get(0); v != nil {
87+
jobName, _ = v.(string)
88+
}
89+
return jobName, args.Error(1)
90+
}

0 commit comments

Comments
 (0)