Skip to content

Commit 8e55cd4

Browse files
committed
Reorganisation of top level directories.
Better to be gameserver > controllers, and then gameservers > sidecar than break out by functionality. More idiomatic go, and easier to work with.
1 parent f260f8b commit 8e55cd4

7 files changed

Lines changed: 30 additions & 11 deletions

File tree

build/Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ common_mounts = -v $(build_path)/.config/gcloud:/root/.config/gcloud \
4141
-v $(KUBECONFIG):/root/.kube \
4242
-v $(agon_path):$(mount_path)
4343

44-
gameserver_tag = $(REPOSITORY)/gameserver-controller:$(VERSION)
44+
gameserver_tag = $(REPOSITORY)/gameservers-controller:$(VERSION)
4545

4646
# _____ _
4747
# |_ _|_ _ _ __ __ _ ___| |_ ___
@@ -56,13 +56,13 @@ test: ensure-image
5656

5757
# Build a static binary for the gameserver operator
5858
# CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main .
59-
build-controller-gameserver-binary: ensure-image
59+
build-gameservers-controller-binary: ensure-image
6060
docker run --rm -e "CGO_ENABLED=0" $(common_mounts) --entrypoint=go $(TAG) build \
61-
-o $(mount_path)/controllers/gameserver/bin/gameserver -a -installsuffix cgo $(agon_package)/controllers/gameserver
61+
-o $(mount_path)/gameservers/controller/bin/controller -a -installsuffix cgo $(agon_package)/gameservers/controller
6262

6363
# Build the image for the gameserver controller
64-
build-controller-gameserver-image: ensure-image build-controller-gameserver-binary
65-
docker build $(agon_path)/controllers/gameserver --tag=$(gameserver_tag)
64+
build-gameservers-controller-image: ensure-image build-gameservers-controller-binary
65+
docker build $(agon_path)/gameservers/controller/ --tag=$(gameserver_tag)
6666

6767
# Generate the CRD client
6868
gen-client: ensure-image
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
FROM alpine:3.6
22

3-
COPY ./bin/gameserver /home/agon/gameserver
3+
COPY ./bin/controller /home/agon/controller
44
RUN apk --update add ca-certificates && \
55
adduser -D agon && \
66
chown -R agon /home/agon && \
7-
chmod o+x /home/agon/gameserver
7+
chmod o+x /home/agon/controller
88

99
USER agon
10-
ENTRYPOINT /home/agon/gameserver
10+
ENTRYPOINT /home/agon/controller
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
apiVersion: extensions/v1beta1
1616
kind: Deployment
1717
metadata:
18-
name: gameserver-controller
18+
name: gameservers-controller
1919
spec:
2020
replicas: 1
2121
strategy:
@@ -26,6 +26,6 @@ spec:
2626
stable.agon.io/role: controller
2727
spec:
2828
containers:
29-
- name: gameserver-controller
30-
image: gcr.io/agon-images/gameserver-controller:0.1
29+
- name: gameservers-controller
30+
image: gcr.io/agon-images/gameservers-controller:0.1
3131
imagePullPolicy: Always

gameservers/sidecar/sidecar.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2017 Google Inc. All Rights Reserved.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// placeholder for where the sidecar will be developed
16+
package main
17+
18+
func main() {
19+
}

0 commit comments

Comments
 (0)