Skip to content

Commit

Permalink
PWX-34315: Add IsPureBlockVolume() interface
Browse files Browse the repository at this point in the history
Signed-off-by: pnookala-px <[email protected]>
  • Loading branch information
pnookala-px committed Oct 24, 2023
1 parent 47d2cdf commit a56963d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1314,6 +1314,9 @@ func (v *VolumeSpec) IsPureVolume() bool {
return v.GetProxySpec() != nil && v.GetProxySpec().IsPureBackend()
}

func (v *VolumeSpec) IsPureBlockVolume() bool {
return v.GetProxySpec() != nil && v.GetProxySpec().IsPureBlockBackend()
}
// GetCloneCreatorOwnership returns the appropriate ownership for the
// new snapshot and if an update is required
func (v *VolumeSpec) GetCloneCreatorOwnership(ctx context.Context) (*Ownership, bool) {
Expand Down Expand Up @@ -1448,6 +1451,14 @@ func (s *ProxySpec) IsPureBackend() bool {
s.ProxyProtocol == ProxyProtocol_PROXY_PROTOCOL_PURE_FILE
}

func (s *ProxySpec) IsPureBlockBackend() bool {
return s.ProxyProtocol == ProxyProtocol_PROXY_PROTOCOL_PURE_BLOCK
}

func (s *ProxySpec) IsPureFileBackend() bool {
return s.ProxyProtocol == ProxyProtocol_PROXY_PROTOCOL_PURE_FILE
}

func (s *ProxySpec) IsPureImport() bool {
if !s.IsPureBackend() {
return false
Expand Down

0 comments on commit a56963d

Please sign in to comment.