Skip to content

Commit

Permalink
:fix available candidates for patroni switch check
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita Savchenko committed Aug 2, 2023
1 parent e9f7ea6 commit e0f2eea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/release_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,15 @@ jobs:
- name: Build deb package
run: |
export BUILD_RESULTS_DIR=debs
export BUILD_DIR=buildroot
export PACKAGE_NAME=chaosd-o3
mkdir -p "${DIR}/${BUILD_RESULTS_DIR}" "${DIR}/${BUILD_DIR}/usr/bin"
apt-get update && apt-get install ruby-dev build-essential curl grep -y && gem install fpm
export RELEASE_VERSION=$(echo "${{ env.RELEASE_VERSION }}" | grep -Eo '[0-9.]+')
echo $RELEASE_VERSION
fpm -s dir -t deb --name chaosd-o3 -C . --version $RELEASE_VERSION --iteration 1 --description "custom chaosd from Ozon Tech" -p "chaosd-o3.deb"
install ./bin/chaosd ${DIR}/${BUILD_DIR}/usr/bin/chaosd
fpm -s dir -t deb --name chaosd-o3 -C "${DIR}/${BUILD_DIR}" --version $RELEASE_VERSION --iteration 1 --description "custom chaosd from Ozon Tech" -p "${PACKAGE_NAME}.deb"
ls -la
- name: Create Release
Expand All @@ -59,6 +64,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ env.RELEASE_VERSION }}
RELEASE: $(echo "${{ env.RELEASE_VERSION }}" | grep -Eo '[0-9.]+')
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./chaosd-o3.deb
Expand Down
4 changes: 2 additions & 2 deletions pkg/server/chaosd/patroni.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ func (patroniAttack) Attack(options core.AttackConfig, _ Environment) error {
return errors.WithStack(err)
}

if len(patroniInfo.Replicas) == 0 {
err = errors.Errorf("failed to get available replicas. Please, check your cluster")
if len(patroniInfo.Replicas) == 0 && len(patroniInfo.SyncStandby) == 0 {
err = errors.Errorf("failed to get available candidates. Please, check your cluster.")
return errors.WithStack(err)
}

Expand Down

0 comments on commit e0f2eea

Please sign in to comment.