Skip to content

Conversation

@vinceaperri
Copy link
Contributor

@vinceaperri vinceaperri commented Feb 5, 2026

Adds a new validate-config subcommand that validates configuration files without requiring a base image. Includes support for configurable resource validation (URLs, local files, etc.).


Checklist

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new validate-config subcommand to the Image Customizer CLI that validates customize configuration files without performing customization (and without requiring a base image), with optional validation of referenced local file/dir resources and OCI artifacts. It also introduces an optimization to reuse an already-resolved OCI descriptor during subsequent image download/customization steps.

Changes:

  • Add validate-config CLI subcommand, docs, and supporting library entrypoint (ValidateConfigWithConfigFileOptions) with resource-validation controls (files|oci|all).
  • Extend config validation to optionally validate referenced local resources (scripts, additionalFiles, additionalDirs, user SSH keys/password files, SELinux policy dir) and OCI references/signatures.
  • Add caching of resolved OCI descriptor in ResolvedConfig and plumb it through download paths to avoid re-resolve/re-verify work.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
toolkit/tools/pkg/imagecustomizerlib/validateconfigoptions.go New options type + validation for validate-config behavior (build-dir requirement for OCI).
toolkit/tools/pkg/imagecustomizerlib/validateconfigoptions_test.go Unit tests for ValidateConfigOptions.IsValid().
toolkit/tools/pkg/imagecustomizerlib/configvalidation.go Adds ValidateConfigWithConfigFileOptions, extends ValidateConfig API, and gates file/OCI validations.
toolkit/tools/pkg/imagecustomizerlib/configvalidation_test.go Adds extensive tests for new validation behaviors and partial-config support.
toolkit/tools/imagecustomizerapi/validateresourcetype.go Introduces ValidateResourceType enum and validation.
toolkit/tools/imagecustomizerapi/validateresourcetype_test.go Tests for ValidateResourceType.IsValid().
toolkit/tools/imagecustomizerapi/validateresourcetypes.go Introduces ValidateResourceTypes helper methods (Contains, ValidateFiles, ValidateOci).
toolkit/tools/imagecustomizerapi/validateresourcetypes_test.go Tests for ValidateResourceTypes helpers.
toolkit/tools/imagecustomizer/main.go Wires new validate-config command and CLI parsing into the main entrypoint.
docs/imagecustomizer/api/cli/validate-config.md New documentation page for validate-config.
docs/imagecustomizer/api/cli/cli.md Adds validate-config to the CLI command index.
docs/imagecustomizer/api/cli/customize.md Adjusts nav ordering to accommodate new command.
docs/imagecustomizer/api/cli/inject-files.md Adjusts nav ordering to accommodate new command.
toolkit/tools/pkg/imagecustomizerlib/resolvedconfig.go Adds InputImageOciDescriptor cache field for resolved OCI descriptor reuse.
toolkit/tools/pkg/imagecustomizerlib/oras.go Adds openOciImage helper and improved OCI error wrapping; supports passing a pre-resolved descriptor.
toolkit/tools/pkg/imagecustomizerlib/downloadimage.go Plumbs resolved OCI descriptor into OCI/AzureLinux download paths.
toolkit/tools/pkg/imagecustomizerlib/downloadimageazurelinux.go Uses shared Azure Linux signature options helper and accepts optional OCI descriptor.
toolkit/tools/pkg/imagecustomizerlib/imagecustomizer.go Ensures build dir exists before validation; passes descriptor into downloadImage.
toolkit/tools/pkg/imagecustomizerlib/imagecustomizer_test.go Updates tests for updated ValidateConfig signature and resource-validation argument.
toolkit/tools/pkg/imagecustomizerlib/baseconfigs_test.go Updates tests for updated ValidateConfig signature.
toolkit/tools/pkg/imagecreatorlib/validation.go Updates call site for updated ValidateConfig signature.
.github/workflows/binary-build.yml Uses retry wrapper for zizmor download in workflow validation step.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 23 out of 23 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 23 out of 23 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vinceaperri vinceaperri merged commit c6bd437 into main Feb 12, 2026
29 checks passed
@vinceaperri vinceaperri deleted the user/vinceaperri/validate-config-cmd branch February 12, 2026 19:41
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.

3 participants