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

WIP: Add minimal sanitization for applylib #3520

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

justinsb
Copy link
Contributor

No description provided.

@justinsb justinsb changed the title Add minimal sanitization for applylib WIP: Add minimal sanitization for applylib Aug 30, 2022
@justinsb
Copy link
Contributor Author

cc @apelisse ... I'm wondering if this sanitization should be in client-go? And maybe we should URL-escape path components? Without this I got a cryptic error:

W0830 09:55:50.497538 3069319 applyset.go:130] error from apply on porch.kpt.dev/v1alpha1, Kind=PackageRevision default/infra/gkecluster-environment-packagename: error from apply: the server could not find the requested resource
I0830 09:55:50.497699 3069319 request.go:1073] Request Body: {"kind":"PackageRevision","apiVersion":"porch.kpt.dev/v1alpha1","metadata":{"name":"infra/configcontroller-environment-packagename","namespace":"default",...
I0830 09:55:50.497803 3069319 round_trippers.go:463] PATCH https://34.70.82.72/apis/porch.kpt.dev/v1alpha1/namespaces/default/packagerevisions/infra/configcontroller-environment-packagename?fieldManager=klippy-default-deployment-3afc33326786e6002aead189fc8e5cdf53861662&force=true
I0830 09:55:50.497818 3069319 round_trippers.go:469] Request Headers:
I0830 09:55:50.497838 3069319 round_trippers.go:473]     User-Agent: controllers/v0.0.0 (linux/amd64) kubernetes/$Format
I0830 09:55:50.497855 3069319 round_trippers.go:473]     Accept: application/json
I0830 09:55:50.497872 3069319 round_trippers.go:473]     Content-Type: application/apply-patch+yaml
I0830 09:55:50.581283 3069319 round_trippers.go:574] Response Status: 404 Not Found in 83 milliseconds
I0830 09:55:50.581316 3069319 round_trippers.go:577] Response Headers:
...
I0830 09:55:50.581507 3069319 request.go:1073] Response Body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"the server could not find the requested resource","reason":"NotFound","details":{},"code":404}

/assign @apelisse

@apelisse
Copy link

So you get a 404 when you specify the wrong name? That's not too bad, especially since on POST (create), the name is not part of the URL so this will fail to create with a proper error I would guess?

@apelisse
Copy link

For server-side apply that's a different story though since you can create through patch.

@apelisse
Copy link

@apelisse
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants