Class Manifests.ManifestObject

java.lang.Object
com.google.jenkins.plugins.k8sengine.Manifests.ManifestObject
Enclosing class:
Manifests

public static class Manifests.ManifestObject extends Object
ManifestObject wrapper that encapsulates an object spec loaded from a supplied manifest.
  • Constructor Details

    • ManifestObject

      public ManifestObject(Map<String,Object> source, FilePath file)
      Build the manifest object from source.
      Parameters:
      source - The YAML map source for the object.
      file - The file containing the manifest.
  • Method Details

    • getFile

      public FilePath getFile()
      Returns:
      The file containing this manifest.
    • getSource

      public Map<String,Object> getSource()
      Returns:
      The YAML map source for the object.
    • getApiVersion

      public String getApiVersion()
      Returns:
      The apiVersion.
    • getKind

      public String getKind()
      Returns:
      The kind.
    • getName

      public Optional<String> getName()
      Returns:
      The name.
    • getOrCreateLabels

      public Map<String,String> getOrCreateLabels()
      Ensures this Manifests.ManifestObject has labels, modifying in-place as needed, finally returning the labels.
      Returns:
      The labels for this Manifests.ManifestObject.
    • addLabel

      public void addLabel(String key, String value)
      Adds the specified label key and value to this Manifests.ManifestObject's metadata labels. Will ensure a label map exists upon execution.
      Parameters:
      key - The key of the label to be added.
      value - The value of the label to be added.
    • describe

      public String describe()
      Returns:
      The description of the object in {ApiVersion}/{Kind}: {Name}