Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
252 changes: 125 additions & 127 deletions bundle/manifests/oadp-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -871,130 +871,6 @@ spec:
verbs:
- get
serviceAccountName: non-admin-controller
- rules:
- apiGroups:
- ""
resources:
- persistentvolumeclaims
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- persistentvolumes
verbs:
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- pods
verbs:
- create
- delete
- get
- list
- watch
- apiGroups:
- ""
resources:
- pods/log
verbs:
- get
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
- list
- watch
- apiGroups:
- backup.kubevirt.io
resources:
- virtualmachinebackups
- virtualmachinebackuptrackers
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- backup.kubevirt.io
resources:
- virtualmachinebackups/status
verbs:
- get
- apiGroups:
- backup.kubevirt.io
resources:
- virtualmachinebackuptrackers/status
verbs:
- get
- patch
- update
- apiGroups:
- kubevirt.io
resources:
- virtualmachines
verbs:
- get
- list
- watch
- apiGroups:
- velero.io
resources:
- backupstoragelocations
verbs:
- get
- list
- watch
- apiGroups:
- velero.io
resources:
- datadownloads
- datauploads
verbs:
- get
- list
- patch
- update
- watch
- apiGroups:
- velero.io
resources:
- datadownloads/status
- datauploads/status
verbs:
- get
- patch
- update
- apiGroups:
- authentication.k8s.io
resources:
- tokenreviews
verbs:
- create
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create
serviceAccountName: oadp-kubevirt-datamover-controller-manager
- rules:
- apiGroups:
- ""
Expand Down Expand Up @@ -1373,6 +1249,128 @@ spec:
- get
- list
- delete
- apiGroups:
- ""
resources:
- persistentvolumeclaims
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- persistentvolumes
verbs:
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- pods
verbs:
- create
- delete
- get
- list
- watch
- apiGroups:
- ""
resources:
- pods/log
verbs:
- get
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
- list
- watch
- apiGroups:
- backup.kubevirt.io
resources:
- virtualmachinebackups
- virtualmachinebackuptrackers
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- backup.kubevirt.io
resources:
- virtualmachinebackups/status
verbs:
- get
- apiGroups:
- backup.kubevirt.io
resources:
- virtualmachinebackuptrackers/status
verbs:
- get
- patch
- update
- apiGroups:
- kubevirt.io
resources:
- virtualmachines
verbs:
- get
- list
- watch
- apiGroups:
- velero.io
resources:
- backupstoragelocations
verbs:
- get
- list
- watch
- apiGroups:
- velero.io
resources:
- datadownloads
- datauploads
verbs:
- get
- list
- patch
- update
- watch
- apiGroups:
- velero.io
resources:
- datadownloads/status
- datauploads/status
verbs:
- get
- patch
- update
- apiGroups:
- authentication.k8s.io
resources:
- tokenreviews
verbs:
- create
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create
- apiGroups:
- build.openshift.io
- migration.openshift.io
Expand Down Expand Up @@ -1578,7 +1576,7 @@ spec:
verbs:
- create
- patch
serviceAccountName: oadp-kubevirt-datamover-controller-manager
serviceAccountName: oadp-vm-file-restore-controller-manager
- rules:
- apiGroups:
- ""
Expand Down Expand Up @@ -1611,7 +1609,7 @@ spec:
verbs:
- create
- patch
serviceAccountName: oadp-vm-file-restore-controller-manager
serviceAccountName: openshift-adp-controller-manager
- rules:
- apiGroups:
- ""
Expand Down Expand Up @@ -1644,7 +1642,7 @@ spec:
verbs:
- create
- patch
serviceAccountName: openshift-adp-controller-manager
serviceAccountName: velero
strategy: deployment
installModes:
- supported: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ resources:
# if your manager will use a service account that exists at
# runtime. Be sure to update RoleBinding and ClusterRoleBinding
# subjects if changing service account names.
- service_account.yaml
- role.yaml
- role_binding.yaml
- leader_election_role.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ roleRef:
name: leader-election-role
subjects:
- kind: ServiceAccount
name: controller-manager
name: velero
namespace: system
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ roleRef:
name: metrics-auth-role
subjects:
- kind: ServiceAccount
name: controller-manager
name: velero
namespace: system
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ roleRef:
name: manager-role
subjects:
- kind: ServiceAccount
name: controller-manager
name: velero
namespace: system
23 changes: 22 additions & 1 deletion internal/controller/kubevirt_datamover_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,11 @@ func ensureKubevirtDatamoverRequiredSpecs(
Name: "tmp",
MountPath: "/tmp",
},
{
Name: "bound-sa-token",
MountPath: "/var/run/secrets/openshift/serviceaccount",
ReadOnly: true,
},
Comment thread
coderabbitai[bot] marked this conversation as resolved.
},
SecurityContext: &corev1.SecurityContext{
AllowPrivilegeEscalation: ptr.To(false),
Expand Down Expand Up @@ -329,9 +334,25 @@ func ensureKubevirtDatamoverRequiredSpecs(
EmptyDir: &corev1.EmptyDirVolumeSource{},
},
},
{
Name: "bound-sa-token",
VolumeSource: corev1.VolumeSource{
Projected: &corev1.ProjectedVolumeSource{
Sources: []corev1.VolumeProjection{
{
ServiceAccountToken: &corev1.ServiceAccountTokenProjection{
Audience: "openshift",
ExpirationSeconds: ptr.To(int64(3600)),
Path: "token",
},
},
},
},
},
},
}
deploymentObject.Spec.Template.Spec.RestartPolicy = corev1.RestartPolicyAlways
deploymentObject.Spec.Template.Spec.ServiceAccountName = kubevirtDatamoverObjectName
deploymentObject.Spec.Template.Spec.ServiceAccountName = "velero"
return nil
}

Expand Down
Loading