Skip to content

Commit

Permalink
Merge pull request #951 from pivotal/v0.5.3-fix-ndr
Browse files Browse the repository at this point in the history
Prevent possible Nil Pointer Reference. v0.5.3 version line.
  • Loading branch information
matthewmcnew authored Apr 14, 2022
2 parents b66668e + 794f805 commit 2c34323
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/config/lifecycle_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func (l *LifecycleProvider) UpdateImage(cm *corev1.ConfigMap) {
lifecycle, err := l.read(context.Background(), cm)
if err != nil {
l.lifecycleData.Store(configmapRead{err: err})
return
}

if l.isNewImage(lifecycle) {
Expand Down
3 changes: 3 additions & 0 deletions pkg/config/lifecycle_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ func testProvider(t *testing.T, when spec.G, it spec.S) {
Data: map[string]string{"image": "some-invalid-image", "serviceAccountRef.name": "some-service-account", "serviceAccountRef.namespace": "some-service-account-namespace"},
})
require.Equal(t, callBack.called, 1)

_, _, err := p.LayerForOS("linux")
require.Error(t, err)
})
})

Expand Down

0 comments on commit 2c34323

Please sign in to comment.