forked from kubevirt/kubevirt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request kubevirt#8116 from EdDev/tests-replace-update-with…
…-patch tests: Replace `Update` with `Patch`
- Loading branch information
Showing
16 changed files
with
146 additions
and
110 deletions.
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
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
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 |
---|---|---|
|
@@ -14,6 +14,7 @@ import ( | |
"k8s.io/apimachinery/pkg/api/errors" | ||
"k8s.io/apimachinery/pkg/api/resource" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
"k8s.io/apimachinery/pkg/types" | ||
"k8s.io/utils/pointer" | ||
|
||
v1 "kubevirt.io/api/core/v1" | ||
|
@@ -23,6 +24,7 @@ import ( | |
"kubevirt.io/client-go/kubecli" | ||
|
||
instancetypepkg "kubevirt.io/kubevirt/pkg/instancetype" | ||
k6ttypes "kubevirt.io/kubevirt/pkg/util/types" | ||
"kubevirt.io/kubevirt/tests" | ||
cd "kubevirt.io/kubevirt/tests/containerdisk" | ||
"kubevirt.io/kubevirt/tests/libvmi" | ||
|
@@ -546,8 +548,9 @@ var _ = Describe("[crit:medium][vendor:[email protected]][level:component][sig-c | |
|
||
By("Updating the VirtualMachineInstancetype vCPU count") | ||
newInstancetypeCPUGuest := originalInstancetypeCPUGuest + 1 | ||
instancetype.Spec.CPU.Guest = newInstancetypeCPUGuest | ||
updatedInstancetype, err := virtClient.VirtualMachineInstancetype(util.NamespaceTestDefault).Update(context.Background(), instancetype, metav1.UpdateOptions{}) | ||
patchData, err := k6ttypes.GenerateTestReplacePatch("/spec/cpu/guest", originalInstancetypeCPUGuest, newInstancetypeCPUGuest) | ||
Expect(err).ToNot(HaveOccurred()) | ||
updatedInstancetype, err := virtClient.VirtualMachineInstancetype(util.NamespaceTestDefault).Patch(context.Background(), instancetype.Name, types.JSONPatchType, patchData, metav1.PatchOptions{}) | ||
Expect(err).ToNot(HaveOccurred()) | ||
Expect(updatedInstancetype.Spec.CPU.Guest).To(Equal(newInstancetypeCPUGuest)) | ||
|
||
|
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 |
---|---|---|
|
@@ -47,6 +47,7 @@ import ( | |
"kubevirt.io/client-go/kubecli" | ||
|
||
"kubevirt.io/kubevirt/pkg/controller" | ||
k6ttypes "kubevirt.io/kubevirt/pkg/util/types" | ||
"kubevirt.io/kubevirt/tests" | ||
) | ||
|
||
|
@@ -339,8 +340,9 @@ var _ = Describe("[rfe_id:588][crit:medium][vendor:[email protected]][level:comp | |
|
||
// set new replica count while still being paused | ||
By("Updating the number of replicas") | ||
rs.Spec.Replicas = tests.NewInt32(2) | ||
_, err = virtClient.ReplicaSet(rs.ObjectMeta.Namespace).Update(rs) | ||
patchData, err := k6ttypes.GenerateTestReplacePatch("/spec/replicas", rs.Spec.Replicas, tests.NewInt32(2)) | ||
Expect(err).ToNot(HaveOccurred()) | ||
rs, err = virtClient.ReplicaSet(rs.Namespace).Patch(rs.Name, types.JSONPatchType, patchData) | ||
Expect(err).ToNot(HaveOccurred()) | ||
|
||
// make sure that we don't scale up | ||
|
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
Oops, something went wrong.