Skip to content

Annotate PVC with errors from Controller #1

@phenixblue

Description

@phenixblue

Need to add functionality to the controller to update target PVC resources when certain errors occur within the reconciliation.

At a minimum for when an incorrect volume retention policy is specified.

Example:

When labeling a PVC with a retention policy that isn't Retain, Delete, or Recycle the controller logs the following errors:

2021-08-17T20:28:05.659Z	INFO	controllers.PersistentVolumeClaim	Setting reclaim policy to match PVC label	{"pvc": "test2/datadir-crdb1-2", "pv": "pvc-70a047e8-bc55-4ff8-b389-76cd07440f3d", "policy-from-pvc-label": "Dummy", "policy-from-pv": "Delete"}
2021-08-17T20:28:05.663Z	ERROR	controller-runtime.controller	Reconciler error	{"controller": "persistentvolumeclaim", "request": "test2/datadir-crdb1-2", "error": "could not update PV: PersistentVolume \"pvc-70a047e8-bc55-4ff8-b389-76cd07440f3d\" is invalid: spec.persistentVolumeReclaimPolicy: Unsupported value: \"Dummy\": supported values: \"Delete\", \"Recycle\", \"Retain\""}

Information about the error could be added to an annotation on the target PVC resource to provide a feedback mechanism to end-users who probably don't have access to view the volrec controller logs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions