Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
fbb506c
Lint also enable-dr and disable-dr scripts
nirs Jan 10, 2024
488ea00
Make application path configurable
nirs Nov 13, 2023
0482004
Add feature_gates profile option
nirs Nov 13, 2023
4f336bb
Enable StatefulSetAutoDeletePVC feature gate
nirs Nov 13, 2023
fc39e36
Fix waiting for drcluster and drpolicy
nirs Nov 16, 2023
145a47c
Fix hard coded pvc selector label
nirs Nov 16, 2023
6b9f19d
Use dr policy owned by the test
nirs Jan 10, 2024
11680b3
Move generic logs
nirs Jan 10, 2024
7421d5d
Remove channel deployment
nirs Jan 10, 2024
df5d1b9
Support multiple configurations
nirs Nov 27, 2023
1cc6105
Add test configurations
nirs Nov 27, 2023
f4daa30
Add kubvirt configuration
nirs Nov 30, 2023
1349d9e
Add drtest demo
nirs Nov 27, 2023
d692122
Upgrade CDI to latest release
nirs Jan 10, 2024
cb0607d
Update kubvirt to latest release
nirs Jan 10, 2024
6ac43a9
Use the standard cirros image in CDR test
nirs Jan 10, 2024
4149b93
Fix waiting for cdi
nirs Jan 10, 2024
7625d0c
Trim kubevirt environment
nirs Nov 19, 2023
9d8a250
Add --skip-addons option
nirs Nov 19, 2023
d2d8b65
Allow pulling from local insecure registry
nirs Jan 10, 2024
eefc073
How to configure local git server
nirs Jan 10, 2024
2c674e7
How to use a local registry for minikube clusters
nirs Jan 10, 2024
fe59f6d
Add drenv suspend and resume commands
nirs Jan 22, 2024
c16031d
Use kubvirt sample from local git server
nirs Jan 10, 2024
8057c5e
Extend kubvirt certificate lifetime to 1 week
nirs Jan 26, 2024
8c5ff8c
Extend cdi certificate lifetime to 1 week
nirs Jan 28, 2024
7f02490
Move cdi insecure registry config to kustomization
nirs Jan 28, 2024
44aff58
Add systemd units for the registry
nirs Jan 28, 2024
b6f0019
Document Go 1.20 requirement
nirs Feb 20, 2024
bee6dc5
Fix PV.Spec.ClaimRef.Kind validation
nirs Feb 20, 2024
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 optinal field values are qual, 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
12 changes: 6 additions & 6 deletions ramenctl/ramenctl/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def run(args):
cloud_secret = generate_cloud_credentials_secret(env["clusters"][0], args)

if env["hub"]:
hub_cm = generate_config_map("hub", env["clusters"], args)
hub_cm = generate_config_map("hub", env, args)

wait_for_ramen_hub_operator(env["hub"], args)

Expand All @@ -38,7 +38,7 @@ def run(args):
wait_for_dr_clusters(env["hub"], env["clusters"], args)
wait_for_dr_policy(env["hub"], args)
else:
dr_cluster_cm = generate_config_map("dr-cluster", env["clusters"], args)
dr_cluster_cm = generate_config_map("dr-cluster", env, args)

for cluster in env["clusters"]:
create_ramen_s3_secrets(cluster, s3_secrets)
Expand Down Expand Up @@ -89,7 +89,9 @@ def create_cloud_credentials_secret(cluster, yaml):
kubectl.apply("--filename=-", input=yaml, context=cluster, log=command.debug)


def generate_config_map(controller, clusters, args):
def generate_config_map(controller, env, args):
clusters = env["clusters"]
volsync = env["features"].get("volsync", True)
template = drenv.template(command.resource("configmap.yaml"))
return template.substitute(
name=f"ramen-{controller}-operator-config",
Expand All @@ -98,6 +100,7 @@ def generate_config_map(controller, clusters, args):
cluster2=clusters[1],
minio_url_cluster1=minio.service_url(clusters[0]),
minio_url_cluster2=minio.service_url(clusters[1]),
volsync_disabled="false" if volsync else "true",
namespace=args.ramen_namespace,
)

