Skip to content

nyl template should error if only one namespace defined in a file and other resources are not in that namespace #19

Open

Description

@NiklasRosenstein

Example:

---
apiVersion: v1
kind: Namespace
metadata:
  name: foo

---
apiVersion: inline.nyl.io/v1
kind: HelmChart
release:
  name: redis
  namespace: sccache
chart:
  # Explore the chart at https://artifacthub.io/packages/helm/bitnami/redis
  repository: https://charts.bitnami.com/bitnami
  name: redis
  version: "20.0.3"
values:
  architecture: standalone
  master:
    persistence:
      enabled: true
      storageClass: hcloud-volumes
      size: 64Gi

This should have nyl template error that resources are in the sccache namespace despite only foo being defined. What you actually get is

2024-08-23 19:20:23.094 | WARNING  | Resource 'NetworkPolicy/redis' in 'sccache-redis.yaml' references namespace 'sccache', which is not defined in the file.
2024-08-23 19:20:23.094 | WARNING  | Resource 'PodDisruptionBudget/redis-master' in 'sccache-redis.yaml' references namespace 'sccache', which is not defined in the file.
2024-08-23 19:20:23.094 | WARNING  | Resource 'ServiceAccount/redis-master' in 'sccache-redis.yaml' references namespace 'sccache', which is not defined in the file.
2024-08-23 19:20:23.094 | WARNING  | Resource 'Secret/redis' in 'sccache-redis.yaml' references namespace 'sccache', which is not defined in the file.
2024-08-23 19:20:23.094 | WARNING  | Resource 'ConfigMap/redis-configuration' in 'sccache-redis.yaml' references namespace 'sccache', which is not defined in the file.
2024-08-23 19:20:23.094 | WARNING  | Resource 'ConfigMap/redis-health' in 'sccache-redis.yaml' references namespace 'sccache', which is not defined in the file.
2024-08-23 19:20:23.095 | WARNING  | Resource 'ConfigMap/redis-scripts' in 'sccache-redis.yaml' references namespace 'sccache', which is not defined in the file.
2024-08-23 19:20:23.095 | WARNING  | Resource 'Service/redis-headless' in 'sccache-redis.yaml' references namespace 'sccache', which is not defined in the file.
2024-08-23 19:20:23.095 | WARNING  | Resource 'Service/redis-master' in 'sccache-redis.yaml' references namespace 'sccache', which is not defined in the file.
2024-08-23 19:20:23.095 | WARNING  | Resource 'StatefulSet/redis-master' in 'sccache-redis.yaml' references namespace 'sccache', which is not defined in the file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions