-
Notifications
You must be signed in to change notification settings - Fork 816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement SDK SetLabel and SetAnnotation functionality #323
Implement SDK SetLabel and SetAnnotation functionality #323
Conversation
Build Failed 😱 Build Id: 4b84c25a-c5dc-4c1e-b563-d9848151767e Build Logs
|
3dc0654
to
281d5a6
Compare
Build Failed 😱 Build Id: 7e13a1fb-4fe6-4317-93c4-9681a02ac842 Build Logs
|
281d5a6
to
6c4d1fd
Compare
Build Failed 😱 Build Id: 42a6c33d-220f-4622-a1a5-b4142616fee6 Build Logs
|
6c4d1fd
to
21759e9
Compare
Build Succeeded 👏 Build Id: 313f7a05-18cb-42ab-9d29-4603775e0dff The following development artifacts have been built, and will exist for the next 30 days:
(experimental) To install this version:
|
@@ -70,6 +71,8 @@ func (f *Framework) CreateGameServerAndWaitUntilReady(ns string, gs *v1alpha1.Ga | |||
return nil, fmt.Errorf("creating %v GameServer instances failed (%v): %v", gs.Spec, gs.Name, err) | |||
} | |||
|
|||
logrus.WithField("name", newGs.ObjectMeta.Name).Info("GameServer created, waiting for Ready") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Kuqd I added some logging here, to make it easier to track down what the name of the GameServers are, if things go wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sense !
@@ -31,8 +31,8 @@ func TestMain(m *testing.M) { | |||
usr, _ := user.Current() | |||
kubeconfig := flag.String("kubeconfig", filepath.Join(usr.HomeDir, "/.kube/config"), | |||
"kube config path, e.g. $HOME/.kube/config") | |||
gsimage := flag.String("gameserver-image", "gcr.io/agones-images/cpp-simple-server:0.2", | |||
"gameserver image to use for those tests, gcr.io/agones-images/cpp-simple-server:0.2") | |||
gsimage := flag.String("gameserver-image", "gcr.io/agones-images/udp-server:0.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Kuqd I updated this to make in IDE testing easier - and to match the Makefile
- do you see any issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch it was a mistake from me.
To be able to work locally, you need to be able to specify your local `GameServer` configuration, as it likely will have application specific configuration in it -- or maybe you want to specify what state it's in. This commit allow you to specify the local resource as either yaml/json through a `-f` or `--file` flag. Closes #296
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ! I've added some thoughts for future.
build/Makefile
Outdated
@@ -119,7 +119,7 @@ test-go: | |||
# Runs end-to-end tests on the current configured cluster | |||
# For minikube user the minikube-test-e2e targets | |||
test-e2e: | |||
$(DOCKER_RUN) go test -v $(agones_package)/test/e2e/... \ | |||
$(DOCKER_RUN) go test -v -race $(agones_package)/test/e2e/... \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good call 👍
@@ -70,6 +71,8 @@ func (f *Framework) CreateGameServerAndWaitUntilReady(ns string, gs *v1alpha1.Ga | |||
return nil, fmt.Errorf("creating %v GameServer instances failed (%v): %v", gs.Spec, gs.Name, err) | |||
} | |||
|
|||
logrus.WithField("name", newGs.ObjectMeta.Name).Info("GameServer created, waiting for Ready") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sense !
} | ||
|
||
assert.Equal(t, readyGs.Status.State, v1alpha1.Ready) | ||
reply, err := e2eframework.PingGameServer("ANNOTATION", fmt.Sprintf("%s:%d", readyGs.Status.Address, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like we're going to need a better client for interacting with the gameserver at some point. If we could received and send a variable for instance we would be able to assert that the right value is stored.
However I think for now this would do the trick !
} | ||
|
||
func defaultGameServer() *v1alpha1.GameServer { | ||
return &v1alpha1.GameServer{ObjectMeta: metav1.ObjectMeta{GenerateName: "udp-server", Namespace: defaultNs}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant to do that in my previous PR :), totally forgot about it.
This implements new functions in the SDK: - SetLabel(key, value) - that lets you set a label on the backing `GameServer` - SetAnnotation(key, value) - that lets you set an annotation on the backing `GameServer` All keys are prefixed with "stable.agones.dev/sdk-" to maintain isolation. Closes googleforgames#279
21759e9
to
19c4041
Compare
Build Succeeded 👏 Build Id: 99e1f963-9df4-4652-8adc-5989f22fe5a1 The following development artifacts have been built, and will exist for the next 30 days:
(experimental) To install this version:
|
This implements new functions in the SDK:
GameServer
GameServer
All keys are prefixed with "stable.agones.dev/sdk-" to maintain isolation.
Closes #279