Expand Down Expand Up @@ -145,7 +148,6 @@ def wait_for_dr_clusters(hub, clusters, args):
drenv.wait_for(
f"drcluster/{name}",
output="jsonpath={.status.phase}",
namespace=args.ramen_namespace,
timeout=180,
profile=hub,
log=command.debug,
Expand All @@ -156,7 +158,6 @@ def wait_for_dr_clusters(hub, clusters, args):
"drcluster",
"--all",
"--for=jsonpath={.status.phase}=Available",
f"--namespace={args.ramen_namespace}",
context=hub,
log=command.debug,
)
Expand All @@ -167,7 +168,6 @@ def wait_for_dr_policy(hub, args):
kubectl.wait(
"drpolicy/dr-policy",
"--for=condition=Validated",
f"--namespace={args.ramen_namespace}",
context=hub,
log=command.debug,
)
2 changes: 2 additions & 0 deletions ramenctl/ramenctl/resources/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ data:
clusterServiceVersionName: ramen-dr-cluster-operator.v0.0.1
kubeObjectProtection:
veleroNamespaceName: velero
volSync:
disabled: $volsync_disabled
s3StoreProfiles:
- s3ProfileName: minio-on-$cluster1
s3Bucket: bucket
Expand Down
2 changes: 2 additions & 0 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ sources := $(wildcard \
addons/*/start \
addons/*/test \
addons/*/stop \
*/enable-dr \
*/disable-dr \
*/deploy \
*/undeploy \
*/failover \
Expand Down
4 changes: 4 additions & 0 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,10 @@ $ drenv delete envs/example.yaml
- `extra_config`: List of extra config key=value. Each item adds
`--extra-config` minikube option. See `minikube start --help` to
see the possible keys and values.
- `feature_gates`: List of Kubernetes feature gates key=value. Each
item adds `--feature-gates` minikube option. See
[Feature Gates](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/)
for possible keys and values.
- `containerd`: Optional containerd configuration object. See
`containerd config default` for available options.
- `workers`: Optional list of workers to run when starting a
Expand Down
32 changes: 31 additions & 1 deletion test/addons/cdi/cr/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,34 @@
# yamllint disable rule:line-length
---
resources:
- https://github.com/kubevirt/containerized-data-importer/releases/download/v1.57.0/cdi-cr.yaml
- https://github.com/kubevirt/containerized-data-importer/releases/download/v1.58.0/cdi-cr.yaml
patches:
# Incrase certificate duration to avoid certificates renewals while a cluster
# is suspended and resumed.
- target:
kind: CDI
name: cdi
patch: |-
apiVersion: cdi.kubevirt.io/v1beta1
kind: CDI
metadata:
name: not-used
spec:
certConfig:
ca:
duration: 168h
server:
duration: 168h
# Allow pulling from local insecure registry.
- target:
kind: CDI
name: cdi
patch: |-
apiVersion: cdi.kubevirt.io/v1beta1
kind: CDI
metadata:
name: not-used
spec:
config:
insecureRegistries:
- host.minikube.internal:5000
2 changes: 1 addition & 1 deletion test/addons/cdi/disk/source.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ metadata:
spec:
source:
registry:
url: "docker://quay.io/alitke/cirros:latest"
url: "docker://quay.io/nirsof/cirros:0.6.2-1"
2 changes: 1 addition & 1 deletion test/addons/cdi/operator/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# yamllint disable rule:line-length
---
resources:
- https://github.com/kubevirt/containerized-data-importer/releases/download/v1.57.0/cdi-operator.yaml
- https://github.com/kubevirt/containerized-data-importer/releases/download/v1.58.0/cdi-operator.yaml
8 changes: 8 additions & 0 deletions test/addons/cdi/start
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ def wait(cluster):
"--timeout=300s",
context=cluster,
)
print("Waiting until cdi cr finished progressing")
kubectl.wait(
"cdi.cdi.kubevirt.io/cdi",
"--for=condition=progressing=False",
f"--namespace={NAMESPACE}",
"--timeout=300s",
context=cluster,
)


if len(sys.argv) != 2:
Expand Down
20 changes: 19 additions & 1 deletion test/addons/kubevirt/cr/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,22 @@
# yamllint disable rule:line-length
---
resources:
- https://github.com/kubevirt/kubevirt/releases/download/v1.0.1/kubevirt-cr.yaml
- https://github.com/kubevirt/kubevirt/releases/download/v1.1.1/kubevirt-cr.yaml
patches:
# Incrase certificate duration to avoid certificates renewals while a cluster
# is suspended and resumed.
- target:
kind: KubeVirt
name: kubevirt
patch: |-
apiVersion: kubevirt.io/v1
kind: Kubevirt
metadata:
name: not-used
spec:
certificateRotateStrategy:
selfSigned:
ca:
duration: 168h
server:
duration: 168h
2 changes: 1 addition & 1 deletion test/addons/kubevirt/operator/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# yamllint disable rule:line-length
---
resources:
- https://github.com/kubevirt/kubevirt/releases/download/v1.0.1/kubevirt-operator.yaml
- https://github.com/kubevirt/kubevirt/releases/download/v1.1.1/kubevirt-operator.yaml
11 changes: 7 additions & 4 deletions test/basic-test/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
# SPDX-License-Identifier: Apache-2.0

