Skip to content

server: add global setting consoleproxy.sslEnabled - #8809

Merged
yadvr merged 1 commit into
apache:4.19from
weizhouapache:4.19-add-globalsetting-sslenabled
Jun 21, 2024
Merged

yadvr merged 1 commit into
apache:4.19from
weizhouapache:4.19-add-globalsetting-sslenabled

Conversation

@weizhouapache

@weizhouapache weizhouapache commented Mar 20, 2024 •

Copy link
Copy Markdown
Member

Description

This PR adds global setting consoleproxy.sslEnabled

without this patch
image

with this patch
image

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)
  • build/CI

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@weizhouapache weizhouapache added this to the 4.19.1.0 milestone Mar 20, 2024
@codecov

codecov Bot commented Mar 20, 2024 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 50.00000% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 30.96%. Comparing base (fe5d741) to head (2261055).
Report is 3 commits behind head on 4.19.

Files Patch % Lines
...ud/consoleproxy/AgentBasedConsoleProxyManager.java 0.00% 1 Missing ⚠️
...ain/java/com/cloud/consoleproxy/AgentHookBase.java 0.00% 1 Missing ⚠️
.../cloud/consoleproxy/StaticConsoleProxyManager.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               4.19    #8809   +/-   ##
=========================================
  Coverage     30.95%   30.96%           
- Complexity    34336    34337    +1     
=========================================
  Files          5355     5355           
  Lines        376630   376631    +1     
  Branches      54807    54807           
=========================================
+ Hits         116601   116625   +24     
+ Misses       244688   244665   -23     
  Partials      15341    15341           
Flag Coverage Δ
simulator-marvin-tests 24.80% <50.00%> (+<0.01%) ⬆️
uitests 4.39% <ø> (ø)
unit-tests 16.57% <16.66%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


String consoleProxyUrlDomain = _configDao.getValue(Config.ConsoleProxyUrlDomain.key());
String consoleProxySslEnabled = _configDao.getValue("consoleproxy.sslEnabled");
String consoleProxySslEnabled = _configDao.getValue(ConsoleProxyManager.ConsoleProxySslEnabled.key());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
String consoleProxySslEnabled = _configDao.getValue(ConsoleProxyManager.ConsoleProxySslEnabled.key());
String consoleProxySslEnabled = ConsoleProxyManager.ConsoleProxySslEnabled.value();

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@GutoVeronezi
this may not work as the _configDao is set in the constructor of the class.

    protected AgentHookBase(VMInstanceDao instanceDao, HostDao hostDao, ConfigurationDao cfgDao, KeystoreManager ksMgr,
                         AgentManager agentMgr, KeysManager keysMgr, ConsoleAccessManager consoleAccessMgr) {
        _instanceDao = instanceDao;
        _hostDao = hostDao;
        _agentMgr = agentMgr;
        _configDao = cfgDao;
        _ksMgr = ksMgr;
        _keysMgr = keysMgr;
        consoleAccessManager = consoleAccessMgr;
    }

@GutoVeronezi GutoVeronezi Mar 20, 2024 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If the class will have access to the DB, it should work, as the value() will query for the value (if the configDepot is configured).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I did some debugging, it looks the values are the same.

2024-03-21T08:05:48,498 DEBUG [c.c.c.ConsoleProxyManagerImpl] (main:[]) (logid:) configs.get(ConsoleProxySslEnabled.key() = true
2024-03-21T08:05:48,502 DEBUG [c.c.c.ConsoleProxyManagerImpl] (main:[]) (logid:) ConsoleProxySslEnabled.value() = true

2024-03-21T08:06:02,499 DEBUG [c.c.c.C.VmBasedAgentHook] (AgentConnectTaskPool-4:[ctx-f64d74cc]) (logid:29169184) _configDao.getValue(ConsoleProxyManager.ConsoleProxySslEnabled.key()) = true
2024-03-21T08:06:02,499 DEBUG [c.c.c.C.VmBasedAgentHook] (AgentConnectTaskPool-4:[ctx-f64d74cc]) (logid:29169184) ConsoleProxySslEnabled.value() = true

however, I prefer not to change the code as the old/new codes basically get the same value from database.
The old code has been proved to be working. Some other values are fetched in the same way.
@GutoVeronezi

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same as line-215

@sureshanaparti

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el7 ✖️ el8 ✖️ el9 ✔️ debian ✖️ suse15. SL-JID 8986

@weizhouapache

Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 8988

@weizhouapache

Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9387

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan test keepEnv

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-9978)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 44910 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8809-t9978-kvm-centos7.zip
Smoke tests completed. 129 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_events_resource Error 423.26 test_events_resource.py

@DaanHoogland

Copy link
Copy Markdown
Contributor

@GutoVeronezi @hsato03 are all your concerns met here?

@hsato03 hsato03 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

IMO, using ConsoleProxySslEnabled.value(); directly is better than using the config key to get the value. But lgtm.

@yadvr
yadvr merged commit 313a165 into apache:4.19 Jun 21, 2024
@DaanHoogland
DaanHoogland deleted the 4.19-add-globalsetting-sslenabled branch June 21, 2024 11:22
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

7 participants