@@ -21,6 +21,8 @@ type Driver struct {
21
21
SuspendJob func (ctx context.Context , conf kube.Config , j * job.Job ) error
22
22
DeleteJob func (ctx context.Context , conf kube.Config , j * job.Job ) error
23
23
StartJob func (ctx context.Context , conf kube.Config , j * job.Job ) error
24
+ GetJobPods func (ctx context.Context , conf kube.Config , labels map [string ]string ) ([]kube.Pod , error )
25
+ StreamLogs func (ctx context.Context , kubeConf kube.Config , filter map [string ]string ) (<- chan module.LogChunk , error )
24
26
}
25
27
26
28
func (driver * Driver ) Plan (_ context.Context , res module.ExpandedResource , act module.ActionRequest ) (* resource.Resource , error ) {
@@ -95,7 +97,7 @@ func (driver *Driver) Sync(ctx context.Context, exr module.ExpandedResource) (*r
95
97
return & finalState , nil
96
98
}
97
99
98
- finalOut , err := driver .refreshOutput (ctx , exr . Resource , * conf , * out , kubeOut )
100
+ finalOut , err := driver .refreshOutput (ctx , * conf , * out , kubeOut )
99
101
if err != nil {
100
102
return nil , err
101
103
}
@@ -106,6 +108,21 @@ func (driver *Driver) Sync(ctx context.Context, exr module.ExpandedResource) (*r
106
108
return & finalState , nil
107
109
}
108
110
109
- func (* Driver ) Output (context.Context , module.ExpandedResource ) (json.RawMessage , error ) {
110
- return nil , nil
111
+ func (driver * Driver ) Output (ctx context.Context , exr module.ExpandedResource ) (json.RawMessage , error ) {
112
+ output , err := ReadOutputData (exr )
113
+ if err != nil {
114
+ return nil , err
115
+ }
116
+
117
+ conf , err := config .ReadConfig (exr .Resource , exr .Spec .Configs , driver .Conf )
118
+ if err != nil {
119
+ return nil , errors .ErrInternal .WithCausef (err .Error ())
120
+ }
121
+
122
+ var kubeOut kubernetes.Output
123
+ if err := json .Unmarshal (exr .Dependencies [KeyKubeDependency ].Output , & kubeOut ); err != nil {
124
+ return nil , errors .ErrInternal .WithMsgf ("invalid kube state" ).WithCausef (err .Error ())
125
+ }
126
+
127
+ return driver .refreshOutput (ctx , * conf , * output , kubeOut )
111
128
}
0 commit comments