#3777·kubescape

`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

  1. Fork and clone the kubescape/k8s-interface repository.
  2. Move the getReadableID function from kubescape/core/pkg/resourcehandler/filesloaderutils.go to an appropriate utility file in k8s-interface.
  3. Submit a PR to kubescape/k8s-interface with this new function.
  4. Once merged, bump the k8s-interface dependency version in the kubescape repository.
  5. Replace all internal calls to getReadableID in kubescape with the new k8sinterface.GetReadableID function.

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