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

Not list configmaps in all namespaces #1357

Merged
merged 1 commit into from
Aug 22, 2023

Conversation

piyush-garg
Copy link
Member

@piyush-garg piyush-garg commented Aug 1, 2023

This commit makes the changes to detect pac installation only in
default namespace i.e. pipelines-as-cdoe and openshift-pipelines
or other if provided by user through --pac-namespace flag

This makes the tkn pac create repo command usable for
non-admin users too

But on the other side, it will be a breaking change for admin users
who have pac installed in some other namespace and were
using the commands without pac-namespace flag till now

It will affect tkn pac create repo, tkn pac bootstrap and
tkn pac webhook add commands for users who had permissions till now
and were not using --pac-namespace flag

Submitter Checklist

  • ♽ Run make test before submitting a PR (ie: with pre-commit, no need to waste CPU cycle on CI. (or even better install pre-commit and do pre-commit install in the root of this repo).
  • ✨ We heavily rely on linters to get our code clean and consistent, please ensure that you have run make lint before submitting a PR. The markdownlint error can get usually fixed by running make fix-markdownlint (make sure it's installed first)
  • 📖 If you are adding a user facing feature or make a change of the behavior, please verify that you have documented it
  • 🧪 100% coverage is not a target but most of the time we would rather have a unit test if you make a code change.
  • 🎁 If that's something that is possible to do please ensure to check if we can add a e2e test.
  • 🔎 If there is a flakiness in the CI tests then don't necessary ignore it, better get the flakyness fixed before merging or if that's not possible there is a good reason to bypass it. (token rate limitation may be a good reason to skip).

@piyush-garg piyush-garg changed the title Not list confgimaps in all namespaces Not list configmaps in all namespaces Aug 1, 2023
}
}
return installed, "", fmt.Errorf("could not detect Pipelines as Code configmap on the cluster, please reinstall")
if configMap == nil {
return nil, fmt.Errorf("ConfigMap not found in default namespaces")
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
return nil, fmt.Errorf("ConfigMap not found in default namespaces")
return nil, fmt.Errorf("ConfigMap not found in default namespaces("openshift-pipelines", "pipelines-as-code")

or something

because the word default namespaces conflict with actual k8s/openshift default ns

@chmouel
Copy link
Member

chmouel commented Aug 9, 2023

i don't think there is people (that i know) that runs pac in other namespace than openshift/pipelines-as-code so that's fine

@chmouel chmouel force-pushed the main branch 6 times, most recently from cb88d0e to 7260744 Compare August 22, 2023 10:11
@piyush-garg
Copy link
Member Author

/retest

@chmouel
Copy link
Member

chmouel commented Aug 22, 2023

/retest would not rebase the commit, i clicked on the update branch button for you....

@codecov
Copy link

codecov bot commented Aug 22, 2023

Codecov Report

Merging #1357 (00d3fb1) into main (2eab30c) will increase coverage by 0.21%.
Report is 7 commits behind head on main.
The diff coverage is 93.02%.

@@            Coverage Diff             @@
##             main    #1357      +/-   ##
==========================================
+ Coverage   60.73%   60.94%   +0.21%     
==========================================
  Files         136      136              
  Lines        9916     9929      +13     
==========================================
+ Hits         6022     6051      +29     
+ Misses       3411     3394      -17     
- Partials      483      484       +1     
Files Changed Coverage Δ
pkg/cmd/tknpac/bootstrap/kubestuff.go 16.66% <ø> (ø)
pkg/formatting/age.go 100.00% <ø> (ø)
pkg/params/settings/config.go 53.84% <ø> (ø)
pkg/cmd/tknpac/bootstrap/bootstrap.go 20.74% <86.95%> (+16.12%) ⬆️
pkg/cmd/tknpac/resolve/resolve.go 65.21% <100.00%> (+0.19%) ⬆️
pkg/matcher/annotation_matcher.go 95.33% <100.00%> (-0.10%) ⬇️
pkg/matcher/annotation_tasks_install.go 77.65% <100.00%> (ø)
pkg/resolve/resolve.go 78.48% <100.00%> (ø)

This commit makes the changes to detect pac installation only in
default namespace i.e. pipelines-as-cdoe and openshift-pipelines
or other if provided by user through --pac-namespace flag

This makes the tkn pac create repo command usable for
non-admin users too

But on the other side, it will be a breaking change for admin users
who have pac installed in some other namespace and were
using the commands without pac-namespace flag till now

It will affect tkn pac create repo, tkn pac bootstrap and
tkn pac webhook add commands for users who had permissions till now
and were not using --pac-namespace flag
@chmouel chmouel merged commit 8bd7be7 into openshift-pipelines:main Aug 22, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants