policies

package
v0.19.913 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package policies derives stable filenames for Kubernetes policy manifests shipped through the Nuon sandbox Terraform module.

The sandbox module's `kubectl_manifest.vendor_policies` resource uses `for_each = fileset(...)`, so the filename is the Terraform state key. Anchoring the filename to the manifest's kind/namespace/name keeps the Terraform address bound to actual K8s object identity instead of the position of the policy in the source list.

Index

Constants

This section is empty.

Variables

View Source
var LegacyKeyPattern = regexp.MustCompile(`^\d+\.yaml$`)

LegacyKeyPattern matches the historic positional filenames (`0.yaml`, `12.yaml`) emitted before content-derived keys existed. The runner uses it to detect installs that still need a one-time `terraform state mv` migration.

Functions

func IsLegacyKey

func IsLegacyKey(key string) bool

IsLegacyKey reports whether key matches the historic positional form.

func ManifestKey

func ManifestKey(manifest map[string]any) (string, error)

ManifestKey returns the deterministic key for an already-parsed manifest.

func ManifestKeyFromYAML

func ManifestKeyFromYAML(contents string) (string, error)

ManifestKeyFromYAML parses a single Kubernetes manifest YAML document and returns a deterministic filename-style key derived from the manifest's kind, namespace (when present), and metadata.name.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL