apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "[TechPreview] EtcdBackup"
crd: 0000_10_01_etcdbackup-TechPreviewNoUpgrade.crd.yaml
tests:
  onCreate:
  - name: Should be able to create an EtcdBackup with a valid spec
    initial: |
      apiVersion: operator.openshift.io/v1alpha1
      kind: EtcdBackup
      spec:
        pvcName: etcdbackup-pvc
    expected: |
      apiVersion: operator.openshift.io/v1alpha1
      kind: EtcdBackup
      spec:
        pvcName: etcdbackup-pvc
  - name: Should be able to create an EtcdBackup without the pvcName specified
    initial: |
      apiVersion: operator.openshift.io/v1alpha1
      kind: EtcdBackup
      spec: {}
    expected: |
      apiVersion: operator.openshift.io/v1alpha1
      kind: EtcdBackup
      spec: {}
  onUpdate:
  - name: pvcName is immutable once set
    initial: |
      apiVersion: operator.openshift.io/v1alpha1
      kind: EtcdBackup
      spec:
        pvcName: etcdbackup-pvc
    updated: |
      apiVersion: operator.openshift.io/v1alpha1
      kind: EtcdBackup
      spec:
        pvcName: updated-etcdbackup-pvc
    expectedError: "spec.pvcName: Invalid value: \"string\": pvcName is immutable once set"
