Skip to content

Commit

Permalink
changing gs.Spec.PodSpec to PodTemplateSpec
Browse files Browse the repository at this point in the history
  • Loading branch information
dgkanatsios committed Jan 7, 2022
1 parent e3eddd2 commit c865564
Show file tree
Hide file tree
Showing 16 changed files with 12,146 additions and 11,486 deletions.
110 changes: 59 additions & 51 deletions cmd/e2e/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,18 @@ func main() {
},
StandingBy: 2,
Max: 4,
PodSpec: corev1.PodSpec{
Containers: []corev1.Container{
{
Image: imgName,
Name: "netcore-sample",
ImagePullPolicy: corev1.PullIfNotPresent,
Ports: []corev1.ContainerPort{
{
Name: portKey,
ContainerPort: 80,
Template: corev1.PodTemplateSpec{
Spec: corev1.PodSpec{
Containers: []corev1.Container{
{
Image: imgName,
Name: "netcore-sample",
ImagePullPolicy: corev1.PullIfNotPresent,
Ports: []corev1.ContainerPort{
{
Name: portKey,
ContainerPort: 80,
},
},
},
},
Expand All @@ -148,22 +150,24 @@ func main() {
PortsToExpose: []mpsv1alpha1.PortToExpose{{ContainerName: "netcore-sample", PortName: portKey}},
StandingBy: 2,
Max: 4,
PodSpec: corev1.PodSpec{
Containers: []corev1.Container{
{
Image: imgName,
Name: "netcore-sample",
ImagePullPolicy: corev1.PullIfNotPresent,
Ports: []corev1.ContainerPort{
{
Name: portKey,
ContainerPort: 80,
Template: corev1.PodTemplateSpec{
Spec: corev1.PodSpec{
Containers: []corev1.Container{
{
Image: imgName,
Name: "netcore-sample",
ImagePullPolicy: corev1.PullIfNotPresent,
Ports: []corev1.ContainerPort{
{
Name: portKey,
ContainerPort: 80,
},
},
},
Env: []corev1.EnvVar{
{
Name: "SLEEP_BEFORE_READY_FOR_PLAYERS",
Value: "true",
Env: []corev1.EnvVar{
{
Name: "SLEEP_BEFORE_READY_FOR_PLAYERS",
Value: "true",
},
},
},
},
Expand All @@ -184,17 +188,19 @@ func main() {
PortsToExpose: []mpsv1alpha1.PortToExpose{{ContainerName: "netcore-sample", PortName: portKey}},
StandingBy: 2,
Max: 4,
PodSpec: corev1.PodSpec{
Containers: []corev1.Container{
{
Image: imgName,
Name: "netcore-sample",
ImagePullPolicy: corev1.PullIfNotPresent,
Command: []string{"/bin/sh", "-c", "sleep 2 && command_that_does_not_exist"},
Ports: []corev1.ContainerPort{
{
Name: portKey,
ContainerPort: 80,
Template: corev1.PodTemplateSpec{
Spec: corev1.PodSpec{
Containers: []corev1.Container{
{
Image: imgName,
Name: "netcore-sample",
ImagePullPolicy: corev1.PullIfNotPresent,
Command: []string{"/bin/sh", "-c", "sleep 2 && command_that_does_not_exist"},
Ports: []corev1.ContainerPort{
{
Name: portKey,
ContainerPort: 80,
},
},
},
},
Expand All @@ -215,22 +221,24 @@ func main() {
PortsToExpose: []mpsv1alpha1.PortToExpose{{ContainerName: "netcore-sample", PortName: portKey}},
StandingBy: 2,
Max: 4,
PodSpec: corev1.PodSpec{
Containers: []corev1.Container{
{
Image: imgName,
Name: "netcore-sample",
ImagePullPolicy: corev1.PullIfNotPresent,
Ports: []corev1.ContainerPort{
{
Name: portKey,
ContainerPort: 80,
Template: corev1.PodTemplateSpec{
Spec: corev1.PodSpec{
Containers: []corev1.Container{
{
Image: imgName,
Name: "netcore-sample",
ImagePullPolicy: corev1.PullIfNotPresent,
Ports: []corev1.ContainerPort{
{
Name: portKey,
ContainerPort: 80,
},
},
},
Env: []corev1.EnvVar{
{
Name: "SKIP_READY_FOR_PLAYERS",
Value: "true",
Env: []corev1.EnvVar{
{
Name: "SKIP_READY_FOR_PLAYERS",
Value: "true",
},
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions pkg/operator/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Image URL to use all building/pushing image targets
IMG ?= controller:latest
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=true,preserveUnknownFields=false"
CRD_OPTIONS ?= "crd:trivialVersions=true,preserveUnknownFields=false,generateEmbeddedObjectMeta=true"

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down Expand Up @@ -99,7 +99,7 @@ undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/confi

CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
controller-gen: ## Download controller-gen locally if necessary.
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.4.1)
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.6.0)

KUSTOMIZE = $(shell pwd)/bin/kustomize
kustomize: ## Download kustomize locally if necessary.
Expand Down
4 changes: 2 additions & 2 deletions pkg/operator/api/v1alpha1/gameserver_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ type GameServerSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file

// PodSpec describes the pod specification of the game server
PodSpec corev1.PodSpec `json:"podSpec,omitempty"`
// Template describes the pod template specification of the game server
Template corev1.PodTemplateSpec `json:"template,omitempty"`
//+kubebuilder:validation:Required
// TitleID is the TitleID this GameServer belongs to
TitleID string `json:"titleID,omitempty"`
Expand Down
4 changes: 2 additions & 2 deletions pkg/operator/api/v1alpha1/gameserverbuild_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ type GameServerBuildSpec struct {
// Max is the maximum number of servers in any state
Max int `json:"max,omitempty"`

// PodSpec describes the pod specification of the game server
PodSpec corev1.PodSpec `json:"podSpec,omitempty"`
// Template describes the pod template specification of the game server
Template corev1.PodTemplateSpec `json:"template,omitempty"`

//+kubebuilder:validation:Required
// TitleID is the TitleID this Build belongs to
Expand Down
4 changes: 2 additions & 2 deletions pkg/operator/api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c865564

Please sign in to comment.