spinnaker.execution.stages.before.deleteManifest

A policy targeting this object runs before executing each task in a deleteManifest stage.

See Deploy Applications to Kubernetes for more information on this stage.

Example Payload

Click to expand
{
  "input": {
    "deploy": {
      "account": "spinnaker",
      "allCoordinates": [],
      "credentials": "spinnaker",
      "events": [],
      "kinds": [],
      "labelSelectors": {
        "empty": true,
        "notEmpty": false,
        "selectors": []
      },
      "location": "staging",
      "manifestName": "deployment hostname",
      "options": {
        "apiVersion": null,
        "dryRun": null,
        "gracePeriodSeconds": 5,
        "kind": null,
        "orphanDependents": null,
        "preconditions": null,
        "propagationPolicy": null
      }
    }
  }
}

Example Policy

This example policy requires Delete Manifest stages to provide a minimum 2 minute grace period when run in production.

package spinnaker.execution.stages.before.deleteManifest

productionAccounts :=["prod1","prod2"]

deny["deletions in production accounts must allow a minimum of 2 minutes for graceful shutdown."]{
	input.deploy.account==productionAccounts[_]
    input.deploy.options.gracePeriodSeconds<120
}

Keys

KeyTypeDescription
input.deploy.accountstringThe account being deployed to.
input.deploy.credentialsstringThe credentials to use to access the account.
input.deploy.labelSelectors.emptyboolean
input.deploy.labelSelectors.notEmptyboolean
input.deploy.locationstringThe name of the namespace from which the manifest is being deleted.
input.deploy.manifestNamestringThe name of the manifest being deleted.
input.deploy.options.apiVersionstringThe API version in which the manifest’s kind is defined.
input.deploy.options.dryRunbooleanIf true then the manifest is not actually deleted. if false it is.
input.deploy.options.gracePeriodSecondsnumberHow many seconds the resource being deleted is given to shut down gracefully before being forcefully shut down.
input.deploy.options.kindstringWhat is the kind of manifest that is being deleted.
input.deploy.options.orphanDependentsWhen set, delete all resources managed by this resource as well (all pods owned by a replica set). When unset, this may orphan resources.
input.deploy.options.preconditions
input.deploy.options.propagationPolicyThere are three different ways to delete a Kubernetes object:
Foreground: The object itself cannot be deleted unless the objects that it owns have already been deleted.
Background: The object itself is deleted, then the objects that it owned are automatically deleted.
Orphan: The object itself is deleted. Any objects it owns are “orphaned.”

Last modified August 18, 2023: (02b163b7)