Skip to content

Commit

Permalink
fix: various test issues
Browse files Browse the repository at this point in the history
  • Loading branch information
redhatrises committed Oct 17, 2023
1 parent 8997ff7 commit c15060f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,7 @@ spec:
type: boolean
image:
description: Location of the Falcon Sensor image. Use only in
cases when you mirror the original image to your repository/name:tag,
and CrowdStrike OAuth2 API is not used.
cases when you mirror the original image to your repository/name:tag
pattern: ^.*:.*$
type: string
imagePullPolicy:
Expand Down
2 changes: 0 additions & 2 deletions controllers/admission/falconadmission_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ type FalconAdmissionReconciler struct {
Scheme *runtime.Scheme
}

const nsTest = "falcon-kac"

// SetupWithManager sets up the controller with the Manager.
func (r *FalconAdmissionReconciler) SetupWithManager(mgr ctrl.Manager) error {
return ctrl.NewControllerManagedBy(mgr).
Expand Down
3 changes: 1 addition & 2 deletions deploy/falcon-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2702,8 +2702,7 @@ spec:
type: boolean
image:
description: Location of the Falcon Sensor image. Use only in
cases when you mirror the original image to your repository/name:tag,
and CrowdStrike OAuth2 API is not used.
cases when you mirror the original image to your repository/name:tag
pattern: ^.*:.*$
type: string
imagePullPolicy:
Expand Down
22 changes: 20 additions & 2 deletions internal/controller/assets/rbac_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,23 @@ func TestRole(t *testing.T) {
Namespace: namespace,
Labels: common.CRLabels("role", name, common.FalconAdmissionController),
},
Rules: []rbacv1.PolicyRule{
{
Verbs: []string{"create", "get", "list", "watch", "update"},
APIGroups: []string{""},
Resources: []string{"configmaps"},
},
{
Verbs: []string{"get", "list", "watch", "update"},
APIGroups: []string{""},
Resources: []string{"pods"},
},
{
Verbs: []string{"get", "list", "watch", "create", "update", "delete"},
APIGroups: []string{"coordination.k8s.io"},
Resources: []string{"leases"},
},
},
}
got := Role(name, namespace)
if diff := cmp.Diff(want, got); diff != "" {
Expand All @@ -107,8 +124,9 @@ func TestRoleBinding(t *testing.T) {
Kind: "RoleBinding",
},
ObjectMeta: metav1.ObjectMeta{
Name: name,
Labels: common.CRLabels("rolebinding", name, component),
Name: name,
Labels: common.CRLabels("rolebinding", name, component),
Namespace: namespace,
},
Subjects: []rbacv1.Subject{
{
Expand Down

0 comments on commit c15060f

Please sign in to comment.