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

[serverless-1.33] fix: PaC build #783

Merged
merged 2 commits into from
Jun 6, 2024
Merged

Conversation

matejvasek
Copy link
Collaborator

@matejvasek matejvasek commented Jun 6, 2024

  • Fixed detection of PaC controller URL for unprivileged users.
  • Use fn.Deploy.Image before fn.Image since the fn.Image may not be populated.

* 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>
@openshift-ci openshift-ci bot requested review from dsimansk and vyasgun June 6, 2024 15:45
@openshift-ci openshift-ci bot added the approved label Jun 6, 2024
@matejvasek matejvasek requested review from matzew, lkingland and jrangelramos and removed request for vyasgun June 6, 2024 15:46
@matejvasek
Copy link
Collaborator Author

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{})
Copy link
Collaborator Author

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.

Copy link
Member

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
Copy link
Collaborator Author

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.

Copy link
Collaborator Author

@matejvasek matejvasek Jun 6, 2024

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!

@matejvasek
Copy link
Collaborator Author

I added explanatory comments as to why each change is needed.

@jrangelramos
Copy link

/lgtm

@matejvasek
Copy link
Collaborator Author

matejvasek commented Jun 6, 2024

One caveat: this patch assumes that PaC is installed in openshift-pipelines, so it won't work on non-OCP clusters. I could fix this.
EDIT: I actually fixed that.

Signed-off-by: Matej Vašek <mvasek@redhat.com>
@openshift-ci openshift-ci bot removed the lgtm label Jun 6, 2024
@matzew
Copy link
Member

matzew commented Jun 6, 2024

this looks reasonable.

/lgtm

Are there some tests for this? Or do we have some other e2e tests /cc @jrangelramos

Copy link

openshift-ci bot commented Jun 6, 2024

[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:
  • OWNERS [jrangelramos,matejvasek,matzew]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@matejvasek
Copy link
Collaborator Author

/override "On Cluster Test (ubuntu-latest)"

Copy link

openshift-ci bot commented Jun 6, 2024

@matejvasek: Overrode contexts on behalf of matejvasek: On Cluster Test (ubuntu-latest)

In response to this:

/override "On Cluster Test (ubuntu-latest)"

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.

@matejvasek
Copy link
Collaborator Author

/override "On Cluster RT Test (ubuntu-latest, s2i)"

Copy link

openshift-ci bot commented Jun 6, 2024

@matejvasek: Overrode contexts on behalf of matejvasek: On Cluster RT Test (ubuntu-latest, s2i)

In response to this:

/override "On Cluster RT Test (ubuntu-latest, s2i)"

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.

@openshift-merge-bot openshift-merge-bot bot merged commit aa90e5e into serverless-1.33 Jun 6, 2024
19 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants