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 flag to conjurctl server to skip migrations #2895

Merged
merged 1 commit into from
Aug 9, 2023

Conversation

telday
Copy link
Contributor

@telday telday commented Aug 9, 2023

Desired Outcome

Adds new flag to the conjurctl server command which allows for skipping the migrations step even when the Sequel gem would normally think we need to. This change is required by a k8s follower using selective replication. When a k8s follower boots with selective replication enabled it performs a schema dump instead of a full database backup which means the schema_migrations and schema_info tables containing what migrations the database has had applied is missing and therefore the Sequel gem attempts to apply all of them. This then causes errors when the migration attempts to create schema elements already present in the database.

Implemented Changes

If the new --no-migrate flag is used the migration step is skipped when booting Conjur.

Connected Issue/Story

Resolves #[relevant GitHub issue(s), e.g. 76]

CyberArk internal issue ID: [CNJR-1599]

Definition of Done

Changelog

  • The CHANGELOG has been updated, or
  • This PR does not include user-facing changes and doesn't require a
    CHANGELOG update

Test coverage

  • This PR includes new unit and integration tests to go with the code
    changes, or
  • The changes in this PR do not require tests

Documentation

  • Docs (e.g. READMEs) were updated in this PR
  • A follow-up issue to update official docs has been filed here: [insert issue ID]
  • This PR does not require updating any documentation

Behavior

  • This PR changes product behavior and has been reviewed by a PO, or
  • These changes are part of a larger initiative that will be reviewed later, or
  • No behavior was changed with this PR

Security

  • Security architect has reviewed the changes in this PR,
  • These changes are part of a larger initiative with a separate security review, or
  • There are no security aspects to these changes

@telday telday requested a review from a team as a code owner August 9, 2023 16:42
@telday telday force-pushed the CNJR-1599-follower-db-updates branch 2 times, most recently from 5612744 to 016489c Compare August 9, 2023 16:44
@imheresamir
Copy link
Contributor

@telday I think we may need some tests added to spec/conjurctl/server_spec.rb

@telday telday force-pushed the CNJR-1599-follower-db-updates branch 2 times, most recently from 30a5fe9 to 8ac49d3 Compare August 9, 2023 17:28
@@ -42,6 +42,10 @@
c.default_value(ENV['PORT'] || '80')
c.flag [ :p, :port ]

c.desc 'Skip running database migrations on start'
c.default_value false
Copy link

Choose a reason for hiding this comment

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

Use parentheses for method calls with arguments.

@@ -15,6 +15,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Telemetry support
[cyberark/conjur#2854](https://github.com/cyberark/conjur/pull/2854)

### Added
- New flag to `conjurctl server` command called `--no-migrate` which allows for skipping
Copy link

Choose a reason for hiding this comment

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

Lists should be surrounded by blank lines

@telday telday force-pushed the CNJR-1599-follower-db-updates branch from 8ac49d3 to 1e8d9a3 Compare August 9, 2023 19:19
imheresamir
imheresamir previously approved these changes Aug 9, 2023
Copy link
Contributor

@imheresamir imheresamir left a comment

Choose a reason for hiding this comment

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

LGTM!

@codeclimate
Copy link

codeclimate bot commented Aug 9, 2023

Code Climate has analyzed commit 2324d85 and detected 4 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1
Style 3

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 88.4% (-0.2% change).

View more on Code Climate.

@telday telday merged commit a5ea20c into master Aug 9, 2023
@telday telday deleted the CNJR-1599-follower-db-updates branch August 9, 2023 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants