@@ -16,14 +16,14 @@ import (
1616
1717// write performs a dual write according to the passed rule
1818func write (ctx context.Context , w http.ResponseWriter , r * rules.RunnableRule , input * rules.ResolveInput , workflowClient * client.Client ) error {
19- writeRels := make ([]* v1.Relationship , 0 , len (r .Writes ))
20- for _ , write := range r .Writes {
19+ updateRels := make ([]* v1.Relationship , 0 , len (r .Updates ))
20+ for _ , write := range r .Updates {
2121 write := write
2222 rel , err := rules .ResolveRel (write , input )
2323 if err != nil {
2424 return fmt .Errorf ("unable to resolve write rule (%v): %w" , rel , err )
2525 }
26- writeRels = append (writeRels , & v1.Relationship {
26+ updateRels = append (updateRels , & v1.Relationship {
2727 Resource : & v1.ObjectReference {
2828 ObjectType : rel .ResourceType ,
2929 ObjectId : rel .ResourceID ,
@@ -59,7 +59,7 @@ func write(ctx context.Context, w http.ResponseWriter, r *rules.RunnableRule, in
5959 preconditions = append (preconditions , p )
6060 }
6161
62- resp , err := dualWrite (ctx , workflowClient , input , writeRels , preconditions , r .LockMode )
62+ resp , err := dualWrite (ctx , workflowClient , input , updateRels , preconditions , r .LockMode )
6363 if err != nil {
6464 return fmt .Errorf ("dual write failed: %w" , err )
6565 }
@@ -82,7 +82,7 @@ func write(ctx context.Context, w http.ResponseWriter, r *rules.RunnableRule, in
8282// getWriteRule returns the first matching rule with `write` defined
8383func getWriteRule (matchingRules []* rules.RunnableRule ) * rules.RunnableRule {
8484 for _ , r := range matchingRules {
85- if len (r .Writes ) > 0 {
85+ if len (r .Updates ) > 0 {
8686 // we can only do one dual-write per request without some way of
8787 // marking some writes async.
8888 return r
@@ -93,13 +93,13 @@ func getWriteRule(matchingRules []*rules.RunnableRule) *rules.RunnableRule {
9393
9494// dualWrite configures the dtx for writing to kube and spicedb and waits for
9595// the response
96- func dualWrite (ctx context.Context , workflowClient * client.Client , input * rules.ResolveInput , rels []* v1.Relationship , preconditions []* v1.Precondition , lockMode proxyrule.LockMode ) (* distributedtx.KubeResp , error ) {
96+ func dualWrite (ctx context.Context , workflowClient * client.Client , input * rules.ResolveInput , updateRels []* v1.Relationship , preconditions []* v1.Precondition , lockMode proxyrule.LockMode ) (* distributedtx.KubeResp , error ) {
9797 writeInput := & distributedtx.WriteObjInput {
9898 RequestInfo : input .Request ,
9999 UserInfo : input .User ,
100100 Body : input .Body ,
101101 Header : input .Headers ,
102- Rels : rels ,
102+ UpdateRels : updateRels ,
103103 Preconditions : preconditions ,
104104 }
105105 if input .Object != nil {
0 commit comments