kapitan debug

 avatar
unknown
plain_text
3 months ago
7.4 kB
12
Indexable
lfcaldeira in 🌐 phobos in Code/kapitan-values tree
.
|-- builds
|   `-- prod-onprem
|-- inventory
|   |-- classes
|   |   |-- common.yml
|   |   |-- compilation
|   |   |   `-- helm-values.yml
|   |   |-- envs
|   |   |   |-- dev.yml
|   |   |   `-- prod.yml
|   |   `-- sites
|   |       |-- aws.yml
|   |       |-- azure.yml
|   |       `-- on-prem.yml
|   `-- targets
|       |-- dev-aws.yml
|       `-- prod-onprem.yml
`-- templates
    `-- values.yaml.j2

10 directories, 10 files




===============================================================================================

kapitan='docker run -t --rm -u $(id -u) -v "$(pwd):/src:delegated" kapicorp/kapitan'

===============================================================================================

lfcaldeira in 🌐 phobos in Code/kapitan-values kapitan compile -t dev-aws --verbose
2026-03-30 22:38:18,310 git.cmd      DEBUG    Popen(['git', 'version'], cwd=/src, stdin=None, shell=False, universal_newlines=False)
2026-03-30 22:38:18,350 git.cmd      DEBUG    Popen(['git', 'version'], cwd=/src, stdin=None, shell=False, universal_newlines=False)
2026-03-30 22:38:18,376 kapitan.cli  DEBUG    Running with args: Namespace(mp_method='spawn', subparser_name='compile', inventory_backend=<InventoryBackends.RECLASS: 'reclass'>, migrate=False, compose_target_name=False, search_paths=['.', 'lib'], jinja2_filters='lib/jinja2_filters.py', verbose=True, prune=False, quiet=False, output_path='.', fetch=False, force_fetch=False, force=False, validate=False, parallelism=None, indent=2, refs_path='./refs', reveal=False, embed_refs=False, inventory_path='./inventory', inventory_pool_cache=True, cache=False, cache_paths=[], ignore_version_check=False, use_go_jsonnet=False, schemas_path='./schemas', yaml_multiline_string_style='double-quotes', yaml_dump_null_as_empty=False, targets=['dev-aws'], labels=[], func=<function trigger_compile at 0x7cea507e2a20>, name='compile')
2026-03-30 22:38:18,454 kapitan.resources DEBUG    Using ReclassInventory as inventory backend
2026-03-30 22:38:18,455 kapitan.inventory.inventory DEBUG    Initialising inventory from ./inventory/targets
2026-03-30 22:38:18,457 kapitan.inventory.backends.reclass DEBUG    Inventory reclass: No config file found. Using reclass inventory config defaults
2026-03-30 22:38:18,484 kapitan.inventory.backends.reclass DEBUG    Inventory rendering with reclass took 0:00:00.015439
2026-03-30 22:38:18,485 kapitan.targets INFO     Rendered inventory (0.10s): discovered 2 targets.
2026-03-30 22:38:18,487 kapitan.targets INFO     Compiling 1/2 targets using 1 concurrent processes: (4 CPU detected)
2026-03-30 22:38:18,555 kapitan.targets DEBUG    load_target_inventory: found valid kapitan target dev-aws


2026-03-30 22:38:26,217 git.cmd      DEBUG    Popen(['git', 'version'], cwd=/src, stdin=None, shell=False, universal_newlines=False)
2026-03-30 22:38:26,256 git.cmd      DEBUG    Popen(['git', 'version'], cwd=/src, stdin=None, shell=False, universal_newlines=False)
2026-03-30 22:38:26,368 kapitan.inputs.base DEBUG    Compiling /src/templates/values.yaml.j2
Traceback (most recent call last):
  File "/opt/venv/lib/python3.11/site-packages/kapitan/targets.py", line 264, in compile_target
    input_compiler.compile_obj(compile_config)
  File "/opt/venv/lib/python3.11/site-packages/kapitan/inputs/base.py", line 74, in compile_obj
    self.compile_input_path(comp_obj, expanded_path)
  File "/opt/venv/lib/python3.11/site-packages/kapitan/inputs/base.py", line 160, in compile_input_path
    target_compile_path = os.path.join(self.compile_path, target_name.replace(".", "/"), output_path)
                                                          ^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'replace'
2026-03-30 22:38:26,464 kapitan.targets DEBUG    Compile pool terminated
2026-03-30 22:38:26,477 kapitan.targets ERROR    

2026-03-30 22:38:26,478 kapitan.targets ERROR    Invalid input_type: "jinja2" 'NoneType' object has no attribute 'replace'
multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/opt/venv/lib/python3.11/site-packages/kapitan/targets.py", line 264, in compile_target
    input_compiler.compile_obj(compile_config)
  File "/opt/venv/lib/python3.11/site-packages/kapitan/inputs/base.py", line 74, in compile_obj
    self.compile_input_path(comp_obj, expanded_path)
  File "/opt/venv/lib/python3.11/site-packages/kapitan/inputs/base.py", line 160, in compile_input_path
    target_compile_path = os.path.join(self.compile_path, target_name.replace(".", "/"), output_path)
                                                          ^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'replace'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
                    ^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.11/site-packages/kapitan/targets.py", line 269, in compile_target
    raise CompileError(f'Invalid input_type: "{compile_config.input_type}" {e}') from e
kapitan.errors.CompileError: Invalid input_type: "jinja2" 'NoneType' object has no attribute 'replace'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/venv/lib/python3.11/site-packages/kapitan/targets.py", line 129, in compile_targets
    [p.get() for p in pool.imap_unordered(worker, target_objs) if p]
  File "/opt/venv/lib/python3.11/site-packages/kapitan/targets.py", line 129, in <listcomp>
    [p.get() for p in pool.imap_unordered(worker, target_objs) if p]
  File "/usr/local/lib/python3.11/multiprocessing/pool.py", line 873, in next
    raise value
kapitan.errors.CompileError: Invalid input_type: "jinja2" 'NoneType' object has no attribute 'replace'
2026-03-30 22:38:26,516 kapitan.targets DEBUG    Removed /tmp/tmpx98t5mcw.kapitan

===============================================================================================

lfcaldeira in 🌐 phobos in Code/kapitan-values cat inventory/classes/common.yml
parameters:
  app_name: minha-app
  image: "my-registry.io/app:v1.0.0"
  port: 8080

===============================================================================================

lfcaldeira in 🌐 phobos in Code/kapitan-values cat inventory/classes/compilation/helm-values.yml 
parameters:
  kapitan:
    compile:
      - input_type: jinja2
        output_type: yaml
        input_paths:
          - templates/values.yaml.j2
        output_path: values.yaml
===============================================================================================

lfcaldeira in 🌐 phobos in Code/kapitan-values cat inventory/classes/envs/dev.yml 
parameters:
  app:
    replicas: 1
===============================================================================================
lfcaldeira in 🌐 phobos in Code/kapitan-values cat inventory/classes/sites/aws.yml
parameters:
  app:
    ingress:
      domain: cloud.aws.com
===============================================================================================

lfcaldeira in 🌐 phobos in Code/kapitan-values cat inventory/targets/dev-aws.yml
target_name: dev-aws
classes:
  - common
  - envs.dev
  - sites.aws
  - compilation.helm-values

parameters:
  target_name: emprego



Editor is loading...
Leave a Comment