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 classManifestObject wrapper that encapsulates an object spec loaded from a supplied manifest. -
Method Summary
Modifier and TypeMethodDescriptionstatic ManifestsFactory method for singleFilePath.static ManifestsfromFileList(List<FilePath> files) Factory method for list ofFilePathobjects.getObjectManifestsOfKinds(Set<String> includedKinds) Get the list ofManifests.ManifestObjectthat match the given kind.voidwrite()Writes the contents of thisManifests's objects back to their corresponding files.
-
Method Details
-
fromFile
Factory method for singleFilePath.- Parameters:
file- TheFilePathcontaining the manifests.- Returns:
- A
Manifestsobject 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 ofFilePathobjects.- Parameters:
files- The list ofFilePathobjects 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.ManifestObjectthat 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.
-