DualWriter: Return error for unsupported watch (#93159)

This commit is contained in:
Ryan McKinley 2024-09-10 15:42:17 +03:00 committed by GitHub
parent e3fd9f9e58
commit 2f792ee4ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View File

@ -283,8 +283,9 @@ func (d *DualWriterMode1) Destroy() {
}
func (d *DualWriterMode1) Watch(ctx context.Context, options *metainternalversion.ListOptions) (watch.Interface, error) {
d.Log.Error(errors.New("Watch not implemented in mode 1"), "Watch not implemented in mode 1")
return nil, nil
err := errors.New("Watch not implemented in mode 1")
d.Log.Error(err, err.Error())
return nil, err
}
func (d *DualWriterMode1) GetSingularName() string {

View File

@ -331,8 +331,9 @@ func (d *DualWriterMode2) Update(ctx context.Context, name string, objInfo rest.
}
func (d *DualWriterMode2) Watch(ctx context.Context, options *metainternalversion.ListOptions) (watch.Interface, error) {
d.Log.Error(errors.New("Watch not implemented in mode 2"), "Watch not implemented in mode 2")
return nil, nil
err := errors.New("Watch not implemented in mode 2")
d.Log.Error(err, err.Error())
return nil, err
}
func (d *DualWriterMode2) Destroy() {