-
Notifications
You must be signed in to change notification settings - Fork 3
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
[serverless-1.33] fix: PaC build #783
Conversation
* Fixed detection of PaC controller URL for unprivileged users. * Use fn.Deploy.Image before fn.Image since the fn.Image may not be populated. Signed-off-by: Matej Vašek <matejvasek@gmail.com>
PTAL @dsimansk @lkingland @gauron99 |
@@ -36,7 +36,7 @@ func DetectPACInstallation(ctx context.Context, wantedNamespace string) (bool, s | |||
return false, "", err | |||
} | |||
|
|||
_, err = clientPac.Repositories("").List(ctx, metav1.ListOptions{}) | |||
_, err = clientPac.Repositories(cns).List(ctx, metav1.ListOptions{}) |
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.
rationale: unprivileged user most likely cannot scan all the namespaces, but they most likely can scan current namespace.
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.
ack
@@ -154,7 +154,12 @@ func (pp *PipelinesProvider) createClusterPACResources(ctx context.Context, f fn | |||
labels = pp.decorator.UpdateLabels(f, labels) | |||
} | |||
|
|||
registry, err := docker.GetRegistry(f.Image) | |||
img := f.Deploy.Image |
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.
rationale: f.Image
appears to be empty , f.Deploy.Image
appears to contain the desired value instead.
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.
This caused error for all users not only unprivileged ones!
I added explanatory comments as to why each change is needed. |
/lgtm |
One caveat: this patch assumes that PaC is installed in |
Signed-off-by: Matej Vašek <mvasek@redhat.com>
this looks reasonable. /lgtm Are there some tests for this? Or do we have some other e2e tests /cc @jrangelramos |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jrangelramos, matejvasek, matzew 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 |
/override "On Cluster Test (ubuntu-latest)" |
@matejvasek: Overrode contexts on behalf of matejvasek: On Cluster Test (ubuntu-latest) 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 kubernetes-sigs/prow repository. |
/override "On Cluster RT Test (ubuntu-latest, s2i)" |
@matejvasek: Overrode contexts on behalf of matejvasek: On Cluster RT Test (ubuntu-latest, s2i) 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 kubernetes-sigs/prow repository. |
aa90e5e
into
serverless-1.33
fn.Deploy.Image
beforefn.Image
since thefn.Image
may not be populated.