Skip to content

MaxVersions tries to delete versions from other services when used with default service #66

@RayBB

Description

@RayBB

Steps to reproduce:

  1. Deploy the default service (we'll call it frontend) to the GAE project
  2. Deploy the api service to the GAE project
  3. Deploy a 2nd version of the api service to the GAE project
  4. Deploy a 2nd version of the frontend service to the GAE project with maxVersions: 1

When you complete step 4 you will see it delete 2 services instead of 1. One from frontend and one from backend.

If you do the same but switch the deploy order of frontend (default) and backend (such that it's BFFB) then you will see the last step will only delete 1 service.

here is a sample drone where it will delete from other services yaml:

---
kind: pipeline
name: default

platform:
  os: linux
  arch: amd64

image_pull_secrets:
  - .dockerconfigjson

steps:

  - name: deploy_dev_frontend_default1
    pull: if-not-exists
    image: nytimes/drone-gae
    settings:
      action: deploy
      app_file: frontend.yaml #THIS IS THE frontend (default) SERVICE
      dir: frontend_src
      max_versions: 1
      project: nyt-project-dev
    environment:
      GAE_CREDENTIALS:
        from_secret: google_credentials_dev
    when:
      event: [push]

  - name: deploy_dev_backend1
    pull: if-not-exists
    image: nytimes/drone-gae
    settings:
      action: deploy
      app_file: backend.yaml #THIS IS THE API SERVICE
      dir: frontend_src
      max_versions: 1
      project: nyt-project-dev
    environment:
      GAE_CREDENTIALS:
        from_secret: google_credentials_dev
    when:
      event: [push]


  - name: deploy_dev_backend2
    pull: if-not-exists
    image: nytimes/drone-gae
    settings:
      action: deploy
      app_file: backend.yaml #THIS IS THE API SERVICE
      dir: frontend_src
      max_versions: 2
      project: nyt-project-dev
    environment:
      GAE_CREDENTIALS:
        from_secret: google_credentials_dev
    when:
      event: [push]

  - name: deploy_dev_frontend_default2
    pull: if-not-exists
    image: nytimes/drone-gae
    settings:
      action: deploy
      app_file: frontend.yaml #THIS IS THE frontend (default) SERVICE
      dir: frontend_src
      max_versions: 1
      project: nyt-project-dev
    environment:
      GAE_CREDENTIALS:
        from_secret: google_credentials_dev
    when:
      event: [push]

Here's a sample of the default an non-default swapped with no issue:

---
kind: pipeline
name: default

platform:
  os: linux
  arch: amd64

image_pull_secrets:
  - .dockerconfigjson

steps:

  - name: deploy_dev_backend1
    pull: if-not-exists
    image: nytimes/drone-gae
    settings:
      action: deploy
      app_file: backend.yaml #THIS IS THE API SERVICE
      dir: frontend_src
      max_versions: 1
      project: nyt-project-dev
    environment:
      GAE_CREDENTIALS:
        from_secret: google_credentials_dev
    when:
      event: [push]

  - name: deploy_dev_frontend_default1
    pull: if-not-exists
    image: nytimes/drone-gae
    settings:
      action: deploy
      app_file: frontend.yaml #THIS IS THE frontend (default) SERVICE
      dir: frontend_src
      max_versions: 1
      project: nyt-project-dev
    environment:
      GAE_CREDENTIALS:
        from_secret: google_credentials_dev
    when:
      event: [push]

  - name: deploy_dev_frontend_default2
    pull: if-not-exists
    image: nytimes/drone-gae
    settings:
      action: deploy
      app_file: frontend.yaml #THIS IS THE frontend (default) SERVICE
      dir: frontend_src
      max_versions: 2
      project: nyt-project-dev
    environment:
      GAE_CREDENTIALS:
        from_secret: google_credentials_dev
    when:
      event: [push]

  - name: deploy_dev_backend2
    pull: if-not-exists
    image: nytimes/drone-gae
    settings:
      action: deploy
      app_file: backend.yaml #THIS IS THE API SERVICE
      dir: frontend_src
      max_versions: 1
      project: nyt-project-dev
    environment:
      GAE_CREDENTIALS:
        from_secret: google_credentials_dev
    when:
      event: [push]

Edit:
I've since confirmed that setting "service: default" in the drone.yaml or in the app.yaml will stop this plugin from deleting versions of all other services. However, that should probably happen without user having to specify.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions