mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
begin wiring printopts through complete commands
This commit is contained in:
@@ -84,13 +84,24 @@ func TestCreateJobFromCronJob(t *testing.T) {
|
||||
f := cmdtesting.NewTestFactory()
|
||||
defer f.Cleanup()
|
||||
|
||||
printFlags := NewPrintFlags("created")
|
||||
|
||||
buf := bytes.NewBuffer([]byte{})
|
||||
cmdOptions := &CreateJobOptions{
|
||||
Name: testJobName,
|
||||
Namespace: testNamespaceName,
|
||||
Client: clientset.BatchV1(),
|
||||
Out: buf,
|
||||
Cmd: NewCmdCreateJob(f, buf),
|
||||
PrintFlags: printFlags,
|
||||
Name: testJobName,
|
||||
Namespace: testNamespaceName,
|
||||
Client: clientset.BatchV1(),
|
||||
Out: buf,
|
||||
Cmd: NewCmdCreateJob(f, buf),
|
||||
PrintObj: func(obj runtime.Object) error {
|
||||
p, err := printFlags.ToPrinter()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return p.PrintObj(obj, buf)
|
||||
},
|
||||
}
|
||||
|
||||
err := cmdOptions.createJob(cronJob)
|
||||
|
||||
Reference in New Issue
Block a user