File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -196,12 +196,16 @@ export class Kubero {
196196 debug . log ( error ) ;
197197 } ) ;
198198
199- if ( pipeline && pipeline . metadata && pipeline . metadata . resourceVersion ) {
200- pipeline . spec . buildpack . fetch . securityContext = Buildpack . SetSecurityContext ( pipeline . spec . buildpack . fetch . securityContext ) ;
201- pipeline . spec . buildpack . build . securityContext = Buildpack . SetSecurityContext ( pipeline . spec . buildpack . build . securityContext ) ;
202- pipeline . spec . buildpack . run . securityContext = Buildpack . SetSecurityContext ( pipeline . spec . buildpack . run . securityContext ) ;
199+ if ( pipeline ) {
200+ if ( pipeline . spec . buildpack ) {
201+ pipeline . spec . buildpack . fetch . securityContext = Buildpack . SetSecurityContext ( pipeline . spec . buildpack . fetch . securityContext ) ;
202+ pipeline . spec . buildpack . build . securityContext = Buildpack . SetSecurityContext ( pipeline . spec . buildpack . build . securityContext ) ;
203+ pipeline . spec . buildpack . run . securityContext = Buildpack . SetSecurityContext ( pipeline . spec . buildpack . run . securityContext ) ;
204+ }
203205
204- pipeline . spec . resourceVersion = pipeline . metadata . resourceVersion ;
206+ if ( pipeline . metadata && pipeline . metadata . resourceVersion ) {
207+ pipeline . spec . resourceVersion = pipeline . metadata . resourceVersion ;
208+ }
205209
206210 delete pipeline . spec . git . keys . priv
207211 delete pipeline . spec . git . keys . pub
You can’t perform that action at this time.
0 commit comments