Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions azure/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const (
// DefaultLinuxGalleryImageName is the default Linux community gallery image definition.
DefaultLinuxGalleryImageName = "capi-ubun2-2404"
// DefaultWindowsGalleryImageName is the default Windows community gallery image definition.
DefaultWindowsGalleryImageName = "capi-win-2019-containerd"
DefaultWindowsGalleryImageName = "capi-win-2022-containerd"
)

const (
Expand All @@ -74,7 +74,7 @@ const (
const (
// DefaultWindowsOsAndVersion is the default Windows Server version to use when
// generating default images for Windows nodes.
DefaultWindowsOsAndVersion = "windows-2019"
DefaultWindowsOsAndVersion = "windows-2022"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions azure/services/virtualmachineimages/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package virtualmachineimages
import (
"context"
"regexp"
"strings"

"github.com/blang/semver"
"github.com/pkg/errors"
Expand Down Expand Up @@ -106,7 +105,8 @@ func (s *Service) GetDefaultWindowsImage(ctx context.Context, _, k8sVersion, run
if len(match) != 2 {
return nil, errors.Errorf("unsupported osAndVersion %s", osAndVersion)
}
imageName = strings.Replace(imageName, "2019", match[1], 1)
// Substitute the requested Windows Server year into the default image name.
imageName = regexp.MustCompile(`\d{4}`).ReplaceAllString(imageName, match[1])
}

// Use the Azure Marketplace for specific older versions, to keep "clusterctl upgrade" from rolling new machines.
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ func resolveKubernetesVersions(config *clusterctl.E2EConfig) {
windowsRequired := testWindows == "true"

if windowsRequired {
windowsVersions := getVersionsInCommunityGallery(ctx, os.Getenv(AzureLocation), capiCommunityGallery, "capi-win-2019-containerd")
windowsVersions := getVersionsInCommunityGallery(ctx, os.Getenv(AzureLocation), capiCommunityGallery, "capi-win-2022-containerd")
for k, v := range linuxVersions {
if _, ok := windowsVersions[k]; ok {
versions = append(versions, v)
Expand Down
Loading