Skip to content

Commit

Permalink
Safely dereference volume component 'ephemeral' field
Browse files Browse the repository at this point in the history
  • Loading branch information
rm3l committed Sep 8, 2023
1 parent 8f0f4c3 commit 261ca26
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/apiserver-impl/devstate/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ import (
"github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
"github.com/devfile/api/v2/pkg/devfile"
"github.com/devfile/library/v2/pkg/devfile/parser/data/v2/common"
"k8s.io/utils/pointer"

. "github.com/redhat-developer/odo/pkg/apiserver-gen/go"
"github.com/redhat-developer/odo/pkg/libdevfile"
"k8s.io/utils/pointer"
)

const (
Expand Down Expand Up @@ -319,7 +320,7 @@ func (o *DevfileState) getVolumes() ([]Volume, error) {
for _, volume := range volumes {
result = append(result, Volume{
Name: volume.Name,
Ephemeral: *volume.Volume.Ephemeral,
Ephemeral: pointer.BoolDeref(volume.Volume.Ephemeral, false),
Size: volume.Volume.Size,
})
}
Expand Down

0 comments on commit 261ca26

Please sign in to comment.