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

Powerflex pre-approved GUIDs #208

Closed
wants to merge 2 commits into from
Closed

Powerflex pre-approved GUIDs #208

wants to merge 2 commits into from

Conversation

ashleyvjoy
Copy link
Contributor

@ashleyvjoy ashleyvjoy commented Jan 27, 2023

Description

  • The sdcApproveHandler will allow/deny approve SDC request coming from driverside to the powerflex array based on the Tenant data
  • A new approvesdc boolean flag(default value is true) is added to karavictl tenant create
  • A new karavictl tenant update command to update the approvesdc flag value
  • karavictl tenant get updated

GitHub Issues

List the GitHub issues impacted by this PR:

| GitHub Issue # |
| dell/csm#402 |

Checklist:

  • I have performed a self-review of my own code to ensure there are no formatting, vetting, linting, or security issues
  • I have verified that new and existing unit tests pass locally with my changes
  • I have not allowed coverage numbers to degenerate
  • I have maintained at least 90% code coverage
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Backward compatibility is not broken

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration

  • Test A

  • Test B

sdcnotapprtenantfalsedrivertrue

sdcnotapprtenanttruedrivertrueproxylogs

tenantgetflagfalse

tenantupdateflagtrue

logs.txt

@csmbot
Copy link
Collaborator

csmbot commented Jan 27, 2023

Can one of the admins verify this patch?

Copy link
Collaborator

@sharmilarama sharmilarama left a comment

Choose a reason for hiding this comment

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

Move merge target from main to a holding branch for 1.6, until patch release is in progress.

cmd/karavictl/cmd/tenant_update.go Outdated Show resolved Hide resolved
cmd/karavictl/cmd/tenant_update.go Show resolved Hide resolved
cmd/karavictl/cmd/tenant_update_test.go Show resolved Hide resolved
internal/tenantsvc/service.go Outdated Show resolved Hide resolved
internal/sdc/sdc_approve.go Show resolved Hide resolved
policies/sdc_approve.rego Outdated Show resolved Hide resolved
}
defer r.Body.Close()

var requestBody map[string]json.RawMessage
Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't look like the requestBody is used or modified in this handler. If we're not doing that, we don't need to read it.

Copy link
Contributor

Choose a reason for hiding this comment

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

On a second look, we are doing this in other handler so it's ok to leave this. We will have the request body ready for the future incase we need to modify it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay. Left this


// ApproveSdcField returns the redis formatted approved capacity field.
func (r Request) ApproveSdcField() string {
return "Approvesdc"
Copy link
Contributor

@atye atye Feb 17, 2023

Choose a reason for hiding this comment

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

The existing fields in Redis are lowercase with underscores. Can this be changed to approve_sdc?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

cmd/karavictl/cmd/tenant.go Outdated Show resolved Hide resolved
internal/tenantsvc/service.go Outdated Show resolved Hide resolved
@@ -0,0 +1,78 @@
// Copyright © 2021-2023 Dell Inc., or its subsidiaries. All Rights Reserved.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove 2021

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -0,0 +1,165 @@
// Copyright © 2021-2023 Dell Inc., or its subsidiaries. All Rights Reserved.
Copy link
Collaborator

Choose a reason for hiding this comment

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

same comment as above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -0,0 +1,32 @@
// Copyright © 2021-2023 Dell Inc., or its subsidiaries. All Rights Reserved.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove 2021

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -0,0 +1,130 @@
// Copyright © 2021-2023 Dell Inc., or its subsidiaries. All Rights Reserved.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove 2021

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -0,0 +1,177 @@
// Copyright © 2021-2023 Dell Inc., or its subsidiaries. All Rights Reserved.
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove 2021

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@ashleyvjoy ashleyvjoy marked this pull request as ready for review February 20, 2023 13:01
@ashleyvjoy ashleyvjoy changed the base branch from main to release-v1.6.0 February 20, 2023 13:47
IsaiasA1
IsaiasA1 previously approved these changes Feb 20, 2023
ans, err := decision.Can(func() decision.Query {
return decision.Query{
Host: opaHost,
// TODO(ian): This will need to be namespaced under "powerflex".
Copy link
Collaborator

Choose a reason for hiding this comment

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

can this comment be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


// Request is a request to redis.
type Request struct {
//SystemID string `json:"systemId"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

if systemID isn't required here, can it be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -0,0 +1,26 @@
package karavi.sdc.approve
Copy link
Collaborator

Choose a reason for hiding this comment

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

are there plans to add this new sdc-approve policy to the helm-charts and csm operator authorization deployments?

Copy link
Contributor Author

@ashleyvjoy ashleyvjoy Feb 21, 2023

Choose a reason for hiding this comment

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

Added the support in helm-charts and csm-operator

sharmilarama
sharmilarama previously approved these changes Feb 27, 2023
@prablr79
Copy link

@coulof @bjiang27 @xuluna need your quick approval, since all the test are passed. see if you can approve this PR.

Copy link
Collaborator

@coulof coulof left a comment

Choose a reason for hiding this comment

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

Giving an approval per request but I'm not qualified to audit the code.

internal/tenantsvc/service.go Outdated Show resolved Hide resolved
cmd/karavictl/cmd/tenant.go Show resolved Hide resolved
@prablr79
Copy link

@ashleyvjoy @khareRajshree can you quickly update and revert ?

@ashleyvjoy
Copy link
Contributor Author

@ashleyvjoy @khareRajshree can you quickly update and revert ?

The variable name is self explanatory in the context of the function and Novus had already reviewed it. Regarding the copyright on the tenant.go file, can raise a new PR for copyright update without affecting the progress of this PR. Discussed it with Bharat

@@ -13,7 +13,7 @@
# limitations under the License.

ARCH=amd64
SIDECAR_DOCKER_TAG=1.5.1
SIDECAR_DOCKER_TAG=nightly
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this need to change to 1.6.0?

Copy link
Contributor Author

@ashleyvjoy ashleyvjoy Feb 28, 2023

Choose a reason for hiding this comment

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

The last information I got from Novus yesterday was that to keep that as nightly

Copy link
Collaborator

Choose a reason for hiding this comment

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

that will be addressed in another PR

@sharmilarama
Copy link
Collaborator

run e2e test

@dell dell deleted a comment from shaynafinocchiaro Feb 28, 2023
@dell dell deleted a comment from atye Feb 28, 2023
@alikdell
Copy link
Collaborator

run e2e test

@atye atye closed this Feb 28, 2023
@atye atye reopened this Feb 28, 2023
@atye atye closed this Feb 28, 2023
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.