Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
chrischdi committed May 3, 2024
1 parent 65d0320 commit 9820cfb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/release/release-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ This comes down to changing occurrences of the old version to the new version, e
4. Remove old `metadata.yaml`'s that are not used anymore in clusterctl upgrade tests.
4. Adjust cluster templates in `test/e2e/data/infrastructure-vsphere`:
1. Create a new `v1.7` folder. It should be created based on the `main` folder and only contain the templates
we use in the clusterctl upgrade tests (as of today `remote-management`).
we use in the clusterctl upgrade tests (as of today `topology`).
2. Remove old folders that are not used anymore in clusterctl upgrade tests.
3. Copy over the workload folder from a previous release.
5. Modify the test specs in `test/e2e/clusterctl_upgrade_test.go` (according to the versions we want to test described above).
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/clusterctl_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.9=
BootstrapClusterProxy: bootstrapClusterProxy,
ArtifactFolder: artifactFolder,
SkipCleanup: skipCleanup,
MgmtFlavor: testSpecificSettingsGetter().FlavorForMode("remote-management"),
MgmtFlavor: testSpecificSettingsGetter().FlavorForMode("topology"),
PostNamespaceCreated: testSpecificSettingsGetter().PostNamespaceCreatedFunc,
PreInit: vsphereframework.LoadImagesFunc(ctx),
PreUpgrade: vsphereframework.LoadImagesFunc(ctx),
Expand Down
15 changes: 8 additions & 7 deletions test/framework/image_preloading.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ func LoadImagesFunc(ctx context.Context) func(clusterProxy framework.ClusterProx
}

return func(clusterProxy framework.ClusterProxy) {
loader.loadImagesToCluster(ctx, clusterProxy)
loader.ImagesToCluster(ctx, clusterProxy)
}
}

type imagePreloader struct {
sourceFile string
}

// loadImagesToCluster deploys a privileged daemonset and uses it to stream-load container images.
func (i imagePreloader) loadImagesToCluster(ctx context.Context, clusterProxy framework.ClusterProxy) {
// ImagesToCluster deploys a privileged daemonset and uses it to stream-load container images.
func (loader imagePreloader) ImagesToCluster(ctx context.Context, clusterProxy framework.ClusterProxy) {

Check failure on line 61 in test/framework/image_preloading.go

View workflow job for this annotation

GitHub Actions / lint (test)

ST1016: methods on the same type should have the same receiver name (seen 1x "loader", 2x "i") (stylecheck)

Check failure on line 61 in test/framework/image_preloading.go

View workflow job for this annotation

GitHub Actions / lint (test)

ST1016: methods on the same type should have the same receiver name (seen 1x "loader", 2x "i") (stylecheck)
daemon, daemonMutateFn, daemonLabels := getPreloadDaemonset()
ctrlClient := clusterProxy.GetClient()

Expand All @@ -79,17 +79,18 @@ func (i imagePreloader) loadImagesToCluster(ctx context.Context, clusterProxy fr
)).To(Succeed())

errs := []error{}
for _, pod := range pods.Items {
Byf("Loading images to node %s via pod %s", &pod.Spec.NodeName, klog.KObj(&pod))
if err := i.loadImagesViaPod(ctx, clusterProxy, pod.Namespace, pod.Name, pod.Spec.Containers[0].Name); err != nil {
for j := range pods.Items {
pod := pods.Items[j]
Byf("Loading images to node %s via pod %s", pod.Spec.NodeName, klog.KObj(&pod))
if err := loader.imagesViaPod(ctx, clusterProxy, pod.Namespace, pod.Name, pod.Spec.Containers[0].Name); err != nil {
errs = append(errs, err)
}
}

Expect(kerrors.NewAggregate(errs)).ToNot(HaveOccurred())
}

func (i imagePreloader) loadImagesViaPod(ctx context.Context, clusterProxy framework.ClusterProxy, namespace, podName, containerName string) error {
func (i imagePreloader) imagesViaPod(ctx context.Context, clusterProxy framework.ClusterProxy, namespace, podName, containerName string) error {

Check failure on line 93 in test/framework/image_preloading.go

View workflow job for this annotation

GitHub Actions / lint (test)

receiver-naming: receiver name i should be consistent with previous receiver name loader for imagePreloader (revive)

Check warning on line 93 in test/framework/image_preloading.go

View workflow job for this annotation

GitHub Actions / lint (test)

receiver-naming: receiver name i should be consistent with previous receiver name loader for imagePreloader (revive)
// Open source tar file.
reader, writer := io.Pipe()
file, err := os.Open(i.sourceFile)
Expand Down

0 comments on commit 9820cfb

Please sign in to comment.