brigadecore / brigade

Event-driven scripting for Kubernetes
https://brigade.sh/
Apache License 2.0
2.4k stars 247 forks source link

fix role/project-role grant/revoke bug #1805

Closed krancour closed 2 years ago

krancour commented 2 years ago

This bug was introduced in #1796 and only exists in main and has not ever been released.

In #1796, PrincipalReference objects where returned as a "top level" object in an API response for the first time and to match everything else "top level" in the API, we started augmenting them with APIVersion and Kind when marshaling to JSON.

For consistency, outbound PrincipalReference objects from the SDK got the same treatment, even though they're never used as "top level" objects on an outbound request. But the existing JSON schema used to validate inbound requests doesn't permit those fields there.

I considered updating the schema to make those fields optional for a PrincipalReference, but the result would be that newer clients that include this info in and outbound PrincipalReference would have trouble with older API servers that don't have the new schema.

The option we have to settle for is not including this information in outbound PrincipalReference objects, same as before #1796.

netlify[bot] commented 2 years ago

✔️ Deploy Preview for brigade-docs ready!

🔨 Explore the source changes: fe63ea7227e7be7519f5961cf76e48d487f98c7f

🔍 Inspect the deploy log: https://app.netlify.com/sites/brigade-docs/deploys/620165733adc89000716c480

😎 Browse the preview: https://deploy-preview-1805--brigade-docs.netlify.app