Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 2265147: Fix PV validation #200

Open
wants to merge 2 commits into
base: release-4.15
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions controllers/util/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,8 @@ func UpdateStringMap(dst *map[string]string, src map[string]string) {
(*dst)[key] = val
}
}

// OptionalEqual returns True if optional field values are equal, or one of them is unset.
func OptionalEqual(a, b string) bool {
return a == "" || b == "" || a == b
}
2 changes: 1 addition & 1 deletion controllers/vrg_volrep.go
Original file line number Diff line number Diff line change
Expand Up @@ -2162,7 +2162,7 @@ func (v *VRGInstance) pvMatches(x, y *corev1.PersistentVolume) bool {
"y", y.Spec.PersistentVolumeSource.CSI.FSType)

return false
case x.Spec.ClaimRef.Kind != y.Spec.ClaimRef.Kind:
case !rmnutil.OptionalEqual(x.Spec.ClaimRef.Kind, y.Spec.ClaimRef.Kind):
v.log.Info("PVs ClaimRef.Kind mismatch", "x", x.Spec.ClaimRef.Kind, "y", y.Spec.ClaimRef.Kind)

return false
Expand Down
16 changes: 16 additions & 0 deletions docs/devel-quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,22 @@ enough resources:
link `venv` for activating the environment. To activate the
environment use:

1. Install Go 1.20

Ramen requires now Go 1.20 due to backward incompatible changes in Go
1.21 and later. If your system Go is newer and you don't want to
downgrade it, you can install Go 1.20 according to
[Managing Go installations](https://go.dev/doc/manage-install).

To use Go 1.20 from the ~/sdk, change the PATH in the shell used to
build ramen:

```
$ export PATH="/home/username/sdk/go1.20.14/bin:$PATH"
$ go version
go version go1.20.14 linux/amd64
```

That's all! You are ready to submit your first pull request!

## Running the tests
Expand Down
Loading