Skip to content

CKS: check access when get kubernetescluster config#7854

Merged
weizhouapache merged 1 commit intoapache:4.18from
weizhouapache:4.18-fix-access-get-kubernetesclusterconfig
Aug 14, 2023
Merged

CKS: check access when get kubernetescluster config#7854
weizhouapache merged 1 commit intoapache:4.18from
weizhouapache:4.18-fix-access-get-kubernetesclusterconfig

Conversation

@weizhouapache
Copy link
Copy Markdown
Member

Description

This PR fixes #7618

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)

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?

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 11, 2023

Codecov Report

Merging #7854 (1e2446a) into 4.18 (feb9509) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

@@             Coverage Diff              @@
##               4.18    #7854      +/-   ##
============================================
- Coverage     13.02%   13.02%   -0.01%     
  Complexity     9032     9032              
============================================
  Files          2720     2720              
  Lines        257080   257082       +2     
  Branches      40088    40088              
============================================
  Hits          33476    33476              
- Misses       219400   219402       +2     
  Partials       4204     4204              
Files Changed Coverage Δ
...bernetes/cluster/KubernetesClusterManagerImpl.java 4.40% <0.00%> (-0.01%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Copy Markdown
Member

@yadvr yadvr left a comment

Choose a reason for hiding this comment

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

LGTM, haven't tested it

@weizhouapache
Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@weizhouapache a [SF] 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 6752

Copy link
Copy Markdown
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

clgtm

@weizhouapache
Copy link
Copy Markdown
Member Author

@blueorangutan test rocky8 kvm-rocky8

@blueorangutan
Copy link
Copy Markdown

@weizhouapache a [SF] Trillian-Jenkins test job (rocky8 mgmt + kvm-rocky8) has been kicked to run smoke tests

@blueorangutan
Copy link
Copy Markdown

[SF] Trillian test result (tid-7388)
Environment: kvm-rocky8 (x2), Advanced Networking with Mgmt server r8
Total time taken: 44874 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7854-t7388-kvm-rocky8.zip
Smoke tests completed. 108 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@weizhouapache
Copy link
Copy Markdown
Member Author

@kiranchavala
can you please test it ? thanks

Copy link
Copy Markdown
Member

@kiranchavala kiranchavala left a comment

Choose a reason for hiding this comment

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

LGTM, Manually tested the scenario and its working fine

1. Create an account of role type user (Let's say Account 1 > User1)

2. Login as user 1 > Launch a k8s cluster

3. Execute API call with user 1 API key and secret key
https://cloudstack.apache.org/api/apidocs-4.18/apis/getKubernetesClusterConfig.html

get  Kubernetes clusters access infomation

Able to get the output of the API call (including the Kubernetes cluster config)

4. Create an account of role type user ( Lets say Account 2> User2)

5. Execute API call with user 2 API key and secret key and k8s cluster's ID get from User1 

https://cloudstack.apache.org/api/apidocs-4.18/apis/getKubernetesClusterConfig.html

Get Kubernetes clusters access infomation

Not Able to get the output of the API call (including the Kubernetes cluster config)

(cmk)  > get kubernetesclusterconfig id=63017ee0-b9eb-4650-9209-a16eb9dd2dba
 Error: (HTTP 530, error code 9999) Account [{"accountName":"kiran","id":5,"uuid":"214277d9-08c2-4384-a7ff-1ffee34e2d97"}] does not have permission to operate with resource

@weizhouapache
Copy link
Copy Markdown
Member Author

  1. Execute API call with user 2 API key and secret key and k8s cluster's ID get from User1

thanks @kiranchavala for the testing

merging

@weizhouapache weizhouapache merged commit bf9c714 into apache:4.18 Aug 14, 2023
@weizhouapache weizhouapache deleted the 4.18-fix-access-get-kubernetesclusterconfig branch August 25, 2023 13:25
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.

Get All Access Info Of a Cluster Kubernetes Through API Key's User

5 participants