Class Kustomization

java.lang.Object
dev.zucca_ops.kustomtrace.model.GraphNode
dev.zucca_ops.kustomtrace.model.Kustomization

public class Kustomization extends GraphNode
Represents a Kustomization (typically a kustomization.yaml file) as a node in the Kustomize dependency graph. It holds its own content and references to other graph nodes.
  • Constructor Details

    • Kustomization

      public Kustomization(Path path, Map<String,Object> content)
      Constructs a Kustomization node.
      Parameters:
      path - The file system path to this kustomization file.
      content - The parsed YAML content of this kustomization file.
  • Method Details

    • getContent

      public Map<String,Object> getContent()
      Returns the parsed content (YAML map) of this kustomization file.
      Returns:
      The raw content map.
    • addReference

      public void addReference(ResourceReference reference)
      Adds a resolved reference to another graph node.
      Parameters:
      reference - The ResourceReference to add.
    • getReferences

      public List<ResourceReference> getReferences()
      Gets the list of resolved references to other graph nodes.
      Returns:
      An unmodifiable list of ResourceReferences.
    • getKind

      public String getKind()
      Returns the kind of this graph node.
      Returns:
      Always "Kustomization" for this class.
    • isRoot

      public boolean isRoot()
      Determines if this Kustomization is a root node (i.e., no other Kustomizations depend on it).
      Returns:
      true if this Kustomization has no dependents, false otherwise.
    • getDisplayName

      public String getDisplayName()
      Provides a display name for this Kustomization, typically its kind and path.
      Returns:
      A string representation for display purposes.
    • isKustomization

      public boolean isKustomization()
      Indicates that this node is a Kustomization.
      Specified by:
      isKustomization in class GraphNode
      Returns:
      Always true.
    • isKustomFile

      public boolean isKustomFile()
      Indicates that this node is not a KustomFile.
      Specified by:
      isKustomFile in class GraphNode
      Returns:
      Always false.
    • getDependencies

      public Stream<Path> getDependencies()
      Retrieves all file dependencies for this Kustomization.
      Returns:
      A stream of unique Paths this Kustomization depends on.
    • getApps

      public Stream<Kustomization> getApps()
      Retrieves all "root" Kustomizations that this Kustomization contributes to.
      Returns:
      A stream of root Kustomizations.