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
16 changes: 0 additions & 16 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ rules:
- security.openshift.io
resourceNames:
- anyuid
- privileged
resources:
- securitycontextconstraints
verbs:
Expand All @@ -191,18 +190,3 @@ rules:
- list
- update
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: manager-role
namespace: openstack
rules:
- apiGroups:
- security.openshift.io
resourceNames:
- privileged
resources:
- securitycontextconstraints
verbs:
- use
4 changes: 2 additions & 2 deletions internal/controller/manila_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (r *ManilaReconciler) GetLogger(ctx context.Context) logr.Logger {
// +kubebuilder:rbac:groups="rbac.authorization.k8s.io",resources=roles,verbs=get;list;watch;create;update;patch
// +kubebuilder:rbac:groups="rbac.authorization.k8s.io",resources=rolebindings,verbs=get;list;watch;create;update;patch
// service account permissions that are needed to grant permission to the above
// +kubebuilder:rbac:groups="security.openshift.io",resourceNames=anyuid;privileged,resources=securitycontextconstraints,verbs=use
// +kubebuilder:rbac:groups="security.openshift.io",resourceNames=anyuid,resources=securitycontextconstraints,verbs=use
// +kubebuilder:rbac:groups="",resources=pods,verbs=create;delete;get;list;patch;update;watch

// Reconcile -
Expand Down Expand Up @@ -551,7 +551,7 @@ func (r *ManilaReconciler) reconcileNormal(ctx context.Context, instance *manila
rbacRules := []rbacv1.PolicyRule{
{
APIGroups: []string{"security.openshift.io"},
ResourceNames: []string{"anyuid", "privileged"},
ResourceNames: []string{"anyuid"},
Resources: []string{"securitycontextconstraints"},
Verbs: []string{"use"},
},
Expand Down
1 change: 0 additions & 1 deletion internal/controller/manilashare_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ func (r *ManilaShareReconciler) GetLogger(ctx context.Context) logr.Logger {
// +kubebuilder:rbac:groups=core,resources=pods,verbs=get;list;
// +kubebuilder:rbac:groups=core,resources=secrets,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=apps,resources=statefulsets,verbs=get;list;create;update;patch;delete;watch
// +kubebuilder:rbac:groups=security.openshift.io,namespace=openstack,resources=securitycontextconstraints,resourceNames=privileged,verbs=use
// +kubebuilder:rbac:groups=k8s.cni.cncf.io,resources=network-attachment-definitions,verbs=get;list;watch
// +kubebuilder:rbac:groups=topology.openstack.org,resources=topologies,verbs=get;list;watch;update

Expand Down
3 changes: 0 additions & 3 deletions internal/manila/funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ func manilaDefaultSecurityContext() *corev1.SecurityContext {
"ALL",
},
},
SeccompProfile: &corev1.SeccompProfile{
Type: corev1.SeccompProfileTypeRuntimeDefault,
},
}
}

Expand Down
13 changes: 0 additions & 13 deletions internal/manila/volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ func GetVolumes(name string, extraVol []manilav1.ManilaExtraVolMounts, svc []sto
var config0644AccessMode int32 = 0644

res := []corev1.Volume{
{
Name: "etc-machine-id",
VolumeSource: corev1.VolumeSource{
HostPath: &corev1.HostPathVolumeSource{
Path: "/etc/machine-id",
},
},
},
{
Name: "scripts",
VolumeSource: corev1.VolumeSource{
Expand Down Expand Up @@ -60,11 +52,6 @@ func GetVolumes(name string, extraVol []manilav1.ManilaExtraVolMounts, svc []sto
// GetVolumeMounts - Nova Control Plane VolumeMounts
func GetVolumeMounts(extraVol []manilav1.ManilaExtraVolMounts, svc []storage.PropagationType) []corev1.VolumeMount {
res := []corev1.VolumeMount{
{
Name: "etc-machine-id",
MountPath: "/etc/machine-id",
ReadOnly: true,
},
{
Name: "config-data",
MountPath: "/var/lib/config-data/default",
Expand Down
6 changes: 3 additions & 3 deletions test/functional/manila_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ var _ = Describe("Manila controller", func() {
// Check the resulting deployment fieldsq
Expect(int(*d.Spec.Replicas)).To(Equal(1))

Expect(d.Spec.Template.Spec.Volumes).To(HaveLen(8))
Expect(d.Spec.Template.Spec.Volumes).To(HaveLen(7))
Expect(d.Spec.Template.Spec.Containers).To(HaveLen(2))

// cert deployment volumes
Expand Down Expand Up @@ -1268,13 +1268,13 @@ var _ = Describe("Manila controller", func() {
ss := th.GetStatefulSet(share)
// Check the resulting deployment fields
Expect(int(*ss.Spec.Replicas)).To(Equal(1))
Expect(ss.Spec.Template.Spec.Volumes).To(HaveLen(5))
Expect(ss.Spec.Template.Spec.Volumes).To(HaveLen(4))
Expect(ss.Spec.Template.Spec.Containers).To(HaveLen(2))
// Get the manila-share container
container := ss.Spec.Template.Spec.Containers[1]
// Fail if manila-share doesn't have the right number of
// VolumeMounts entries
Expect(container.VolumeMounts).To(HaveLen(7))
Expect(container.VolumeMounts).To(HaveLen(6))
// Inspect VolumeMounts and make sure we have the Ceph MountPath
// provided through extraMounts
th.AssertVolumeMountPathExists(ManilaCephExtraMountsSecretName,
Expand Down
4 changes: 2 additions & 2 deletions test/functional/manilaapi_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ var _ = Describe("ManilaAPI controller", func() {
ss := th.GetStatefulSet(manilaTest.ManilaAPI)
// Check the resulting deployment fields
Expect(int(*ss.Spec.Replicas)).To(Equal(1))
Expect(ss.Spec.Template.Spec.Volumes).To(HaveLen(5))
Expect(ss.Spec.Template.Spec.Volumes).To(HaveLen(4))
Expect(ss.Spec.Template.Spec.Containers).To(HaveLen(2))

container := ss.Spec.Template.Spec.Containers[1]
Expect(container.VolumeMounts).To(HaveLen(7))
Expect(container.VolumeMounts).To(HaveLen(6))
Expect(container.Image).To(Equal(manilaTest.ContainerImage))
Expect(container.LivenessProbe.HTTPGet.Port.IntVal).To(Equal(int32(8786)))
Expect(container.ReadinessProbe.HTTPGet.Port.IntVal).To(Equal(int32(8786)))
Expand Down
4 changes: 2 additions & 2 deletions test/functional/manilascheduler_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,11 @@ var _ = Describe("ManilaScheduler controller", func() {
ss := th.GetStatefulSet(manilaTest.ManilaScheduler)
// Check the resulting deployment fields
Expect(int(*ss.Spec.Replicas)).To(Equal(1))
Expect(ss.Spec.Template.Spec.Volumes).To(HaveLen(4))
Expect(ss.Spec.Template.Spec.Volumes).To(HaveLen(3))
Expect(ss.Spec.Template.Spec.Containers).To(HaveLen(2))

container := ss.Spec.Template.Spec.Containers[1]
Expect(container.VolumeMounts).To(HaveLen(6))
Expect(container.VolumeMounts).To(HaveLen(5))
Expect(container.Image).To(Equal(manilaTest.ContainerImage))
})
It("stored the input hash in the Status", func() {
Expand Down
4 changes: 2 additions & 2 deletions test/functional/manilashare_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,11 @@ var _ = Describe("ManilaShare controller", func() {
ss := th.GetStatefulSet(share)
// Check the resulting deployment fields
Expect(int(*ss.Spec.Replicas)).To(Equal(1))
Expect(ss.Spec.Template.Spec.Volumes).To(HaveLen(4))
Expect(ss.Spec.Template.Spec.Volumes).To(HaveLen(3))
Expect(ss.Spec.Template.Spec.Containers).To(HaveLen(2))

container := ss.Spec.Template.Spec.Containers[1]
Expect(container.VolumeMounts).To(HaveLen(6))
Expect(container.VolumeMounts).To(HaveLen(5))
Expect(container.Image).To(Equal(manilaTest.ContainerImage))

// the input hash is stored in the current manilaShare.Status
Expand Down
21 changes: 0 additions & 21 deletions test/kuttl/tests/manila-tls/03-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,6 @@ spec:
command:
- /usr/bin/dumb-init
volumeMounts:
- mountPath: /etc/machine-id
name: etc-machine-id
readOnly: true
- mountPath: /var/lib/config-data/default
name: config-data
- mountPath: /usr/local/bin/container-scripts
Expand Down Expand Up @@ -307,9 +304,6 @@ spec:
readOnly: true
subPath: tls.key
volumes:
- name: etc-machine-id
hostPath:
path: /etc/machine-id
- name: scripts
secret:
secretName: manila-scripts
Expand Down Expand Up @@ -362,8 +356,6 @@ spec:
command:
- /usr/bin/dumb-init
volumeMounts:
- mountPath: /etc/machine-id
name: etc-machine-id
- mountPath: /var/lib/config-data/default
name: config-data
readOnly: true
Expand Down Expand Up @@ -393,8 +385,6 @@ spec:
- share
- /etc/manila/manila.conf.d
volumeMounts:
- mountPath: /etc/machine-id
name: etc-machine-id
- mountPath: /var/lib/config-data/default
name: config-data
readOnly: true
Expand All @@ -420,9 +410,6 @@ spec:
readOnly: true
subPath: tls-ca-bundle.pem
volumes:
- name: etc-machine-id
hostPath:
path: /etc/machine-id
- name: scripts
secret:
secretName: manila-scripts
Expand Down Expand Up @@ -467,8 +454,6 @@ spec:
command:
- /usr/bin/dumb-init
volumeMounts:
- mountPath: /etc/machine-id
name: etc-machine-id
- mountPath: /var/lib/config-data/default
name: config-data
readOnly: true
Expand All @@ -495,9 +480,6 @@ spec:
- scheduler
- /etc/manila/manila.conf.d
volumeMounts:
- mountPath: /etc/machine-id
name: etc-machine-id
readOnly: true
- mountPath: /var/lib/config-data/default
name: config-data
readOnly: true
Expand All @@ -520,9 +502,6 @@ spec:
readOnly: true
subPath: tls-ca-bundle.pem
volumes:
- name: etc-machine-id
hostPath:
path: /etc/machine-id
- name: scripts
secret:
secretName: manila-scripts
Expand Down