Class Manifests
java.lang.Object
com.google.jenkins.plugins.k8sengine.Manifests
Utility library for loading Kubernetes manifests files from a
FilePath
into a list of
descriptive wrappers, Manifests.ManifestObject
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
ManifestObject wrapper that encapsulates an object spec loaded from a supplied manifest. -
Method Summary
Modifier and TypeMethodDescriptionstatic Manifests
Factory method for singleFilePath
.static Manifests
fromFileList
(List<FilePath> files) Factory method for list ofFilePath
objects.getObjectManifestsOfKinds
(Set<String> includedKinds) Get the list ofManifests.ManifestObject
that match the given kind.void
write()
Writes the contents of thisManifests
's objects back to their corresponding files.
-
Method Details
-
fromFile
Factory method for singleFilePath
.- Parameters:
file
- TheFilePath
containing the manifests.- Returns:
- A
Manifests
object containing the individual manifests contained at the file path. - Throws:
IOException
- If an error occurred while loading the file.InterruptedException
- If a threading error occurred while loading the file.
-
fromFileList
Factory method for list ofFilePath
objects.- Parameters:
files
- The list ofFilePath
objects containing the manifests.- Returns:
- Manifests object constructed based on the list of
FilePath
's. - Throws:
IOException
- If an error occurred while loading the file.InterruptedException
- If a threading error occurred while loading the file.
-
getObjectManifests
- Returns:
- The
Manifests.ManifestObject
's that were loaded.
-
getObjectManifestsOfKinds
Get the list ofManifests.ManifestObject
that match the given kind.- Parameters:
includedKinds
- The kinds of Kubernetes objects to include in the list.- Returns:
- The manifest objects that match the included kinds.
-
write
Writes the contents of thisManifests
's objects back to their corresponding files.- Throws:
InterruptedException
- If an error occurred while dumping to YAML.IOException
- If an error occurred while writing the file contents.
-