Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(clouddriver): add a new task that checks if the application specified in the moniker or cluster keys exists in front50 and/or clouddriver #4788

Merged
merged 10 commits into from
Oct 1, 2024

Conversation

kirangodishala
Copy link
Contributor

Introduces a new CheckIfApplicationExists task that is meant to be added to various pipeline stages. This task performs the following actions:

  • checks if the application defined in the pipeline stage context is known to front50 and/or clouddriver. If it isn't, this stage throws an exception. Without this task, clouddriver ends up creating a new synthetic application that is not known to front50 and it causes a whole lot of problems for us, as this application does not have any permissions, doesn't have account rbac etc.

  • There are three main types of pipeline stages where this task needs to be added:

    • ServerGroup (aws)
    • Cluster (aws)
    • Manifests (kubernetes)
  • Servergroup, cluster and manifests stages obtain an application name in different ways. Hence, a separate CheckIfApplicationExists exists for all of them which extend a common AbstractCheckIfApplicationExistsTask

  • Config knobs are provided at each stage so that all of these stages can be individually configured to not perform this check if needed. These configs are by default set to false, so this is an opt-in capability. The complete list of configs are:

stages:
# server group stages
  bulk-destroy-server-group-stage:
    check-if-application-exists.enabled: true
  create-server-group-stage:
    check-if-application-exists.enabled: true
  clone-server-group-stage:
    check-if-application-exists.enabled: true
  resize-server-group-stage:
    check-if-application-exists.enabled: true
    
# cluster stages
  disable-cluster-stage:
    check-if-application-exists.enabled: true
  scale-down-cluster-stage:
    check-if-application-exists.enabled: true
  shrink-cluster-stage:
    check-if-application-exists.enabled: true

 # k8s manifest stages
  deploy-manifest-stage:
    check-if-application-exists.enabled: true
  • Separate config knobs are also provided at the AbstractCheckIfApplicationExistsTask level to determine if clouddriver needs to be queried for the application or not. It is by default set to true, so it is an opt-out capability. the config property is:
tasks:
  clouddriver:
    checkIfApplicationExistsTask:
      checkClouddriver: false
  • run this in audit mode. By default it is set to true. Opt-out of it (which will start failing pipelines) by:
tasks:
    clouddriver:
      checkIfApplicationExistsTask:
        auditModeEnabled: false

@dbyron-sf dbyron-sf added the ready to merge Approved and ready for merge label Oct 1, 2024
@mergify mergify bot added the auto merged Merged automatically by a bot label Oct 1, 2024
@mergify mergify bot merged commit 51a9acf into spinnaker:master Oct 1, 2024
5 checks passed
kirangodishala added a commit to kirangodishala/spinnaker.io that referenced this pull request Oct 3, 2024
dbyron-sf pushed a commit to spinnaker/spinnaker.io that referenced this pull request Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto merged Merged automatically by a bot ready to merge Approved and ready for merge target-release/1.36
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants