ApplicationInstance

pydantic model phalanx.models.applications.ApplicationInstance

A Phalanx application as configured for a specific environment.

Parameters:

data (Any)

Show JSON schema
{
   "title": "ApplicationInstance",
   "description": "A Phalanx application as configured for a specific environment.",
   "type": "object",
   "properties": {
      "name": {
         "title": "Name",
         "type": "string"
      },
      "environment": {
         "title": "Environment",
         "type": "string"
      },
      "project": {
         "$ref": "#/$defs/Project"
      },
      "chart": {
         "title": "Chart",
         "type": "object"
      },
      "values": {
         "title": "Values",
         "type": "object"
      },
      "secrets": {
         "additionalProperties": {
            "$ref": "#/$defs/Secret"
         },
         "default": {},
         "description": "Secrets required for this application in this environment.",
         "title": "Required secrets",
         "type": "object"
      }
   },
   "$defs": {
      "Project": {
         "description": "Valid choices for the Argo CD project of an application.",
         "enum": [
            "infrastructure",
            "rsp",
            "rubin",
            "roundtable",
            "monitoring",
            "prompt",
            "telescope"
         ],
         "title": "Project",
         "type": "string"
      },
      "Secret": {
         "additionalProperties": false,
         "description": "Specification for an application secret for a specific environment.\n\nThe same as `SecretConfig` except augmented with the secret application\nand key for internal convenience.",
         "properties": {
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Description of the secret",
               "title": "Description"
            },
            "copy": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SecretCopyRules"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Rules for where the secret should be copied from",
               "title": "Copy rules"
            },
            "generate": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SimpleSecretGenerateRules"
                  },
                  {
                     "$ref": "#/$defs/SourceSecretGenerateRules"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Rules for how the secret should be generated",
               "title": "Generation rules"
            },
            "onepassword": {
               "allOf": [
                  {
                     "$ref": "#/$defs/SecretOnepasswordConfig"
                  }
               ],
               "description": "Configuration for how the secret is stored in 1Password",
               "title": "1Password configuration"
            },
            "value": {
               "anyOf": [
                  {
                     "format": "password",
                     "type": "string",
                     "writeOnly": true
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Fixed value of secret",
               "title": "Value"
            },
            "key": {
               "title": "Key",
               "type": "string"
            },
            "application": {
               "title": "Application",
               "type": "string"
            }
         },
         "required": [
            "key",
            "application"
         ],
         "title": "Secret",
         "type": "object"
      },
      "SecretCopyRules": {
         "additionalProperties": false,
         "description": "Rules for copying a secret value from another secret.",
         "properties": {
            "application": {
               "description": "Application from which the secret should be copied",
               "title": "Application",
               "type": "string"
            },
            "key": {
               "description": "Secret key from which the secret should be copied",
               "title": "Key",
               "type": "string"
            }
         },
         "required": [
            "application",
            "key"
         ],
         "title": "SecretCopyRules",
         "type": "object"
      },
      "SecretOnepasswordConfig": {
         "description": "Configuration for how a static secret is stored in 1Password.",
         "properties": {
            "encoded": {
               "default": false,
               "description": "Whether the 1Password copy of the secret is encoded in base64. 1Password doesn't support newlines in secrets, so secrets that contain significant newlines have to be encoded when storing them in 1Password. This flag indicates that this has been done, and therefore when retrieving the secret from 1Password, its base64-encoding must be undone.",
               "title": "Is base64-encoded",
               "type": "boolean"
            }
         },
         "title": "SecretOnepasswordConfig",
         "type": "object"
      },
      "SimpleSecretGenerateRules": {
         "additionalProperties": false,
         "description": "Rules for generating a secret value with no source information.",
         "properties": {
            "type": {
               "description": "Type of secret",
               "enum": [
                  "password",
                  "gafaelfawr-token",
                  "fernet-key",
                  "rsa-private-key"
               ],
               "title": "Secret type",
               "type": "string"
            }
         },
         "required": [
            "type"
         ],
         "title": "SimpleSecretGenerateRules",
         "type": "object"
      },
      "SourceSecretGenerateRules": {
         "description": "Rules for generating a secret from another secret.",
         "properties": {
            "type": {
               "description": "Type of secret",
               "enum": [
                  "bcrypt-password-hash",
                  "mtime"
               ],
               "title": "Secret type",
               "type": "string"
            },
            "source": {
               "description": "Key of secret on which this secret is based. This may only be set by secrets of type ``bcrypt-password-hash`` or ``mtime``.",
               "title": "Source key",
               "type": "string"
            }
         },
         "required": [
            "type",
            "source"
         ],
         "title": "SourceSecretGenerateRules",
         "type": "object"
      }
   },
   "required": [
      "name",
      "environment",
      "project",
      "chart",
      "values"
   ]
}

Fields:
field chart: dict[str, Any] [Required]

Parsed Helm Chart.yaml file.

field environment: str [Required]

Name of the environment for which the application is configured.

field name: str [Required]

Name of the application.

field project: Project [Required]

Argo CD project to which this application belongs.

field secrets: dict[str, Secret] = {}

Secrets required for this application in this environment.

field values: dict[str, Any] [Required]

Merged Helm values for the application in this environment.

all_static_secrets()

Return all static secrets for this instance of the application.

Return type:

list[Secret]

is_values_setting_true(setting)

Determine whether a given Helm values setting is true.

The values setting is considered true if the corresponding values parameter is present and set to a true value (a non-empty array or dictionary or a string, number, or boolean value that evaluates to true in Python).

Parameters:

setting (str) – Setting to check.

Returns:

True if the setting was set to a true value, False otherwise.

Return type:

bool