Skip to content

Preview flag for unsupported distro versions#756

Open
cwize1 wants to merge 1 commit into
mainfrom
user/chrisgun/unsupportedDistroVersion
Open

Preview flag for unsupported distro versions#756
cwize1 wants to merge 1 commit into
mainfrom
user/chrisgun/unsupportedDistroVersion

Conversation

@cwize1
Copy link
Copy Markdown
Contributor

@cwize1 cwize1 commented Jun 1, 2026

Add a preview feature flag that enables customizing unsupported distro versions.

So, instead of:

  • ubuntu-22.04
  • ubuntu-24.04
  • fedora-42

We now have:

  • ubuntu
  • fedora
  • unsupported-distro-version

The unsupported-distro-version flag will allow customizing any unsupported distro version for any supported distro. This will allow users to customize new distro versions without needing to wait for official support from IC.

To facilitate this, this change change modifies TargetOs from an enum to a struct. This will allow more complex logic to be applied against TargetOs. For example, checking if the target version is greater or less than a supported version.


Checklist

  • Tests added/updated
  • Documentation updated (if needed)
  • Code conforms to style guidelines

Add a preview feature flag that enables customizing unsupported distro
versions.

So, instead of:

- `ubuntu-22.04`
- `ubuntu-24.04`
- `fedora-42`

We now have:

- `ubuntu`
- `fedora`
- `unsupported-distro-version`

The `unsupported-distro-version` flag will allow customizing any
unsupported distro version for any supported distro. This will allow
users to customize new distro versions without needing to wait for
official support from IC.

To facilitate this, this change change modifies `TargetOs` from an enum
to a struct. This will allow more complex logic to be applied against
`TargetOs`. For example, checking if the target version is greater or
less than a supported version.
@cwize1 cwize1 requested a review from a team as a code owner June 1, 2026 20:36
- `ubuntu-24.04`: Enables support for customizing Ubuntu 24.04 images using the [customize subcommand](../cli/customize.md).

Added in v1.2.
Added in v1.5.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

azure-container-linux and unsupported-distro-version are missing from this list.


// PreviewFeatureAzureContainerLinux3 enables support for Azure Container Linux 3 images.
PreviewFeatureAzureContainerLinux3 PreviewFeature = "azure-container-linux-3"
// PreviewFeatureAzureContainerLinux3 enables support for Azure Container Linux images.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable name needs updating in comment.

// PreviewFeatureAzureContainerLinux3 enables support for Azure Container Linux images.
PreviewFeatureAzureContainerLinux PreviewFeature = "azure-container-linux"

// PreviewFeatureDistroVersion allows distro versions that are not supported yet.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable name needs updating in comment.

Xfs: azl4XfsOptions,
BootXfs: azl4BootXfsOptions,
// Note: Distro versions must be in order from oldest to newest.
distroFileSystemsOptions = map[targetos.Distro][]versionFileSystemsOptions{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If oldest -> newest is strictly necessary, should we validate it with an init()?

BootXfs: fedora42XfsOptions,
},
},
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: AzureContainerLinux is missing from this map. you could just add the azl3 fs options for now. @liulanze FYI

case string(distroNameAzureLinux):
if version == "4.0" {
return newAzureLinux4DistroHandler()
default:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With unsupported-distro-version enabled, an AzureLinux image with VersionId other than 4.0 (e.g. 5.0) silently falls through to the distrohandler for 2.0/3.0. We should probably pick the newest known handler here, unlike in the filesystem options code, where it makes more sense to be conservative when enabling new features.

APIs marked as **Preview** require the distribution's
[previewFeatures](./configuration/config.md#previewfeatures-string) value to be set
(e.g. `ubuntu-22.04`, `ubuntu-24.04`, `azure-container-linux-3`).
(e.g. `ubuntu`, `azure-container-linux`).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth listing unsupported-distro-version here too, since it's the flag a user will reach for when this page tells them their distro version isn't supported.

testBaseImageAzl4CoreEfi,
testBaseImageAzl3CoreEfi,
testBaseImageAzl3BareMetal,
testBaseImageAzl4CoreEfi,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is worth a comment in the PR description or here in the code.

// Supported versions

default:
err := handleUnsupportedDistroVersion(rc, d.targetOs)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this would throw an accurate error. azl4 would map to a different distro handler entirely, and doens't need the unsupported distro version preview feature, since it has its own distro handler.

// Supported versions

default:
err := handleUnsupportedDistroVersion(rc, d.targetOs)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this error message is accurate either, since this distrohandler only maps from one combination of distro and version

@cwize1 cwize1 changed the title User/chrisgun/unsupported distro version Preview flag for unsupported distro versions Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants