Skip to content

Automatically generate KindVersionInfo daily or if Kind Version for c…#24

Merged
ewassef merged 8 commits intomainfrom
KindDataAutomation
May 31, 2025
Merged

Automatically generate KindVersionInfo daily or if Kind Version for c…#24
ewassef merged 8 commits intomainfrom
KindDataAutomation

Conversation

@chaosmonkey
Copy link
Collaborator

Added code to automatically update the Kind version info.

  • Pulls latest releases and generates kind version info (kind to kubernetes version mapping) from kubernetes-sigs/kind.
  • Data is cached in user home directory (~/.vega/config/kind.version.info.json)
  • If a call to get the mapping fails to find the requested kind version, an update is automatically invoked to update the local cache

Also added a new command to list the available kubernetes versions for the installed kind version.

Still testing/polishing -> Posting in draft as FYI and to let the team play with it.

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

This pull request adds functionality to automatically update Kind version mapping data, improve dependency management, and introduce commands to update the cached Kind version info and list available Kubernetes versions. Key changes include dependency upgrades and configuration updates in devbox.json and csproj files, the introduction of a new KindVersionInfoService with its interface and associated commands, and modifications to existing commands to integrate the new service.

Reviewed Changes

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

Show a summary per file
File Description
devbox.json Updated dependency version to "kind@latest".
cli/tests/Vdk.Tests/Vdk.Tests.csproj Modified resource embedding for Kind version info test data.
cli/tests/Vdk.Tests/Models/KindVersionMapTests.cs Updated expected SHA for a Kind version image test case.
cli/src/Vdk/Vdk.csproj Upgraded and added package references including Octokit and updated IO abstractions.
cli/src/Vdk/Services/KindVersionInfoService.cs Introduced a new service for updating and retrieving Kind version mappings.
cli/src/Vdk/Data/EmbeddedDataReader.cs Added a constructor overload to support a reference type for resource lookups.
cli/src/Vdk/Commands/* Introduced new commands for updating Kind version info and listing Kubernetes versions, and updated CreateClusterCommand accordingly.
cli/src/Vdk/Models/* Added JSON annotations for serialization and updated models to support new features.
cli/src/Vdk/GlobalConfiguration.cs New configuration file providing environment-specific paths and cache settings.
cli/src/Vdk/Constants/Defaults.cs Added new constants for configuration directory and cache timing.
Comments suppressed due to low confidence (1)

cli/src/Vdk/Data/EmbeddedDataReader.cs:27

  • [nitpick] Consider using StringComparison.InvariantCultureIgnoreCase instead of CurrentCultureIgnoreCase for resource name matching to ensure consistent behavior regardless of the user's locale.
var name = names.FirstOrDefault(x=>x.Equals(path, StringComparison.CurrentCultureIgnoreCase))??path;

return;
}
var image = map.FindImage(kindVersion, kubeVersion);
if (image is null)
Copy link

Copilot AI May 9, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider adding additional logging or clarifying comments in the fallback block to detail the recovery process when the image remains null after attempting an update.

Copilot uses AI. Check for mistakes.
@chaosmonkey chaosmonkey marked this pull request as ready for review May 15, 2025 04:49
@ewassef ewassef merged commit 1ab7520 into main May 31, 2025
2 checks passed
@ewassef ewassef deleted the KindDataAutomation branch May 31, 2025 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants