Skip to content

Commit

Permalink
fix: skip apply if no manifests were generated
Browse files Browse the repository at this point in the history
Small fix for #27: in case Kustomize produces no CRDs or other manifests, we need to skip `kubectl apply` to avoid it complaining.

Signed-off-by: Dennis Marttinen <[email protected]>
  • Loading branch information
twelho committed Sep 1, 2024
1 parent a505025 commit 8e613da
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,8 +588,10 @@ def apply_configuration(node_set, configuration_file, global_patches):
manifests.append(manifest)

# Apply CRDs before everything else
kubectl("apply", "-f", "-", stdin=yaml.safe_dump_all(crds))
kubectl("apply", "-f", "-", stdin=yaml.safe_dump_all(manifests))
if len(crds):
kubectl("apply", "-f", "-", stdin=yaml.safe_dump_all(crds))
if len(manifests):
kubectl("apply", "-f", "-", stdin=yaml.safe_dump_all(manifests))

# Wait for the cluster to be healthy
talosctl("health")
Expand Down

0 comments on commit 8e613da

Please sign in to comment.