Skip to content

Commit b800141

Browse files
authored
Fixed deleting on the wrong name
When deleting, we have to use the same name as used in creating the service
1 parent 2ed7144 commit b800141

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

samples/common/src/main/java/io/javaoperatorsdk/operator/sample/CustomServiceController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public CustomServiceController(KubernetesClient kubernetesClient) {
3232
public boolean deleteResource(CustomService resource, Context<CustomService> context) {
3333
log.info("Execution deleteResource for: {}", resource.getMetadata().getName());
3434
kubernetesClient.services().inNamespace(resource.getMetadata().getNamespace())
35-
.withName(resource.getMetadata().getName()).delete();
35+
.withName(resource.getSpec().getName()).delete();
3636
return true;
3737
}
3838

0 commit comments

Comments
 (0)