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

server: don't export B&R APIs if feature is not enabled globally #4202

Merged
merged 6 commits into from Jul 7, 2020

Conversation

rohityadavcloud
Copy link
Member

@rohityadavcloud rohityadavcloud commented Jul 5, 2020

This change will ensure that B&R APIs are not exported if the feature is not enabled globally. Make it non-dynamic to require restarting of mgmt server which is needed for the background sync task to be setup or not.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

This change will ensure that B&R APIs are not exported if the feature
is not enabled in any of the zones.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
@rohityadavcloud
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔centos7 ✔debian. JID-1534

@rohityadavcloud
Copy link
Member Author

@blueorangutan test

@blueorangutan
Copy link

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link

Trillian test result (tid-1994)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 7573 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4202-t1994-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_backup_recovery_dummy.py
Intermittent failure detected: /marvin/tests/smoke/test_kubernetes_clusters.py
Smoke tests completed. 28 look OK, 1 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
ContextSuite context=TestDummyBackupAndRecovery>:setup Error 0.00 test_backup_recovery_dummy.py

Copy link
Member

@GabrielBrascher GabrielBrascher left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @rhtyd, code LGTM.

I just left a minor remark; could you please check if the raised question makes sense?

@@ -38,7 +38,7 @@
ConfigKey<Boolean> BackupFrameworkEnabled = new ConfigKey<>("Advanced", Boolean.class,
"backup.framework.enabled",
"false",
"Is backup and recovery framework enabled.", true, ConfigKey.Scope.Zone);
"Is backup and recovery framework enabled. Restart management server on global value change.", true, ConfigKey.Scope.Zone);
Copy link
Member

Choose a reason for hiding this comment

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

According to the description, ADMIN needs to restart the management server and therefore this is not a dynamic setting.

What do you think of changing the isDynamic param to false?

ConfigKey constructor:

public ConfigKey(String category, Class<T> type, String name, String defaultValue, String description, boolean isDynamic, Scope scope) {
    this(type, name, category, defaultValue, description, isDynamic, scope, null);
}

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll change that.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed thanks

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
@rohityadavcloud
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔centos7 ✔debian. JID-1536

@rohityadavcloud
Copy link
Member Author

@blueorangutan test

@blueorangutan
Copy link

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@rohityadavcloud
Copy link
Member Author

@davidjumani please review this, thnx

@rohityadavcloud rohityadavcloud changed the base branch from master to 4.14 July 6, 2020 17:12
@rohityadavcloud rohityadavcloud changed the title server: don't export APIs if feature is not enabled in any zones server: don't export B&R APIs if feature is not enabled globally Jul 6, 2020
@blueorangutan
Copy link

Trillian test result (tid-2008)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 49880 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4202-t2008-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_backup_recovery_dummy.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Smoke tests completed. 81 look OK, 2 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
ContextSuite context=TestDummyBackupAndRecovery>:setup Error 0.00 test_backup_recovery_dummy.py
test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers Error 470.84 test_vpc_redundant.py
test_04_rvpc_network_garbage_collector_nics Error 3853.05 test_vpc_redundant.py

@rohityadavcloud
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔centos7 ✔debian. JID-1539

@rohityadavcloud
Copy link
Member Author

@blueorangutan test

@blueorangutan
Copy link

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link

Packaging result: ✔centos7 ✔debian. JID-1547

Copy link
Contributor

@Pearl1594 Pearl1594 left a comment

Choose a reason for hiding this comment

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

LGTM. Test passes for simulator

@rohityadavcloud
Copy link
Member Author

Tested on KVM env, it skips tests for dummy provider now:

Import provider backup offering from Dummy Backup and Recovery Provider ... SKIP: Skipping test cases which must only run for Simulator
Test VM backup lifecycle ... SKIP: Skipping test cases which must only run for Simulator

----------------------------------------------------------------------
Ran 2 tests in 0.124s

OK (SKIP=2)

@rohityadavcloud rohityadavcloud merged commit db9f825 into apache:4.14 Jul 7, 2020
shwstppr pushed a commit to shapeblue/cloudstack that referenced this pull request Jul 8, 2020
…che#4202)

This change will ensure that B&R APIs are not exported if the feature
is not enabled in any of the zones.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants