Skip to content

Implement annotation for backed up DW #1549

@dkwon17

Description

@dkwon17

Description

This PR: #1530 introduced a feature where, stopped workspaces are backed up periodically.

To use this feature, the backup cron job must be enabled in the DWOC:

kind: DevWorkspaceOperatorConfig
metadata:
  name: devworkspace-operator-config
  namespace: openshift-operators
apiVersion: controller.devfile.io/v1alpha1
config:                                                                                                                                         
  workspace:
    backupCronJob:
      enable: true
      registry:
        path: <internal openshift registry url>
      schedule: '* * * * *'

The DWOC's status.lastBackupTime field will display the last time the backups jobs have been attempted for non-ephemeral workspaces in the cluster.

However, with the current implementation, it is not possible to distinguish whether or not old devworkspaces have successfully been backed up. In the backup job, there are multiple reasons why a back up might have been unsuccessful (for example, the image registry could be down).

It would be great if we can set annotations to successfully backed up workspaces, in order to determine which workspaces have been backed up, and which workspaces should be backed up in the next cron job. A successful backup means that the backup job pod has successfully built and pushed the image to an image registry.

See https://github.com/devfile/devworkspace-operator/pull/1530/changes#r2576240030 for context.

When the backup cron job determine which workspaces to back up (for example here), the job can potentially use this new annotation to help determine that.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions