feat: add relationships to ConfigMaps, Secrets, PV, PVC, SA, StorageClass and ImagePullSecrets#146
Merged
steveteuber merged 5 commits intoMar 24, 2026
Conversation
Owner
|
Looks good to me. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR, prepared as part of the work done by the AI R&D team at J‑Labs, improves dependency resolution in kubectl graph by adding several missing relationships between workloads, configuration objects, and storage resources.
The main fix is for pod configuration dependencies. kubectl graph now adds Pod -> ConfigMap relationships for:
spec.volumes[].configMap.namespec.volumes[].projected.sources[].configMap.nameenvFrom[].configMapRef.nameenv[].valueFrom.configMapKeyRef.nameIt also adds the analogous Pod -> Secret relationships for:
spec.volumes[].secret.secretNamespec.volumes[].projected.sources[].secret.nameenvFrom[].secretRef.nameenv[].valueFrom.secretKeyRef.nameIn addition, pod identity and registry-related dependencies are now included:
Storage relationships were extended as well:
Pod -> PersistentVolumeClaim via spec.volumes[].persistentVolumeClaim.claimNamePersistentVolumeClaim -> PersistentVolume via spec.volumeNamePersistentVolume -> StorageClass via spec.storageClassNamePersistentVolumeClaim -> StorageClass via spec.storageClassNameTo make these references reliable, graph construction now pre-registers all requested resources as nodes before running resource-specific relationship analysis. This removes input-order sensitivity, so references resolve correctly even when the referenced objects appear later in the requested resource list.
When a referenced resource already exists in the graph, relationships point to the real node and preserve metadata such as labels and annotations. Otherwise, a minimal fallback node is created from kind, namespace, and name.