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

feat: validate kubeconfig and save clusters #3148

Merged
merged 113 commits into from
Jun 2, 2023
Merged

feat: validate kubeconfig and save clusters #3148

merged 113 commits into from
Jun 2, 2023

Conversation

ShashwatDadhich
Copy link
Contributor

@ShashwatDadhich ShashwatDadhich commented Mar 21, 2023

Description

Developed two nwe apis

  • To validate the provided kubeconfig
  • To save multiple clusters that have been validated

Fixes #852

How Has This Been Tested?

  • Test locally
  • Tested by deploying it to a vm

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR requires documentation updates?
  • I've updated documentation as required by this PR.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have tested it for all user roles.
  • I have added all the required unit/api test cases.x

//}

// RBAC enforcer applying
if ok := impl.enforcer.Enforce(token, casbin.ResourceCluster, casbin.ActionCreate, "*"); !ok {
Copy link
Member

Choose a reason for hiding this comment

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

this should be superadmin check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok doing that

}
result := []cluster.ClusterBean{}
for _, bean := range beans {
res, err := impl.clusterService.Save(ctx, &bean, userId)
Copy link
Member

Choose a reason for hiding this comment

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

we should not call our own service within orchestrator with token

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok sure

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jun 2, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 7 Code Smells

No Coverage information No Coverage information
5.9% 5.9% Duplication

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.

feat: Add cluster UI changes and fetch Cluster from KubeConfig File
4 participants