mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Merge pull request #82996 from tnqn/endpointslice-deletion
Fix EndpointSliceController service deletion processing
This commit is contained in:
		@@ -251,6 +251,8 @@ func (c *Controller) syncService(key string) error {
 | 
				
			|||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		if apierrors.IsNotFound(err) {
 | 
							if apierrors.IsNotFound(err) {
 | 
				
			||||||
			c.triggerTimeTracker.DeleteService(namespace, name)
 | 
								c.triggerTimeTracker.DeleteService(namespace, name)
 | 
				
			||||||
 | 
								// The service has been deleted, return nil so that it won't be retried.
 | 
				
			||||||
 | 
								return nil
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		return err
 | 
							return err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -140,9 +140,8 @@ func TestSyncServiceMissing(t *testing.T) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	err := esController.syncService(fmt.Sprintf("%s/%s", namespace, missingServiceName))
 | 
						err := esController.syncService(fmt.Sprintf("%s/%s", namespace, missingServiceName))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Since the service doesn't exist, we should get a not found error
 | 
						// nil should be returned when the service doesn't exist
 | 
				
			||||||
	assert.NotNil(t, err, "Expected no error syncing service")
 | 
						assert.Nil(t, err, "Expected no error syncing service")
 | 
				
			||||||
	assert.Equal(t, err.Error(), "service \"notthere\" not found")
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// That should mean no client actions were performed
 | 
						// That should mean no client actions were performed
 | 
				
			||||||
	assert.Len(t, client.Actions(), 0)
 | 
						assert.Len(t, client.Actions(), 0)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user