@@ -67,10 +67,10 @@ type IResource interface {
6767
6868 // [Optional] WaitAfterCreate waits for the resource to become ready after creation. Returns optionally updated remote state.
6969 // TODO: wait status should be persisted in the state.
70- WaitAfterCreate (ctx context.Context , newState any ) (remoteState any , e error )
70+ WaitAfterCreate (ctx context.Context , id string , newState any ) (remoteState any , e error )
7171
7272 // [Optional] WaitAfterUpdate waits for the resource to become ready after update. Returns optionally updated remote state.
73- WaitAfterUpdate (ctx context.Context , newState any ) (remoteState any , e error )
73+ WaitAfterUpdate (ctx context.Context , id string , newState any ) (remoteState any , e error )
7474
7575 // [Optional] KeyedSlices returns a map from path patterns to KeyFunc for comparing slices by key instead of by index.
7676 // Example: func (*ResourcePermissions) KeyedSlices(state *PermissionsState) map[string]any
@@ -306,7 +306,7 @@ func (a *Adapter) validate() error {
306306 }
307307
308308 if a .waitAfterCreate != nil {
309- validations = append (validations , "WaitAfterCreate newState" , a .waitAfterCreate .InTypes [1 ], stateType )
309+ validations = append (validations , "WaitAfterCreate newState" , a .waitAfterCreate .InTypes [2 ], stateType )
310310 // WaitAfterCreate must return (remoteType, error)
311311 if len (a .waitAfterCreate .OutTypes ) != 2 {
312312 return fmt .Errorf ("WaitAfterCreate must return (remoteType, error), got %d return values" , len (a .waitAfterCreate .OutTypes ))
@@ -315,7 +315,7 @@ func (a *Adapter) validate() error {
315315 }
316316
317317 if a .waitAfterUpdate != nil {
318- validations = append (validations , "WaitAfterUpdate newState" , a .waitAfterUpdate .InTypes [1 ], stateType )
318+ validations = append (validations , "WaitAfterUpdate newState" , a .waitAfterUpdate .InTypes [2 ], stateType )
319319 // WaitAfterUpdate must return (remoteType, error)
320320 if len (a .waitAfterUpdate .OutTypes ) != 2 {
321321 return fmt .Errorf ("WaitAfterUpdate must return (remoteType, error), got %d return values" , len (a .waitAfterUpdate .OutTypes ))
@@ -485,12 +485,12 @@ func (a *Adapter) DoResize(ctx context.Context, id string, newState any) error {
485485// WaitAfterCreate waits for the resource to become ready after creation.
486486// If the resource doesn't implement this method, this is a no-op.
487487// Returns the updated remoteState if available, otherwise returns nil
488- func (a * Adapter ) WaitAfterCreate (ctx context.Context , newState any ) (any , error ) {
488+ func (a * Adapter ) WaitAfterCreate (ctx context.Context , id string , newState any ) (any , error ) {
489489 if a .waitAfterCreate == nil {
490490 return nil , nil // no-op if not implemented
491491 }
492492
493- outs , err := a .waitAfterCreate .Call (ctx , newState )
493+ outs , err := a .waitAfterCreate .Call (ctx , id , newState )
494494 if err != nil {
495495 return nil , err
496496 }
@@ -502,12 +502,12 @@ func (a *Adapter) WaitAfterCreate(ctx context.Context, newState any) (any, error
502502// WaitAfterUpdate waits for the resource to become ready after update.
503503// If the resource doesn't implement this method, this is a no-op.
504504// Returns the updated remoteState if available, otherwise returns nil.
505- func (a * Adapter ) WaitAfterUpdate (ctx context.Context , newState any ) (any , error ) {
505+ func (a * Adapter ) WaitAfterUpdate (ctx context.Context , id string , newState any ) (any , error ) {
506506 if a .waitAfterUpdate == nil {
507507 return nil , nil // no-op if not implemented
508508 }
509509
510- outs , err := a .waitAfterUpdate .Call (ctx , newState )
510+ outs , err := a .waitAfterUpdate .Call (ctx , id , newState )
511511 if err != nil {
512512 return nil , err
513513 }
0 commit comments