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: replace namespace of configMaps and roleBindings #646

Merged
merged 1 commit into from
Aug 30, 2023

Conversation

ksimon1
Copy link
Member

@ksimon1 ksimon1 commented Aug 8, 2023

What this PR does / why we need it:
feat: replace namespace of configMaps and roleBindings

When ssp CR contains defined spec.tektonPipelines.namespace attribute, it should replace kubevirt.io/deploy-namespace annotation (currently used only for configMaps and roleBindings in example tekton pipelines). So when user decides to deploy pipelines to different namespace, the pipeline will be able to pick up correct configMap and roleBinding.

Which issue(s) this PR fixes:
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2229903

Release note:

feat: replace namespace of configMaps and roleBindings in tekton pipelines

When ssp CR contains defined spec.tektonPipelines.namespace attribute,
it should replace kubevirt.io/deploy-namespace annotation (currently
used only for configMaps and roleBindings in example tekton pipelines).
So when user decides to deploy pipelines to different namespace, the
pipeline will be able to pick up correct configMap and roleBinding.

fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2229903
Signed-off-by: Karel Simon <ksimon@redhat.com>
@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Aug 8, 2023
@sonarcloud
Copy link

sonarcloud bot commented Aug 8, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

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

No Coverage information No Coverage information
0.0% 0.0% Duplication

@ksimon1
Copy link
Member Author

ksimon1 commented Aug 9, 2023

/retest

@akrejcir
Copy link
Collaborator

akrejcir commented Aug 9, 2023

/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 9, 2023
@@ -89,7 +89,7 @@ func (t *tektonPipelines) Reconcile(request *common.Request) ([]common.Reconcile
return nil, nil
}
if !request.CrdList.CrdExists(tektonCrd) {
return nil, fmt.Errorf("Tekton CRD %s does not exist", tektonCrd)
return nil, fmt.Errorf("tekton CRD %s does not exist", tektonCrd)
Copy link
Member

Choose a reason for hiding this comment

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

nit: necessary change?

for i := range configMaps {
configMap := &configMaps[i]
funcs = append(funcs, func(request *common.Request) (common.ReconcileResult, error) {
if value, ok := configMap.Annotations[deployNamespaceAnnotation]; ok {
configMap.Namespace, userDefinedNamespace = getTektonPipelinesNamespace(request)
if value, ok := configMap.Annotations[deployNamespaceAnnotation]; ok && !userDefinedNamespace {
Copy link
Member

Choose a reason for hiding this comment

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

Is this required to keep compatibility with namespace annotations?

@0xFelix
Copy link
Member

0xFelix commented Aug 9, 2023

/approve

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 0xFelix

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

The pull request process is described 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

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 9, 2023
@akrejcir
Copy link
Collaborator

/retest

@openshift-ci
Copy link

openshift-ci bot commented Aug 17, 2023

@ksimon1: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/win2k22-pipeline-example-test 10d92f0 link true /test win2k22-pipeline-example-test
ci/prow/win11-pipeline-example-test 10d92f0 link true /test win11-pipeline-example-test
ci/prow/win10-pipeline-example-test 10d92f0 link true /test win10-pipeline-example-test

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.

@jcanocan
Copy link
Contributor

This PR is blocked by CI issue. IMHO we can force merge it without tests.

@lyarwood
Copy link
Member

Agreed we can /override here.

@ksimon1 ksimon1 merged commit 1f00d38 into kubevirt:main Aug 30, 2023
4 checks passed
@ksimon1
Copy link
Member Author

ksimon1 commented Aug 30, 2023

/cherrypick release-v0.18

@kubevirt-bot
Copy link
Contributor

@ksimon1: new pull request created: #671

In response to this:

/cherrypick release-v0.18

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants