Merge pull request #904 from openkitchen/statefulset_fix

FIX: PVC's "Usedby" list irrelavant statefulsets if they are using the same volumeclaimtemplates name
mine
Fernand Galiana 2020-10-26 20:49:25 -06:00 committed by GitHub
commit 8b9b9083b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -201,7 +201,7 @@ func (s *StatefulSet) Scan(ctx context.Context, gvr, fqn string, wait bool) (Ref
})
case "v1/persistentvolumeclaims":
for _, v := range sts.Spec.VolumeClaimTemplates {
if !strings.HasPrefix(n, v.Name) {
if !strings.HasPrefix(n, v.Name+"-"+sts.Name) {
continue
}
refs = append(refs, Ref{