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 force fetch per compile target #858

Closed
Moep90 opened this issue Sep 19, 2022 · 1 comment
Closed

Support force fetch per compile target #858

Moep90 opened this issue Sep 19, 2022 · 1 comment

Comments

@Moep90
Copy link
Contributor

Moep90 commented Sep 19, 2022

Support the ability to force fetch selected external dependencies.

The documentation says: "If you simply want the latest chart available, either don't include the version key or specify an empty string."

But to have the latest to compile, I need to always run kapitan compile --fetch --force.
This applies to all external dependencies.

Helm

This would fetch the latest version of the chart if there is an update.
Make sure to run helm helm repo update prior to fetching the latest chart.

  kapitan:
    dependencies:
    - type: helm
[...]
      version: "" <----- to fetch always latest
      fetch_always: true <--- force download this dependency always

Git

This would apply if we update the master between kapitan runs.

- type: git output_path: source/kapitan
  source: git@github.com:kapicorp/kapitan.git
  subdir: kapitan
  ref: master
  fetch_always: true <--- force download this dependency always

HTTP

- type: http | https
  output_path: path/to/file
  source: http[s]://<url>
  unpack: True | False
  fetch_always: true <--- force download this dependency always

Full example with helm

---
parameters:
  filebeat:
    chart_name: filebeat
    fullname: filebeat
    chart_version: "7.17.3"
    application_version: ${filebeat:chart_version}
    namespace: ${namespace}
  kapitan:
    dependencies:
    - type: helm
      output_path: components/charts/${filebeat:chart_name}/${filebeat:chart_version}/${filebeat:application_version}
      source: https://helm.elastic.co
      version: "" <----- to fetch always latest
      fetch_always: true <--- force download this dependency always
      chart_name: ${filebeat:chart_name}
    compile:
    - input_type: helm
      input_paths:
        - components/charts/${filebeat:chart_name}/${filebeat:chart_version}/${filebeat:application_version}
      output_path: manifests
      helm_params:
        namespace: ${filebeat:namespace}
        name: ${filebeat:chart_name}
        output_file: ${filebeat:chart_name}.yml
      helm_values: ${filebeat:helm_values}

Example compile run

$ kapitan compile --fetch
Not updating lib/terraform/__init__.py (file already exists)
[...]
Dependency helm chart filebeat and version 7.17.3: fetching now
Dependency helm chart filebeat and version 7.17.3: successfully fetched
@Moep90 Moep90 changed the title Support fetch force per compile target Support force fetch per compile target Sep 19, 2022
MatteoVoges added a commit to neXenio/kapitan that referenced this issue Oct 4, 2022
ramaro pushed a commit that referenced this issue Oct 30, 2022
* Added fetch_always functionality (#858)

* Changed flag --force to --force-fetch

* Fix lint

* Change name to force_fetch

* Change name to force_fetch in docs

* Update kap_1_external_dependencies.md
@Moep90
Copy link
Contributor Author

Moep90 commented Dec 2, 2022

closed by #862

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

No branches or pull requests

1 participant