---
repo: https://github.com/ramendr/ocm-ramen-samples.git
branch: main
name: busybox-sample
namespace: busybox-sample
repo: https://github.com/nirs/ocm-ramen-samples.git
path: k8s/busybox-regional-rbd-deploy/sub
branch: test
name: busybox-regional-rbd-deploy
namespace: busybox-regional-rbd-deploy
dr_policy: busybox-regional-rbd-deploy
pvc_label: busybox
4 changes: 2 additions & 2 deletions test/basic-test/undeploy
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ from drenv import test
test.start("undeploy", __file__)
args = test.parse_args()

test.info("Deleting busybox example application")
test.info("Deleting application")
test.undeploy()
test.info("Application was undeployed successfully")
test.info("Application was deleted")
11 changes: 11 additions & 0 deletions test/configs/k8s/busybox-regional-rbd-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SPDX-FileCopyrightText: The RamenDR authors
# SPDX-License-Identifier: Apache-2.0

---
repo: https://github.com/nirs/ocm-ramen-samples.git
path: k8s/busybox-regional-rbd-deploy/sub
branch: test
name: busybox-regional-rbd-deploy
namespace: busybox-regional-rbd-deploy
dr_policy: busybox-regional-rbd-deploy
pvc_label: busybox
11 changes: 11 additions & 0 deletions test/configs/k8s/busybox-regional-rbd-ds.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SPDX-FileCopyrightText: The RamenDR authors
# SPDX-License-Identifier: Apache-2.0

---
repo: https://github.com/nirs/ocm-ramen-samples.git
path: k8s/busybox-regional-rbd-ds/sub
branch: test
name: busybox-regional-rbd-ds
namespace: busybox-regional-rbd-ds
dr_policy: busybox-regional-rbd-ds
pvc_label: busybox
11 changes: 11 additions & 0 deletions test/configs/k8s/busybox-regional-rbd-sts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SPDX-FileCopyrightText: The RamenDR authors
# SPDX-License-Identifier: Apache-2.0

---
repo: https://github.com/nirs/ocm-ramen-samples.git
path: k8s/busybox-regional-rbd-sts/sub
branch: test
name: busybox-regional-rbd-sts
namespace: busybox-regional-rbd-sts
dr_policy: busybox-regional-rbd-sts
pvc_label: busybox
11 changes: 11 additions & 0 deletions test/configs/k8s/kubevirt-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SPDX-FileCopyrightText: The RamenDR authors
# SPDX-License-Identifier: Apache-2.0

---
repo: http://host.minikube.internal/ocm-kubevirt-samples.git
path: subscription
branch: fosdem
name: kubevirt-sample
namespace: kubevirt-sample
dr_policy: kubevirt-sample
pvc_label: kubevirt
11 changes: 11 additions & 0 deletions test/configs/odr/busybox-metro-rbd-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SPDX-FileCopyrightText: The RamenDR authors
# SPDX-License-Identifier: Apache-2.0

---
repo: https://github.com/nirs/ocm-ramen-samples.git
path: odr/busybox-metro-rbd-deploy/sub
branch: test-odr
name: busybox-metro-rbd-deploy
namespace: busybox-metro-rbd-deploy
dr_policy: busybox-metro-rbd-deploy
pvc_label: busybox
11 changes: 11 additions & 0 deletions test/configs/odr/busybox-regional-cephfs-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SPDX-FileCopyrightText: The RamenDR authors
# SPDX-License-Identifier: Apache-2.0

---
repo: https://github.com/nirs/ocm-ramen-samples.git
path: odr/busybox-regional-cephfs-deploy/sub
branch: test-odr
name: busybox-regional-cephfs-deploy
namespace: busybox-regional-cephfs-deploy
dr_policy: busybox-regional-cephfs-deploy
pvc_label: busybox
11 changes: 11 additions & 0 deletions test/configs/odr/busybox-regional-rbd-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SPDX-FileCopyrightText: The RamenDR authors
# SPDX-License-Identifier: Apache-2.0

---
repo: https://github.com/nirs/ocm-ramen-samples.git
path: odr/busybox-regional-rbd-deploy/sub
branch: test-odr
name: busybox-regional-rbd-deploy
namespace: busybox-regional-rbd-deploy
dr_policy: busybox-regional-rbd-deploy
pvc_label: busybox
Loading