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

[release-4.15] MULTIARCH-4084: Reduce the policy access scope to specific instance #3459

Closed

Conversation

Neha-dot-Yadav
Copy link
Contributor

@Neha-dot-Yadav Neha-dot-Yadav commented Jan 24, 2024

This is a cherry-pick of #3491

@openshift-ci openshift-ci bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/needs-area labels Jan 24, 2024
@openshift-ci openshift-ci bot added the area/cli Indicates the PR includes changes for CLI label Jan 24, 2024
Copy link
Contributor

openshift-ci bot commented Jan 24, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Neha-dot-Yadav
Once this PR has been reviewed and has the lgtm label, please assign sjenning for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Neha-dot-Yadav Neha-dot-Yadav changed the title [WIP]Reduce the access scope to specific instance [WIP]MULTIARCH-4084: Reduce the access scope to specific instance Jan 27, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 27, 2024

@Neha-dot-Yadav: This pull request references MULTIARCH-4084 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.15.0" version, but no target version was set.

In response to this:

What this PR does / why we need it:
This PR reduces the permission access scope to Service Instance for various CRs.

Which issue(s) this PR fixes (optional, use fixes #<issue_number>(, fixes #<issue_number>, ...) format, where issue_number might be a GitHub issue, or a Jira story:
Fixes #https://issues.redhat.com/browse/MULTIARCH-4084

Checklist

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jan 27, 2024
@Neha-dot-Yadav Neha-dot-Yadav changed the title [WIP]MULTIARCH-4084: Reduce the access scope to specific instance MULTIARCH-4084: Reduce the access scope to specific instance Jan 29, 2024
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 29, 2024
@Neha-dot-Yadav
Copy link
Contributor Author

/assign @dharaneeshvrd

@Neha-dot-Yadav
Copy link
Contributor Author

/test e2e-aws

@@ -388,28 +384,43 @@ func (infra *Infra) SetupInfra(ctx context.Context, options *CreateInfraOptions)
return fmt.Errorf("cloud connection is not up: %w", err)
}

if err = infra.setupSecrets(options); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Please comment, why it needs to be after the resources created

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a comment,
please let me know if it is understandable?

@@ -218,6 +213,11 @@ func (options *DestroyInfraOptions) DestroyInfra(ctx context.Context, infra *Inf
}
}

if err = deleteSecrets(options.Name, options.Namespace, powerVsCloudInstanceID, accountID, resourceGroupID); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Any reason to move this after deleteCOS?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, deleteSecrets needs powerVsCloudInstanceID value, which it is getting from the code after deleteCOS.

@@ -302,14 +302,16 @@ func deleteDNSRecords(ctx context.Context, options *DestroyInfraOptions) error {
}

// deleteSecrets delete secrets generated for control plane components
func deleteSecrets(name, namespace, accountID string, resourceGroupID string) error {
func deleteSecrets(name, namespace, CloudInstanceID string, accountID string, resourceGroupID string) error {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
func deleteSecrets(name, namespace, CloudInstanceID string, accountID string, resourceGroupID string) error {
func deleteSecrets(name, namespace, cloudInstanceID string, accountID string, resourceGroupID string) error {

@@ -193,6 +203,10 @@ func extractServiceIDFromCRN(crn string) string {
return crnL[len(crnL)-1]
}

func updateCRYaml(crYaml, serviceInstanceValue string) string {
return fmt.Sprintf(crYaml, serviceInstanceValue)
Copy link
Member

Choose a reason for hiding this comment

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

Its good practice to use templating here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added the provision to use templating,
please let me know, if any further changes are required?

@Neha-dot-Yadav Neha-dot-Yadav changed the title MULTIARCH-4084: Reduce the access scope to specific instance Reduce the access scope to specific instance Jan 31, 2024
@openshift-ci-robot openshift-ci-robot removed the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jan 31, 2024
@openshift-ci-robot
Copy link

@Neha-dot-Yadav: No Jira issue is referenced in the title of this pull request.
To reference a jira issue, add 'XYZ-NNN:' to the title of this pull request and request another refresh with /jira refresh.

In response to this:

What this PR does / why we need it:
This PR reduces the permission access scope to Service Instance for various CRs.

Which issue(s) this PR fixes (optional, use fixes #<issue_number>(, fixes #<issue_number>, ...) format, where issue_number might be a GitHub issue, or a Jira story:
Fixes #https://issues.redhat.com/browse/MULTIARCH-4084

Checklist

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Copy link
Contributor

openshift-ci bot commented Jan 31, 2024

@Neha-dot-Yadav: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@Neha-dot-Yadav Neha-dot-Yadav changed the title Reduce the access scope to specific instance [release-4.15] MULTIARCH-4084: Reduce the policy access scope to specific instance Feb 6, 2024
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Feb 6, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Feb 6, 2024

@Neha-dot-Yadav: This pull request references MULTIARCH-4084 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.15.0" version, but no target version was set.

In response to this:

What this PR does / why we need it:
This PR reduces the permission access scope to Service Instance for various CRs.

Which issue(s) this PR fixes (optional, use fixes #<issue_number>(, fixes #<issue_number>, ...) format, where issue_number might be a GitHub issue, or a Jira story:
Fixes #https://issues.redhat.com/browse/MULTIARCH-4084

Checklist

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Feb 6, 2024

@Neha-dot-Yadav: This pull request references MULTIARCH-4084 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.15.0" version, but no target version was set.

In response to this:

This is a cherry-pick of #3491

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@Neha-dot-Yadav Neha-dot-Yadav deleted the svcid_scope_up branch February 6, 2024 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Indicates the PR includes changes for CLI jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants