Comments (3)
Hi @antiphp I would like to help out with this issue, I am new to the project and just had a few questions before jumping in.
Reading your solution it sounds like changing the gsAnnotations
field to []map[string]string
here
agones/pkg/sdkserver/sdkserver.go
Line 124 in 2f1c2a8
SetAnnotation
(singular) to either append or overwrite.
Then adding a SetAnnotations
(plural) that looks like func (s *SDKServer) SetAnnotations(_ context.Context, kv []*sdk.KeyValue) (*sdk.Empty, error)
.
Is that the line of thinking you would like here? Or do you think changing that property of the SDKServer
to a slice would break something else?
Aside from adding a test is there anywhere you would like this implemented with this?
from agones.
Hi,
the function signature for SetAnnotations
(p) seems fine. One could think of making kv
variadic, but it does not seem to be used that often in this project except for GRPC options.
What's the thinking behind append vs overwrite? In my opinion, the latter key will always overwrite, so
[]*sdk.KeyValue{{"foo":"bar"},{"foo":"baz"}}
should always result in foo=baz
. We could error but it doesn't feel right to add sophisticated logic to what is just a map and everyone expects it to act like a map. But note that this is only my opinion, I am not related to this project, so in the end someone else will review and decide.
Btw this ticket is related: #3834 - Removal of annotations.
Thanks for taking the initiative!
from agones.
Hi,
the function signature for
SetAnnotations
(p) seems fine. One could think of makingkv
variadic, but it does not seem to be used that often in this project except for GRPC options.What's the thinking behind append vs overwrite? In my opinion, the latter key will always overwrite, so
[]*sdk.KeyValue{{"foo":"bar"},{"foo":"baz"}}
should always result infoo=baz
. We could error but it doesn't feel right to add sophisticated logic to what is just a map and everyone expects it to act like a map. But note that this is only my opinion, I am not related to this project, so in the end someone else will review and decide.Btw this ticket is related: #3834 - Removal of annotations.
Thanks for taking the initiative!
The idea to use append vs overwrite was so that we could handle updating multiple different annotations in the same function i.e. we would get []*sdk.KeyValue{{"foo":"bar"},{"some":"thing"}}
and we needed both those annotations applied to the object. However this might just be a misunderstanding on my part of how the project invokes these under the hood.
I was thinking originally that we just wanted to be able to add multiple annotations that are passed to the function at once to a GameServer object. However it seems like the ask is more of not only add the annotations but to update the values of them as well. Which if that is the case I would agree completely that overwrite is the way to go instead of append.
from agones.
Related Issues (20)
- `make gen-all-sdk-grpc` is ineffective for nodejs HOT 9
- [Docs] Single source of truth for example yaml files HOT 2
- Fleet autoscaler scale down delay HOT 1
- metadata.finalizers: "agones.dev": prefer a domain-qualified finalizer name to avoid accidental conflicts with other finalizer writer HOT 1
- Implement Count functions in SDKServer, and write e2e tests HOT 1
- sdkserver: add functionality to remove game server annotations
- [e2e] Document the best path for making changes to simple-game-server for e2e tests HOT 1
- Add runAsUser, runAsGroup, and allowPrivilegeEscalation to helm chart for Agones containers HOT 8
- Release 1.41.0 HOT 1
- Fix connection-draining flakes in TestAllocatorAfterDeleteReplica / /TestGameServerCreationRightAfterDeletingOneExtensionsPod
- Update Node.js Page to Reflect that Counters and Lists is Implemented
- `make build-images` fails with no REGISTRY variable set HOT 1
- Add AppEngine cleanup to appropriate CloudBuild scripts. HOT 1
- Distributed defaults to using ListSortedGameServersPriorities when CountsAndLists is enabled HOT 2
- https and CORS for agones-ping http service HOT 1
- Using portPolicy None results in a gameserver's port being 0 HOT 5
- Beta: UpdateList using Agones 1.41 rest API doesn't update the data in the selected list HOT 12
- UpdateList REST Documentation is for Local SDK Server not SDK Server
- Allow Custom KUBERNETES_SERVICE_HOST and PORT Configuration for Agones Sidecar
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from agones.