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

add optional wait flag to scaleWorkload function #1350

Merged
merged 6 commits into from
Apr 19, 2022

Conversation

kale-amruta
Copy link
Contributor

@kale-amruta kale-amruta commented Apr 4, 2022

Change Overview

Currently ScaleWorkload function waits for the workload to be ready for the function to be complete. This PR adds a flag to make the wait optional

Pull request type

Please check the type of change your PR introduces:

  • 🚧 Work in Progress
  • 🌈 Refactoring (no functional changes, no api changes)
  • 🐹 Trivial/Minor
  • 🐛 Bugfix
  • 🌻 Feature
  • 🗺️ Documentation
  • 🤖 Test

Issues

Test Plan

  • 💪 Manual
  • ⚡ Unit test
  • 💚 E2E

Used the flag in cassandra blueprint, and changed the function bringupPod in restore phase and tested these scenarios

- func: ScaleWorkload
      name: bringupPod
      args:
        namespace: "{{ .StatefulSet.Namespace }}"
        name: "{{ .StatefulSet.Name }}"
        kind: StatefulSet
        replicas: "{{ .ArtifactsIn.params.KeyValue.replicaCount }}"
  • Without adding flag waitForReady , the bringupPod function waited for the pods to be in ready state since thats the default behavior
  • Added waitForReady: false , the bringupPod function did not wait for the pod to be in ready state and started executing the next function
  • Added waitForReady: true , the bringupPod function waited for the pod to be in ready state
  • Added waitForReady: "xyz" , the bringupPod function failed to execute because it needed bool value to be passed

docs/functions.rst Outdated Show resolved Hide resolved
docs/functions.rst Outdated Show resolved Hide resolved
pkg/function/scale_workload.go Outdated Show resolved Hide resolved
Copy link
Contributor

@ihcsim ihcsim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍. Thanks for working on this!

@kale-amruta kale-amruta linked an issue Apr 14, 2022 that may be closed by this pull request
@kale-amruta kale-amruta added this to In Progress in Kanister via automation Apr 14, 2022
@mergify mergify bot merged commit 843724b into master Apr 19, 2022
Kanister automation moved this from In Progress to Done Apr 19, 2022
@mergify mergify bot deleted the ScaleWorkloadWaitOptional branch April 19, 2022 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

Add optional argument "wait" to ScaleWorkload
4 participants