Class V1FileKeySelector

java.lang.Object
io.kubernetes.client.openapi.models.V1FileKeySelector

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", date="2025-09-11T18:00:16.154662Z[Etc/UTC]", comments="Generator version: 7.13.0") public class V1FileKeySelector extends Object
FileKeySelector selects a key of the env file.
  • Field Details

  • Constructor Details

    • V1FileKeySelector

      public V1FileKeySelector()
  • Method Details

    • key

      public V1FileKeySelector key(@Nonnull String key)
    • getKey

      @Nonnull public String getKey()
      The key within the env file. An invalid key will prevent the pod from starting. The keys defined within a source may consist of any printable ASCII characters except '='. During Alpha stage of the EnvFiles feature gate, the key size is limited to 128 characters.
      Returns:
      key
    • setKey

      public void setKey(@Nonnull String key)
    • optional

      public V1FileKeySelector optional(@Nullable Boolean optional)
    • getOptional

      @Nullable public Boolean getOptional()
      Specify whether the file or its key must be defined. If the file or key does not exist, then the env var is not published. If optional is set to true and the specified key does not exist, the environment variable will not be set in the Pod's containers. If optional is set to false and the specified key does not exist, an error will be returned during Pod creation.
      Returns:
      optional
    • setOptional

      public void setOptional(@Nullable Boolean optional)
    • path

      public V1FileKeySelector path(@Nonnull String path)
    • getPath

      @Nonnull public String getPath()
      The path within the volume from which to select the file. Must be relative and may not contain the '..' path or start with '..'.
      Returns:
      path
    • setPath

      public void setPath(@Nonnull String path)
    • volumeName

      public V1FileKeySelector volumeName(@Nonnull String volumeName)
    • getVolumeName

      @Nonnull public String getVolumeName()
      The name of the volume mount containing the env file.
      Returns:
      volumeName
    • setVolumeName

      public void setVolumeName(@Nonnull String volumeName)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • validateJsonElement

      public static void validateJsonElement(com.google.gson.JsonElement jsonElement) throws IOException
      Validates the JSON Element and throws an exception if issues found
      Parameters:
      jsonElement - JSON Element
      Throws:
      IOException - if the JSON Element is invalid with respect to V1FileKeySelector
    • fromJson

      public static V1FileKeySelector fromJson(String jsonString) throws IOException
      Create an instance of V1FileKeySelector given an JSON string
      Parameters:
      jsonString - JSON string
      Returns:
      An instance of V1FileKeySelector
      Throws:
      IOException - if the JSON string is invalid with respect to V1FileKeySelector
    • toJson

      public String toJson()
      Convert an instance of V1FileKeySelector to an JSON string
      Returns:
      JSON string