@@ -21,6 +21,8 @@ type Driver struct {
2121 SuspendJob func (ctx context.Context , conf kube.Config , j * job.Job ) error
2222 DeleteJob func (ctx context.Context , conf kube.Config , j * job.Job ) error
2323 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 )
2426}
2527
2628func (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
9597 return & finalState , nil
9698 }
9799
98- finalOut , err := driver .refreshOutput (ctx , exr . Resource , * conf , * out , kubeOut )
100+ finalOut , err := driver .refreshOutput (ctx , * conf , * out , kubeOut )
99101 if err != nil {
100102 return nil , err
101103 }
@@ -106,6 +108,21 @@ func (driver *Driver) Sync(ctx context.Context, exr module.ExpandedResource) (*r
106108 return & finalState , nil
107109}
108110
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 )
111128}
0 commit comments