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

Fix to deploy TektonHub in custom namespace #1865

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

pratap0007
Copy link
Contributor

@pratap0007 pratap0007 commented Nov 21, 2023

Changes

This will add the fix for targetnamespace deletion
it will delete the namespace only if namespace contains
ownerreference of same reconcilation

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

Release Notes

Fix targetnamespace deletion of Tekton Hub

@tekton-robot tekton-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Nov 21, 2023
@tekton-robot tekton-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 21, 2023
@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-operator-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/common/targetnamespace.go 86.4% 89.3% 2.8

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

@tekton-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vdemeester

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

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 22, 2023
@jkandasa
Copy link
Member

/hold
@vdemeester @pratap0007 we are keeping only targetNamespace and deleting all other namespaces which has labels that matches to targetNamespace, Those was used as target namespace.

With this PR we are removing the deletion part completely. I need sometime to verify this change.

Thanks for the PR @pratap0007

@tekton-robot tekton-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 22, 2023
@pratap0007
Copy link
Contributor Author

/hold @vdemeester @pratap0007 we are keeping only targetNamespace and deleting all other namespaces which has labels that matches to targetNamespace, Those was used as target namespace.

With this PR we are removing the deletion part completely. I need sometime to verify this change.

Thanks for the PR @pratap0007

why do we want to delete all other namespaces other than targetNamespace ?

@pratap0007 pratap0007 force-pushed the fix-tknhub-ns branch 2 times, most recently from 4632397 to 9290eba Compare January 22, 2024 09:42
@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-operator-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/common/targetnamespace.go 86.4% 89.3% 2.8

@pratap0007 pratap0007 force-pushed the fix-tknhub-ns branch 3 times, most recently from 4f3fc26 to d18c7ef Compare February 6, 2024 20:30
@pratap0007
Copy link
Contributor Author

/remove-hold

@tekton-robot tekton-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 7, 2024
@tekton-robot tekton-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 7, 2024
ObjectMeta: metav1.ObjectMeta{
Name: th.Spec.TargetNamespace,
},
}
Copy link
Member

Choose a reason for hiding this comment

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

I think we need to add the ownerRef as well
cc @jkandasa @piyush-garg

@tekton-robot tekton-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 7, 2024
"targetNamespace", th.Spec.GetTargetNamespace(),
err,
)
tc, _ := r.operatorClientSet.OperatorV1alpha1().TektonConfigs().Get(ctx, v1alpha1.ConfigResourceName, metav1.GetOptions{})
Copy link
Member

Choose a reason for hiding this comment

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

I still feel this would not work when TektonConfig is nil

Copy link
Contributor Author

Choose a reason for hiding this comment

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

can you please explain the case when TektonConfig could be nil, so I can check once this ?

Copy link
Member

Choose a reason for hiding this comment

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

Meaning TektonHub is independent of TekttonConfig, so ideally we should not check for the namespace of TektonConfig, we can directly check if the namespace mentioned in TektonHub is present or not and based on that we can directly create that

For ref: 51fff50#diff-1c3da4772ce1a38a45935ea0814741d91d7803c96d9aef2b0f10b00f6d8b33f3L864-L875

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, thank you

@pratap0007 pratap0007 force-pushed the fix-tknhub-ns branch 2 times, most recently from c075649 to 5ddd585 Compare February 8, 2024 03:37
@tekton-robot tekton-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 8, 2024
This will add the fix for targetnamespace deletion
it will delete the namespace only if namespace contains
ownerreference of same reconcilation

Signed-off-by: Shiv Verma<[email protected]>
@tekton-robot tekton-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 8, 2024
@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-operator-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/common/targetnamespace.go 86.4% 86.9% 0.4

@jkandasa
Copy link
Member

jkandasa commented Feb 8, 2024

/test pull-tekton-operator-integration-tests

@jkandasa
Copy link
Member

jkandasa commented Feb 8, 2024

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 8, 2024
@tekton-robot tekton-robot merged commit 223708d into tektoncd:main Feb 8, 2024
8 checks passed
@pratap0007
Copy link
Contributor Author

/cherry-pick release-v0.69.x

@tekton-robot
Copy link
Contributor

@pratap0007: new pull request created: #2050

In response to this:

/cherry-pick release-v0.69.x

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. 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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants