File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,9 @@ SOFTWARE.
2525package v2beta1
2626
2727import (
28+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2829 "log"
30+ "time"
2931
3032 pdoknlv3 "github.com/pdok/atom-operator/api/v3"
3133 "sigs.k8s.io/controller-runtime/pkg/conversion"
@@ -140,7 +142,13 @@ func (src *Atom) ConvertTo(dstRaw conversion.Hub) error {
140142 dstEntry .Content = * srcDownload .Content
141143 }
142144 if srcDownload .Updated != nil {
143- dstEntry .Updated = nil // TODO Convert from srcDownload.Updated
145+ parsedUpdatedTime , err := time .Parse (time .RFC3339 , * srcDownload .Updated )
146+ if err != nil {
147+ log .Printf ("Error parsing updated time: %v" , err )
148+ dstEntry .Updated = nil
149+ }
150+ updatedTime := metav1 .NewTime (parsedUpdatedTime )
151+ dstEntry .Updated = & updatedTime
144152 }
145153
146154 // Map the links
@@ -248,10 +256,10 @@ func (dst *Atom) ConvertFrom(srcRaw conversion.Hub) error {
248256 Title : & srcEntry .Title ,
249257 }
250258
251- // if srcEntry.Updated != nil {
252- // Todo convert
253- // dstDownload.Updated = srcEntry.Updated
254- // }
259+ if srcEntry .Updated != nil {
260+ updatedString := srcEntry . Updated . Format ( time . RFC3339 )
261+ dstDownload .Updated = & updatedString
262+ }
255263
256264 // Polygon
257265 if srcEntry .SRS != nil {
You can’t perform that action at this time.
0 commit comments