Skip to content

Refactor container k8s to use plugin resource management. - #2097

Merged
jglogan merged 2 commits into
apple:mainfrom
jglogan:kindnet-resource
Aug 7, 2026
Merged

Refactor container k8s to use plugin resource management.#2097
jglogan merged 2 commits into
apple:mainfrom
jglogan:kindnet-resource

Conversation

@jglogan

@jglogan jglogan commented Aug 7, 2026

Copy link
Copy Markdown
Contributor
  • Closes [Bug]: container k8s resource load doesn't work from installation package. #2096.
  • Storing resources in a macOS resource bundle won't work for unix-layout plugins.
  • Rework the kindnet resource fetch to create a plugin loader, find the plugin based on the plugin executable path, and use the plugin's resourceURL to locate the resource.
  • Add a findPlugin function to locate the plugin whose executable path matches the supplied path.
  • Fix help text to insure example runs regardless of the default registry configuration.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

Needed to fix released version of k8s plugin.

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

jglogan added 2 commits August 7, 2026 12:31
- Closes apple#2096.
- Storing resources in a macOS resource bundle won't work
  for unix-layout plugins.
- Rework the kindnet resource fetch to create a plugin
  loader, find the plugin based on the plugin executable
  path, and use the plugin's resourceURL to locate the
  resource.
- Add a findPlugin function to locate the plugin that
  contains a pathname.
- Fix help text to insure example runs regardless of
  the default registry configuration.
return nil
}

private static func resolveSymlinks(_ path: String) -> String? {

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.

Can't we use resolvingSymlinks defined in FilePath+Symlink.swift?
Though we need to add dependency on ContainerPersistence for that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

100% the right idea.

We can live with this bit of non-DRY code for now.

How we're going to tackle this tech debt is to coalesce the different FilePath helpers we have to https://github.com/apple/containerization/blob/main/Sources/ContainerizationOS/FilePathOps.swift.

Then we address stuff like this as we migrate the parts of container that haven't yet been migrated from String/URL paths to FilePath.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Code Coverage

Tier Line Coverage
Unit 24.3%
Integration 66.88%
Combined 76.23%

@jglogan
jglogan merged commit 0925ff6 into apple:main Aug 7, 2026
3 checks passed
@jglogan
jglogan deleted the kindnet-resource branch August 7, 2026 21:44
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.

[Bug]: container k8s resource load doesn't work from installation package.

2 participants