Skip to content

Instantly share code, notes, and snippets.

@Vyom-Yadav
Last active October 19, 2022 07:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Vyom-Yadav/26bc32d641c2946f9d81ed85edd0f13a to your computer and use it in GitHub Desktop.
Save Vyom-Yadav/26bc32d641c2946f9d81ed85edd0f13a to your computer and use it in GitHub Desktop.
Subresources Validation Flowchart

LFX Mentorship Fall 2022

More support for subresources

flowchart TB
subgraph ide1 [policy/validate.go]
    A["validateKinds(..), Background scanning not allowed for subresources"]
end
subgraph ide2 [dclient/discovery.go]
    A --> C["FindResource(..)"] --- D["Iterate over server resources, support for subresources added"]
end
subgraph ide3 [policycache/cache.go]
    E["Adds policy to the cache store"] --- F["Set(..., client dclient.Interface)"] -- policy matches subresources --> C
end
ide1 --> G["Updating ValidatingWebhookConfiguration"] --> H{{Now Requests matching the webhook are accepted}} --> I[Get policies based on the Kind of Subresource] -...-> ide4
subgraph ide4 [engine/utils.go]
    J["checkKind(client dclient.Interface, ....)"] -- policy matches subresources --> C
end
ide4 --> K["Process Validation Rule"]
K --> L[Pass]
K --> M[Fail]
style L fill:green
style M fill:red
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment