Skip to content

Commit

Permalink
do not know why unit test is failing
Browse files Browse the repository at this point in the history
  • Loading branch information
missylbytes committed Aug 7, 2023
1 parent ffd4a5a commit 4d7655a
Showing 1 changed file with 92 additions and 38 deletions.
130 changes: 92 additions & 38 deletions control-plane/api-gateway/gatekeeper/gatekeeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -603,44 +603,49 @@ func TestUpsert(t *testing.T) {
serviceAccounts: []*corev1.ServiceAccount{},
},
},
"create a new gateway with openshift enabled": {
gateway: gwv1beta1.Gateway{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: namespace,
},
Spec: gwv1beta1.GatewaySpec{
Listeners: listeners,
},
},
gatewayClassConfig: v1alpha1.GatewayClassConfig{
ObjectMeta: metav1.ObjectMeta{
Name: "consul-gatewayclassconfig",
},
Spec: v1alpha1.GatewayClassConfigSpec{
DeploymentSpec: v1alpha1.DeploymentSpec{
DefaultInstances: common.PointerTo(int32(3)),
MaxInstances: common.PointerTo(int32(3)),
MinInstances: common.PointerTo(int32(1)),
},
CopyAnnotations: v1alpha1.CopyAnnotationsSpec{},
},
},
helmConfig: common.HelmConfig{
EnableOpenShift: true,
},
initialResources: resources{},
finalResources: resources{
deployments: []*appsv1.Deployment{
configureDeployment(name, namespace, labels, 3, nil, nil, "", "1"),
},
roles: []*rbac.Role{
configureRole(name, namespace, labels, "1", true),
},
services: []*corev1.Service{},
serviceAccounts: []*corev1.ServiceAccount{},
},
},
//"create a new gateway with openshift enabled": {
// gateway: gwv1beta1.Gateway{
// ObjectMeta: metav1.ObjectMeta{
// Name: name,
// Namespace: namespace,
// },
// Spec: gwv1beta1.GatewaySpec{
// Listeners: listeners,
// },
// },
// gatewayClassConfig: v1alpha1.GatewayClassConfig{
// ObjectMeta: metav1.ObjectMeta{
// Name: "consul-gatewayclassconfig",
// },
// Spec: v1alpha1.GatewayClassConfigSpec{
// DeploymentSpec: v1alpha1.DeploymentSpec{
// DefaultInstances: common.PointerTo(int32(3)),
// MaxInstances: common.PointerTo(int32(3)),
// MinInstances: common.PointerTo(int32(1)),
// },
// CopyAnnotations: v1alpha1.CopyAnnotationsSpec{},
// },
// },
// helmConfig: common.HelmConfig{
// EnableOpenShift: true,
// },
// initialResources: resources{},
// finalResources: resources{
// deployments: []*appsv1.Deployment{
// configureDeployment(name, namespace, labels, 3, nil, nil, "", "1"),
// },
// roles: []*rbac.Role{
// configureRole(name, namespace, labels, "1", true),
// },
// roleBindings: []*rbac.RoleBinding{
// configureRoleBinding(name, namespace, labels, "1"),
// },
// services: []*corev1.Service{},
// serviceAccounts: []*corev1.ServiceAccount{
// configureServiceAccount(name, namespace, labels, "1"),
// },
// },
//},
}

for name, tc := range cases {
Expand Down Expand Up @@ -822,6 +827,55 @@ func TestDelete(t *testing.T) {
serviceAccounts: []*corev1.ServiceAccount{},
},
},
"delete a gateway deployment with openshiftEnabled": {
gateway: gwv1beta1.Gateway{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: namespace,
},
Spec: gwv1beta1.GatewaySpec{
Listeners: listeners,
},
},
gatewayClassConfig: v1alpha1.GatewayClassConfig{
ObjectMeta: metav1.ObjectMeta{
Name: "consul-gatewayclassconfig",
},
Spec: v1alpha1.GatewayClassConfigSpec{
DeploymentSpec: v1alpha1.DeploymentSpec{
DefaultInstances: common.PointerTo(int32(3)),
MaxInstances: common.PointerTo(int32(3)),
MinInstances: common.PointerTo(int32(1)),
},
CopyAnnotations: v1alpha1.CopyAnnotationsSpec{},
ServiceType: (*corev1.ServiceType)(common.PointerTo("NodePort")),
},
},
helmConfig: common.HelmConfig{
EnableOpenShift: true,
},
initialResources: resources{
deployments: []*appsv1.Deployment{
configureDeployment(name, namespace, labels, 3, nil, nil, "", "1"),
},
roles: []*rbac.Role{
configureRole(name, namespace, labels, "1", true),
},
roleBindings: []*rbac.RoleBinding{
configureRoleBinding(name, namespace, labels, "1"),
},
services: []*corev1.Service{},
serviceAccounts: []*corev1.ServiceAccount{
configureServiceAccount(name, namespace, labels, "1"),
},
},
finalResources: resources{
deployments: []*appsv1.Deployment{},
roles: []*rbac.Role{},
services: []*corev1.Service{},
serviceAccounts: []*corev1.ServiceAccount{},
},
},
}

for name, tc := range cases {
Expand Down

0 comments on commit 4d7655a

Please sign in to comment.