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
[release-4.15] MULTIARCH-4084: Reduce the policy access scope to specific instance #3459
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Neha-dot-Yadav 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 |
1e9098a
to
cb52fc3
Compare
@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:
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. |
cb52fc3
to
f37164e
Compare
/assign @dharaneeshvrd |
275e1fb
to
2d5db05
Compare
/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 { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
cmd/infra/powervs/destroy.go
Outdated
@@ -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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func deleteSecrets(name, namespace, CloudInstanceID string, accountID string, resourceGroupID string) error { | |
func deleteSecrets(name, namespace, cloudInstanceID string, accountID string, resourceGroupID string) error { |
cmd/infra/powervs/service_id.go
Outdated
@@ -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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
2d5db05
to
be491bf
Compare
@Neha-dot-Yadav: No Jira issue is referenced in the title of this pull request. In response to this:
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: 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: 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:
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: 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:
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. |
This is a cherry-pick of #3491