Skip to content

Commit

Permalink
CR Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
razsamuel committed Jan 10, 2024
1 parent cb91f79 commit a4d786f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion pkg/k8s/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,11 @@ func checkIfOwnEntity(entity port.Entity, portClient *cli.PortClient) (*bool, er
Operator: "contains",
Value: fmt.Sprintf("statekey/%s", config.ApplicationConfig.StateKey),
},
{
Property: "$blueprint",
Operator: "=",
Value: entity.Blueprint,
},
},
Combinator: "and",
})
Expand Down Expand Up @@ -294,7 +299,7 @@ func (c *Controller) entityHandler(portEntity port.Entity, action EventActionTyp
}
klog.V(0).Infof("Successfully deleted entity '%s' of blueprint '%s'", portEntity.Identifier, portEntity.Blueprint)
} else {
klog.Warningf("trying to delete entity but didn't find it in port with k8s ownership", portEntity.Identifier, portEntity.Blueprint)
klog.Warningf("trying to delete entity but didn't find it in port with this exporter ownership, entity id: '%s', blueprint:'%s'", portEntity.Identifier, portEntity.Blueprint)
}

}
Expand Down
2 changes: 1 addition & 1 deletion pkg/k8s/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func TestDeleteDeploymentSameOwner(t *testing.T) {
createItem := EventItem{Key: getKey(d, t), ActionType: CreateAction}
item := EventItem{Key: getKey(d, t), ActionType: DeleteAction}

f := newFixture(t, "", "", fmt.Sprintf("statekey/%s", config.ApplicationConfig.StateKey)+"port-k8s-exporter", resource, objects)
f := newFixture(t, "", "", fmt.Sprintf("port-k8s-exporter/0.1 (statekey/%s)", config.ApplicationConfig.StateKey), resource, objects)
f.runControllerSyncHandler(createItem, false)

f.runControllerSyncHandler(item, false)
Expand Down

0 comments on commit a4d786f

Please sign in to comment.