Skip to content

[WIP] Add Mtls patch to Mutating Webhook #508

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

Closed
wants to merge 5 commits into from

Conversation

Bobbins228
Copy link
Contributor

Issue link

What changes have been made

Verification steps

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • Testing is not required for this change

Sorry, something went wrong.

Copy link

openshift-ci bot commented Apr 11, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign tedhtchang for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

svcDomain := rayCluster.Name + "-head-svc." + rayCluster.Namespace + ".svc"
secretName := `ca-secret-` + rayCluster.Name
fmt.Println("Start")
domain, err := getDomainName()

Choose a reason for hiding this comment

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

We know the error starts here.

func getDomainName() (string, error) {
consoleRoute := &routev1.Route{}
fmt.Println("1")
fmt.Printf(client.ObjectKey{Name: NameConsoleLink, Namespace: NamespaceConsoleLink}.String())

Choose a reason for hiding this comment

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

and that this technically works, which I suppose isn't terribly shocking.

fmt.Println("2")
fmt.Printf(consoleRoute.String())

if err := k8Client.Get(context.TODO(), types.NamespacedName{Name: NameConsoleLink, Namespace: NamespaceConsoleLink}, consoleRoute); err != nil {

Choose a reason for hiding this comment

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

But this fails.

So, something is misbehaving into this .Get().

  1. It's probably not the context.TODO()
  2. I think we fixed the types.NamespacedName Struct but we should definitely try to confirm that.
  3. The consoleRoute seemed reasonable from what I recall as that was the object that was passed to be updated.

We should definitely confirm these 3 things though and I'd dig into them slightly differently.

Copy link
Contributor

Choose a reason for hiding this comment

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

What is the error?
Do you run the container locally, connecting to the remote OpenShift cluster, or directly as a Deployment on the cluster?
If the latter, I see that you doesn't provide RBAC for accessing Routes - https://github.com/project-codeflare/codeflare-operator/pull/508/files#diff-d44acd75643a4ccbb2ddc671e641c9f520d495dbc01fe1dbcf305bd4c13915d9R53-R61

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sutaakar This was the error we were receiving. I will update RBAC:
no kind is registered for the type v1.Route in scheme "go/pkg/mod/k8s.io/[email protected]/pkg/runtime/scheme.go:100"

@zdtsw
Copy link
Contributor

zdtsw commented Apr 13, 2024

not sure which one need review either #507 or #508 ? or none 😱
better remove [WIP] / "draft" and have the other one closed.

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.

None yet

5 participants