Skip to content

[Chef-17] Fix error due to method name conflict in Azure Secrets Manager#14439

Merged
neha-p6 merged 2 commits intochef-17from
neha-p6/CHEF-8029_fix_azure_secret
Jul 23, 2024
Merged

[Chef-17] Fix error due to method name conflict in Azure Secrets Manager#14439
neha-p6 merged 2 commits intochef-17from
neha-p6/CHEF-8029_fix_azure_secret

Conversation

@neha-p6
Copy link
Copy Markdown
Collaborator

@neha-p6 neha-p6 commented Jun 12, 2024

Description

Rename object_id action in azure vault resource as it throws error due to conflict with default ruby method

/opt/chef/embedded/lib/ruby/gems/3.0.0/gems/chef-17.10.0/lib/chef/secret_fetcher/azure_key_vault.rb:91: warning: redefining `object_id' may cause serious problems
BODY: <?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml " xml:lang="en" lang="en">
 <head>
  <title>404 - Not Found</title>
 </head>
 <body>
  <h1>404 - Not Found</h1>
 </body>
</html>================================================================================
Recipe Compile Error in /root/.chef/local-mode-cache/cache/cookbooks/az_secretvault/recipes/default.rb
================================================================================JSON::ParserError
-----------------
859: unexpected token at '<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Related Issue

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (non-breaking change that does not add functionality or fix an issue)

Checklist:

  • I have read the CONTRIBUTING document.
  • I have run the pre-merge tests locally and they pass.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • If Gemfile.lock has changed, I have used --conservative to do it and included the full output in the Description above.
  • All new and existing tests passed.
  • All commits have been signed-off for the Developer Certificate of Origin.

@neha-p6 neha-p6 requested review from a team as code owners June 12, 2024 11:35
@neha-p6 neha-p6 changed the title [Chef-17] Fix error due to method name conflict in Azure Secrets Manager Jun 12, 2024
@neha-p6 neha-p6 force-pushed the neha-p6/CHEF-8029_fix_azure_secret branch from a8fc484 to 9c645fb Compare June 12, 2024 13:36
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud


def validate!
raise Chef::Exceptions::Secret::ConfigurationInvalid, "You may only specify one (these are mutually exclusive): :object_id, :client_id, or :mi_res_id" if [object_id, client_id, mi_res_id].count { |x| !x.nil? } > 1
raise Chef::Exceptions::Secret::ConfigurationInvalid, "You may only specify one (these are mutually exclusive): :config_object_id, :client_id, or :mi_res_id" if [object_id, client_id, mi_res_id].count { |x| !x.nil? } > 1
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

don't you need to change this one too.

Suggested change
raise Chef::Exceptions::Secret::ConfigurationInvalid, "You may only specify one (these are mutually exclusive): :config_object_id, :client_id, or :mi_res_id" if [object_id, client_id, mi_res_id].count { |x| !x.nil? } > 1
raise Chef::Exceptions::Secret::ConfigurationInvalid, "You may only specify one (these are mutually exclusive): :config_object_id, :client_id, or :mi_res_id" if [config_object_id, client_id, mi_res_id].count { |x| !x.nil? } > 1

Copy link
Copy Markdown
Collaborator

@jaymzh jaymzh left a comment

Choose a reason for hiding this comment

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

minor fix needed

@tpowell-progress tpowell-progress added the Status: Waiting on Contributor A pull request that has unresolved requested actions from the author. label Jun 25, 2024
neha-p6 added 2 commits July 23, 2024 18:00
…e to conflict with default ruby method

Signed-off-by: Neha Pansare <neha.pansare@progress.com>
Signed-off-by: Neha Pansare <neha.pansare@progress.com>
@neha-p6 neha-p6 force-pushed the neha-p6/CHEF-8029_fix_azure_secret branch from c31dc30 to 5793f5c Compare July 23, 2024 12:30
@sonarqubecloud
Copy link
Copy Markdown

@neha-p6
Copy link
Copy Markdown
Collaborator Author

neha-p6 commented Jul 23, 2024

Openssl 3.0.9 upgrade changes are yet to be merged to chef17, hence merging this PR with the failures in place (as they are about Openssl)

@neha-p6 neha-p6 merged commit b5bfde3 into chef-17 Jul 23, 2024
@neha-p6 neha-p6 deleted the neha-p6/CHEF-8029_fix_azure_secret branch July 23, 2024 13:20
@neha-p6 neha-p6 removed the Status: Waiting on Contributor A pull request that has unresolved requested actions from the author. label Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants