Skip to content

Commit

Permalink
fixing unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
dgkanatsios committed Oct 15, 2021
1 parent cacfeff commit ec947a0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion operator/config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ kind: Kustomization
images:
- name: controller
newName: thundernetes-operator
newTag: 1937c8b
newTag: 07789c3
9 changes: 1 addition & 8 deletions operator/controllers/utilities_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,7 @@ var _ = Describe("Utilities tests", func() {
Name: SidecarContainerName,
ImagePullPolicy: corev1.PullIfNotPresent,
Image: SidecarImage,
Ports: []corev1.ContainerPort{
{
Name: "port",
ContainerPort: SidecarPort,
Protocol: corev1.ProtocolTCP,
},
},
Env: getGameServerEnvVariables(gs),
Env: getGameServerEnvVariables(gs),
VolumeMounts: []corev1.VolumeMount{
{
Name: DataVolumeName,
Expand Down
5 changes: 4 additions & 1 deletion sidecar-go/httphandler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/dynamic/fake"
scheme2 "k8s.io/client-go/kubernetes/scheme"
Expand Down Expand Up @@ -121,7 +122,9 @@ var _ = Describe("API server tests", func() {
func newDynamicInterface() dynamic.Interface {
SchemeBuilder := &scheme.Builder{GroupVersion: gameserverGVR.GroupVersion()}
SchemeBuilder.AddToScheme(scheme2.Scheme)
return fake.NewSimpleDynamicClient(scheme2.Scheme)
gvrMap := make(map[schema.GroupVersionResource]string)
gvrMap[gameserverGVR] = "GameServerList"
return fake.NewSimpleDynamicClientWithCustomListKinds(scheme2.Scheme, gvrMap)
}

func createUnstructuredTestGameServer(name, namespace string) *unstructured.Unstructured {
Expand Down

0 comments on commit ec947a0

Please sign in to comment.