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

Allow a plan to "include" another plan. #1767

Open
simonvane opened this issue Feb 1, 2021 · 0 comments
Open

Allow a plan to "include" another plan. #1767

simonvane opened this issue Feb 1, 2021 · 0 comments

Comments

@simonvane
Copy link

simonvane commented Feb 1, 2021

What would you like to be added:
Allow a complete plan to be run at a specific point in another plan.

Why is this needed:
Upgrade processes are often identical to the deploy plan, with the exception of a pre-upgrade step and a post-upgrade step. It would be preferable not to duplicate the deploy plan phases in the upgrade plan.

(I would not expect parameters that trigger the included plan to have any effect on the plan it is included in)

Example:
This is a cut-down code snippet of our operator.yaml that hopefully demonstrates what I mean.

plans:
  deploy:
    phases:
    - name: deploy-init
      steps:
      - name: deploy-database
        tasks:
        - database-migrate
      strategy: serial
    - name: deploy-configs
      steps:
        - name: deploy-config
          tasks:
            - apiserver-config
      strategy: serial
    - name: deploy-apiserver
      steps:
        - name: deploy-apiserver
          tasks:
            - apiserver
      strategy: serial
    - name: deploy-virtualservices
      steps:
        - name: deploy-virtualservices
          tasks:
            - virtualservices
      strategy: serial
    - name: cleanup
      steps:
        - name: cleanup
          tasks:
            - database-migrate-cleanup
      strategy: serial
    strategy: serial
  upgrade:
    phases:
      - name: offline
        steps:
          - name: offline
            tasks:
              - take-app-offline
      - name: backup
        steps:
          - name: backup
            tasks:
              - backup-db              
      - name: upgrade
        includePlan: deploy # upgrade is identical to deploy except that we need to take the application offline, backup the database, and bring the app online afterwards.
      - name: online
        steps:
          - name: online
            tasks:
              - bring-app-online  
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant