-
Is there any way how to get the event/binding context without running the operator? I just need to make up the jq filter and/or prepare the operation logic first. |
Beta Was this translation helpful? Give feedback.
Answered by
nabokihms
Mar 1, 2022
Replies: 1 comment
-
Hello @sl4dy. It feels like BindingContextGenerator is what you want. func Test_BindingContextGenerator_Print(t *testing.T) {
c := NewBindingContextController(`
configVersion: v1
kubernetes:
- apiVersion: v1
includeSnapshotsFrom:
- pods
kind: Pod
name: pods
`)
// Synchronization contexts
contexts, _ := c.Run(``)
fmt.Println("Sync: ", contexts.Rendered)
// Object added
contexts, _ = c.ChangeState(`
---
apiVersion: v1
kind: Pod
metadata:
name: pod1
`)
fmt.Println("Added: ", contexts.Rendered)
// Object deleted
contexts, _ = c.ChangeState(``)
fmt.Println("Deleted: ", contexts.Rendered)
} Response:
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
sl4dy
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello @sl4dy. It feels like BindingContextGenerator is what you want.
Response: