@@ -121,17 +121,12 @@ func (s *Server) UpdateGitProvider(ctx context.Context, req *cordiumv1.GitProvid
121121 }
122122
123123 itm , err := s .octeliumC .CordiumC ().GetGitProvider (ctx ,
124- & rmetav1.GetOptions {
125- Name : req .Metadata .Name ,
126- Uid : req .Metadata .Uid ,
127- })
124+ apivalidation .ObjectToRGetOptions (req ))
128125 if err != nil {
129126 return nil , serr .K8sNotFoundOrInternalWithErr (err )
130127 }
131128
132- org , err := s .octeliumC .CordiumC ().GetSpace (ctx , & rmetav1.GetOptions {
133- Uid : itm .Status .SpaceRef .Uid ,
134- })
129+ org , err := s .octeliumC .CordiumC ().GetSpace (ctx , apivalidation .ObjectReferenceToRGetOptions (itm .Status .SpaceRef ))
135130 if err != nil {
136131 return nil , err
137132 }
@@ -166,10 +161,7 @@ func (s *Server) DeleteGitProvider(ctx context.Context, req *metav1.DeleteOption
166161 return nil , err
167162 }
168163
169- itm , err := s .octeliumC .CordiumC ().GetGitProvider (ctx , & rmetav1.GetOptions {
170- Uid : req .Uid ,
171- Name : req .Name ,
172- })
164+ itm , err := s .octeliumC .CordiumC ().GetGitProvider (ctx , apivalidation .DeleteOptionsToRGetOptions (req ))
173165 if err != nil {
174166 return nil , serr .K8sNotFoundOrInternalWithErr (err )
175167 }
@@ -178,7 +170,7 @@ func (s *Server) DeleteGitProvider(ctx context.Context, req *metav1.DeleteOption
178170 return nil , err
179171 }
180172
181- if _ , err := s .octeliumC .CordiumC ().DeleteGitProvider (ctx , & rmetav1. DeleteOptions { Uid : itm . Metadata . Uid } ); err != nil {
173+ if _ , err := s .octeliumC .CordiumC ().DeleteGitProvider (ctx , apivalidation . ObjectToRDeleteOptions ( itm ) ); err != nil {
182174 return nil , serr .InternalWithErr (err )
183175 }
184176
@@ -315,10 +307,7 @@ func (s *Server) GetGitProvider(ctx context.Context, req *metav1.GetOptions) (*c
315307 return nil , err
316308 }
317309
318- item , err := s .octeliumC .CordiumC ().GetGitProvider (ctx , & rmetav1.GetOptions {
319- Uid : req .Uid ,
320- Name : req .Name ,
321- })
310+ item , err := s .octeliumC .CordiumC ().GetGitProvider (ctx , apivalidation .GetOptionsToRGetOptions (req ))
322311 if err != nil {
323312 return nil , serr .K8sNotFoundOrInternalWithErr (err )
324313 }
0 commit comments