-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add PVC claimName to datavolume status (#2060)
* Make it possible to find the underlying PVC name using the DV Right now a lot of things assume that the underlying PVC has the same name/namespace, let's make it possible to reach over and not need to have this implicit knowledge in a lot of places. Signed-off-by: Maya Rashish <mrashish@redhat.com> * Install some artifacts on the old version of CDI during upgrade tests And use this to test that DataVolume.Status.ClaimName is set after upgrades. Signed-off-by: Maya Rashish <mrashish@redhat.com> * Bump CDI pod update timeout Signed-off-by: Maya Rashish <mrashish@redhat.com> * Only check if non-testing CDI pods have updated. We don't update the testing environment, so it looks like some of the update fails. Signed-off-by: Maya Rashish <mrashish@redhat.com> * Restore lower timeouts Signed-off-by: Maya Rashish <mrashish@redhat.com> * As elsewhere, don't use local registry artifacts with external provider Signed-off-by: Maya Rashish <mrashish@redhat.com>
- Loading branch information
Showing
13 changed files
with
135 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# This example assumes you are using a default storage class | ||
apiVersion: cdi.kubevirt.io/v1alpha1 | ||
kind: DataVolume | ||
metadata: | ||
name: olddv-v1alpha1 | ||
spec: | ||
source: | ||
http: | ||
url: "http://cdi-file-host.{{ .Namespace }}/tinyCore.iso" | ||
pvc: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 500Mi | ||
--- | ||
apiVersion: cdi.kubevirt.io/v1beta1 | ||
kind: DataVolume | ||
metadata: | ||
name: olddv-v1beta1 | ||
spec: | ||
source: | ||
http: | ||
url: "http://cdi-file-host.{{ .Namespace }}/tinyCore.iso" | ||
pvc: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 500Mi |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...virt.io/containerized-data-importer-api/pkg/apis/core/v1alpha1/types_swagger_generated.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...evirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1/types_swagger_generated.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package tests_test | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
. "github.com/onsi/ginkgo" | ||
"github.com/onsi/ginkgo/extensions/table" | ||
. "github.com/onsi/gomega" | ||
|
||
apierrs "k8s.io/apimachinery/pkg/api/errors" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
|
||
"kubevirt.io/containerized-data-importer/tests/framework" | ||
) | ||
|
||
/* | ||
* Tests that use artifacts created on older version. | ||
* Artifacts are created by manifests/templates/upgrade-testing-artifacts.yaml.in | ||
*/ | ||
|
||
const oldVersionArtifactsNamespace = "cdi-testing-old-version-artifacts" | ||
|
||
var _ = Describe("[Upgrade]", func() { | ||
f := framework.NewFramework("upgrade-test") | ||
|
||
BeforeEach(func() { | ||
_, err := f.K8sClient.CoreV1().Namespaces().Get(context.TODO(), oldVersionArtifactsNamespace, metav1.GetOptions{}) | ||
if apierrs.IsNotFound(err) { | ||
Skip(fmt.Sprintf("Not setup to perform upgrade testing; missing namespace %s", oldVersionArtifactsNamespace)) | ||
} | ||
}) | ||
|
||
table.DescribeTable("[rfe_id:5493]DV status.name is populated after upgrade", func(dvName string) { | ||
dv, err := f.CdiClient.CdiV1beta1().DataVolumes(oldVersionArtifactsNamespace).Get(context.TODO(), dvName, metav1.GetOptions{}) | ||
Expect(err).ToNot(HaveOccurred()) | ||
Expect(dv.Status.ClaimName).To(Equal(dvName)) | ||
}, | ||
table.Entry("[test_id:7714]with v1alpha1 datavolume", "olddv-v1alpha1"), | ||
table.Entry("[test_id:7715]with v1beta1 datavolume", "olddv-v1beta1"), | ||
) | ||
}) |