`Refactor: Move getReadableID to k8s-interface module`
Author: shellyco-codeCreated Sep 9, 2026Updated Sep 9, 2026
Description
Currently, the getReadableID(obj *objectsenvelopes.ScanObject) function resides in core/pkg/resourcehandler/filesloaderutils.go. However, this is a generic Kubernetes utility that builds a readable string ID from an object's API Version, Namespace, Kind, and Name.
There is an existing TODO in the codebase to migrate this function to the shared k8s-interface repository so that it can be used generically across the platform rather than being scoped exclusively to the filesloader logic.
Steps to Reproduce / Implement
- Fork and clone the
kubescape/k8s-interfacerepository. - Move the
getReadableIDfunction fromkubescape/core/pkg/resourcehandler/filesloaderutils.goto an appropriate utility file ink8s-interface. - Submit a PR to
kubescape/k8s-interfacewith this new function. - Once merged, bump the
k8s-interfacedependency version in thekubescaperepository. - Replace all internal calls to
getReadableIDinkubescapewith the newk8sinterface.GetReadableIDfunction.
Expected Behavior
The platform continues to function identically, but technical debt is reduced by moving generic utilities to the shared interface repository.
References
- File:
core/pkg/resourcehandler/filesloaderutils.go:176
Source: kubescape/kubescape