Skip to content

fix: remove standard template code path to fix template name handling#201

Open
runleveldev wants to merge 1 commit intomainfrom
200-bug-failed-to-create-container-template-ghcriomiewebopensource-serverbaselatest-not-found-on-any-node-in-this-site
Open

fix: remove standard template code path to fix template name handling#201
runleveldev wants to merge 1 commit intomainfrom
200-bug-failed-to-create-container-template-ghcriomiewebopensource-serverbaselatest-not-found-on-any-node-in-this-site

Conversation

@runleveldev
Copy link
Collaborator

This pull request simplifies and streamlines the logic for selecting and validating container templates in the containers.js router. The changes focus on unifying how Docker and LXC templates are handled, reducing complexity, and improving error handling for template selection.

Template Selection and Validation Improvements:

  • Simplified the logic to resolve the container image reference by treating both custom Docker images and standard templates uniformly, using a single imageRef variable and normalizing it with normalizeDockerRef. Now, a template is always required, and an error is thrown if none is provided.
  • Removed the previous branching logic that separately handled custom Docker images and standard LXC templates, including the node/template lookup for LXC templates. All containers now require a normalized image reference, and the node is selected based on API access.

API Payload Mapping Adjustments:

  • Updated the API payload mapping to ensure that when a template_name is provided (and template is not), it is used as the template. The requirement for providing both repository and template_name together has been relaxed. Environment variables for build repository and branch are now always injected if a repository is present.

Code Cleanup:

  • Removed the unused import of ProxmoxApi from the file, as the logic for direct Proxmox template lookup has been removed.

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]: Failed to create container: Template "ghcr.io/mieweb/opensource-server/base:latest" not found on any node in this site

1 participant