Skip to content

Commit 2451b0c

Browse files
committed
Use the new dataSourceRef field
1 parent 6da8a8a commit 2451b0c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

populator-machinery/controller.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -413,24 +413,24 @@ func (c *controller) syncPvc(ctx context.Context, key, pvcNamespace, pvcName str
413413
return err
414414
}
415415

416-
dataSource := pvc.Spec.DataSource
417-
if nil == dataSource {
416+
dataSourceRef := pvc.Spec.DataSourceRef
417+
if nil == dataSourceRef {
418418
// Ignore PVCs without a datasource
419419
return nil
420420
}
421421

422-
if c.gk.Group != *dataSource.APIGroup || c.gk.Kind != dataSource.Kind || "" == dataSource.Name {
422+
if c.gk.Group != *dataSourceRef.APIGroup || c.gk.Kind != dataSourceRef.Kind || "" == dataSourceRef.Name {
423423
// Ignore PVCs that aren't for this populator to handle
424424
return nil
425425
}
426426

427427
var unstructured *unstructured.Unstructured
428-
unstructured, err = c.unstLister.Namespace(pvc.Namespace).Get(dataSource.Name)
428+
unstructured, err = c.unstLister.Namespace(pvc.Namespace).Get(dataSourceRef.Name)
429429
if nil != err {
430430
if !errors.IsNotFound(err) {
431431
return err
432432
}
433-
c.addNotification(key, "unstructured", pvc.Namespace, dataSource.Name)
433+
c.addNotification(key, "unstructured", pvc.Namespace, dataSourceRef.Name)
434434
// We'll get called again later when the data source exists
435435
return nil
436436
}
@@ -619,7 +619,7 @@ func (c *controller) syncPvc(ctx context.Context, key, pvcNamespace, pvcName str
619619
},
620620
},
621621
}
622-
patchPv.Annotations[c.populatedFromAnno] = pvc.Namespace + "/" + dataSource.Name
622+
patchPv.Annotations[c.populatedFromAnno] = pvc.Namespace + "/" + dataSourceRef.Name
623623
var patchData []byte
624624
patchData, err = json.Marshal(patchPv)
625625
if nil != err {

0 commit comments

Comments
 (0)