Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support different versions per instance of a component #559

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

simu
Copy link
Member

@simu simu commented Jul 19, 2022

This PR changes Commodore to

  • Create separate worktrees for each component alias
  • Create class symlinks for each component alias
  • Create each alias target with only the defaults and component class symlinked from the alias worktree
  • Read instance versions from parameters.components.<instance-name>

Note that per-instance versions only work correctly only for components which use ${_base_directory} in their config when specifying Jsonnet files or Helm chart/YAML locations in kapitan.compile and kapitan.dependencies. Note, that components should use ${_base_directory} anyway, and new components created from the template use ${_base_directory} out of the box.

TODO:

  • Implement support for overriding the URL or path for individual component instances
  • Test cases which cover new features

Resolves #563

Checklist

  • Keep pull requests small so they can be easily reviewed.
  • Update the documentation.
  • Update tests.
  • Categorize the PR by setting a good title and adding one of the labels:
    bug, enhancement, documentation, change, breaking, dependency
    as they show up in the changelog

@simu simu changed the title Suppor different versions per instance of a component Support different versions per instance of a component Jul 19, 2022
@simu simu added the enhancement New feature or request label Jul 19, 2022
simu added 2 commits July 19, 2022 17:00
Recent pylint (or Python+pylint) versions can deal with `Optional[str]`
and similar type annotations without requiring the pylint annotation
`# pylint: disable=unsubscriptable-object`.
Implemented:
* Create separate worktrees for each component alias
* Create class symlinks for each component alias
* Create each alias target with only the defaults and component class
  for the alias worktree
* Works only for components which use `${_base_directory}` in their
  config (kapitan.compile and kapitan.dependencies mainly)

TODO:
* Actually allow users to specify version for each alias separately
* Cleanup changes
* Add tests
* Update docs
@simu simu force-pushed the feat/per-alias-versions branch from cd837a7 to 7322392 Compare July 19, 2022 15:00
simu added 3 commits July 19, 2022 17:04
We add support for specifying instance versions in
`parameters.components`. Commodore falls back to the version/url/path
specified for the component when the keys are not provided for component
aliases.

Note that the actual dependency handling doesn't yet support overriding
URL/path for aliases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow users to specify different versions for different instances of the same component
1 participant