diff --git a/kuku/dump.py b/kuku/dump.py
index b9366c0..614fec6 100644
--- a/kuku/dump.py
+++ b/kuku/dump.py
@@ -48,11 +48,13 @@ def dump(rendering: Rendering) -> str:
         template_output = []
         template_header = "# Source: {}\n".format(template_path)
         for k8s_object in k8s_objects:
-            # Override the default to_dict method so we can update the k8s keys
             if not k8s_object:
+                if k8s_object is None:
+                    continue
                 raise ValueError(
                     "Template '{}' returned {} object".format(template_path, k8s_object)
                 )
+            # Override the default to_dict method so we can update the k8s keys
             k8s_object.to_dict = MethodType(_camelized_to_dict, k8s_object)
             k8s_object = k8s_object.to_dict()
 

Feature request: ability to enable/disable whole K8s resource
I want to do something like this:
```python
def template(context):
    if not context["deployment"]["enabled"]:
        return

    context_name = context["name"]
    labels = {"app": context_name}
    ...
```
This fails with 
```
Traceback (most recent call last):
  File ".../bin/kuku", line 10, in <module>
    sys.exit(cli())
  File ".../kuku/cli.py", line 59, in cli
    output = dump(rendering)
  File ".../kuku/dump.py", line 54, in dump
    "Template '{}' returned {} object".format(template_path, k8s_object)
ValueError: Template 'deployment/k8s/templates/cronjob.py' returned None object
```

I am going to submit a PR that is going to skip the serialization/dumping of the `k8s_object` if it's `None`
diff --git a/kuku/tests/test_dump.py b/kuku/tests/test_dump.py
index e69de29..0ccafa8 100644
--- a/kuku/tests/test_dump.py
+++ b/kuku/tests/test_dump.py
@@ -0,0 +1,6 @@
+from kuku.dump import dump
+
+
+def test_dump_with_none_object():
+    output = dump({"dir1": [None, ]})
+    assert output == "# Source: dir1\n"

pip install -e .[dev]
parse_log_pytest
pytest
pytest
3.7
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs @ file:///croot/attrs_1668696182826/work
black==23.3.0
bleach==6.0.0
cachetools==5.5.2
certifi @ file:///croot/certifi_1671487769961/work/certifi
cffi==1.15.1
cfgv==3.3.1
charset-normalizer==3.4.1
click==8.1.8
coverage==7.2.7
cryptography==44.0.2
distlib==0.3.9
docopt==0.6.2
docutils==0.20.1
durationpy==0.9
filelock==3.12.2
flit_core @ file:///opt/conda/conda-bld/flit-core_1644941570762/work/source/flit_core
google-auth==2.38.0
identify==2.5.24
idna==3.10
importlib-metadata==6.7.0
importlib-resources==5.12.0
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
jaraco.classes==3.2.3
jeepney==0.9.0
keyring==24.1.1
kubernetes==32.0.1
-e git+https://github.com/xarg/kuku.git@be65d1b83cc3725cf7fbce16069559bd2e5cef93#egg=kuku
markdown-it-py==2.2.0
mdurl==0.1.2
more-itertools==9.1.0
mypy==1.4.1
mypy-extensions==1.0.0
nodeenv==1.9.1
oauthlib==3.2.2
packaging @ file:///croot/packaging_1671697413597/work
pathspec==0.11.2
pkginfo==1.10.0
platformdirs==4.0.0
pluggy @ file:///tmp/build/80754af9/pluggy_1648042572264/work
pre-commit==2.21.0
py @ file:///opt/conda/conda-bld/py_1644396412707/work
pyasn1==0.5.1
pyasn1-modules==0.3.0
pycparser==2.21
Pygments==2.17.2
pytest==7.1.2
pytest-cov==4.1.0
python-dateutil==2.9.0.post0
PyYAML==6.0.1
readme-renderer==37.3
requests==2.31.0
requests-oauthlib==2.0.0
requests-toolbelt==1.0.0
rfc3986==2.0.0
rich==13.8.1
rsa==4.9
SecretStorage==3.3.3
six==1.17.0
tomli @ file:///opt/conda/conda-bld/tomli_1657175507142/work
twine==4.0.2
typed-ast==1.5.5
typing_extensions==4.7.1
urllib3==2.0.7
virtualenv==20.26.6
webencodings==0.5.1
websocket-client==1.6.1
zipp @ file:///croot/zipp_1672387121353/work

name: kuku
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - attrs=22.1.0=py37h06a4308_0
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - flit-core=3.6.0=pyhd3eb1b0_0
  - importlib_metadata=4.11.3=hd3eb1b0_0
  - iniconfig=1.1.1=pyhd3eb1b0_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - packaging=22.0=py37h06a4308_0
  - pip=22.3.1=py37h06a4308_0
  - pluggy=1.0.0=py37h06a4308_1
  - py=1.11.0=pyhd3eb1b0_0
  - pytest=7.1.2=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tomli=2.0.1=py37h06a4308_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zipp=3.11.0=py37h06a4308_0
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - black==23.3.0
      - bleach==6.0.0
      - cachetools==5.5.2
      - cffi==1.15.1
      - cfgv==3.3.1
      - charset-normalizer==3.4.1
      - click==8.1.8
      - coverage==7.2.7
      - cryptography==44.0.2
      - distlib==0.3.9
      - docopt==0.6.2
      - docutils==0.20.1
      - durationpy==0.9
      - filelock==3.12.2
      - google-auth==2.38.0
      - identify==2.5.24
      - idna==3.10
      - importlib-metadata==6.7.0
      - importlib-resources==5.12.0
      - jaraco-classes==3.2.3
      - jeepney==0.9.0
      - keyring==24.1.1
      - kubernetes==32.0.1
      - markdown-it-py==2.2.0
      - mdurl==0.1.2
      - more-itertools==9.1.0
      - mypy==1.4.1
      - mypy-extensions==1.0.0
      - nodeenv==1.9.1
      - oauthlib==3.2.2
      - pathspec==0.11.2
      - pkginfo==1.10.0
      - platformdirs==4.0.0
      - pre-commit==2.21.0
      - pyasn1==0.5.1
      - pyasn1-modules==0.3.0
      - pycparser==2.21
      - pygments==2.17.2
      - pytest-cov==4.1.0
      - python-dateutil==2.9.0.post0
      - pyyaml==6.0.1
      - readme-renderer==37.3
      - requests==2.31.0
      - requests-oauthlib==2.0.0
      - requests-toolbelt==1.0.0
      - rfc3986==2.0.0
      - rich==13.8.1
      - rsa==4.9
      - secretstorage==3.3.3
      - six==1.17.0
      - twine==4.0.2
      - typed-ast==1.5.5
      - typing-extensions==4.7.1
      - urllib3==2.0.7
      - virtualenv==20.26.6
      - webencodings==0.5.1
      - websocket-client==1.6.1
prefix: /opt/conda/envs/kuku

kuku/tests/test_dump.py::test_dump_with_none_object
kuku/dump.py
kuku/dump.py