Skip to content

Commit

Permalink
extracted parts of pkg/gameservers that deal with SDK server into pkg…
Browse files Browse the repository at this point in the history
…/sdkserver
  • Loading branch information
jkowalski committed Dec 21, 2018
1 parent d4b1d10 commit d43f4a7
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 11 deletions.
8 changes: 4 additions & 4 deletions cmd/sdk-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (

"agones.dev/agones/pkg"
"agones.dev/agones/pkg/client/clientset/versioned"
"agones.dev/agones/pkg/gameservers"
"agones.dev/agones/pkg/sdk"
"agones.dev/agones/pkg/sdkserver"
"agones.dev/agones/pkg/util/runtime"
"agones.dev/agones/pkg/util/signals"
gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime"
Expand Down Expand Up @@ -108,8 +108,8 @@ func main() {
logger.WithError(err).Fatalf("Could not create the agones api clientset")
}

var s *gameservers.SDKServer
s, err = gameservers.NewSDKServer(viper.GetString(gameServerNameEnv),
var s *sdkserver.SDKServer
s, err = sdkserver.NewSDKServer(viper.GetString(gameServerNameEnv),
viper.GetString(podNamespaceEnv), kubeClient, agonesClient)
if err != nil {
logger.WithError(err).Fatalf("Could not start sidecar")
Expand Down Expand Up @@ -146,7 +146,7 @@ func registerLocal(grpcServer *grpc.Server, ctlConf config) error {
}
}

local, err := gameservers.NewLocalSDKServer(filePath)
local, err := sdkserver.NewLocalSDKServer(filePath)
if err != nil {
return err
}
Expand Down
11 changes: 11 additions & 0 deletions pkg/gameservers/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1106,3 +1106,14 @@ func newFakeController() (*Controller, agtesting.Mocks) {
c.recorder = m.FakeRecorder
return c, m
}

func newSingleContainerSpec() v1alpha1.GameServerSpec {
return v1alpha1.GameServerSpec{
Ports: []v1alpha1.GameServerPort{{ContainerPort: 7777, HostPort: 9999, PortPolicy: v1alpha1.Static}},
Template: corev1.PodTemplateSpec{
Spec: corev1.PodSpec{
Containers: []corev1.Container{{Name: "container", Image: "container/image"}},
},
},
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package gameservers
package sdkserver

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion pkg/gameservers/localsdk.go → pkg/sdkserver/localsdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package gameservers
package sdkserver

import (
"io"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package gameservers
package sdkserver

import (
"encoding/json"
Expand Down
2 changes: 1 addition & 1 deletion pkg/gameservers/sdk.go → pkg/sdkserver/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package gameservers
package sdkserver

import (
"agones.dev/agones/pkg/apis/stable/v1alpha1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/gameservers/sdk_test.go → pkg/sdkserver/sdk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package gameservers
package sdkserver

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package gameservers
package sdkserver

import (
"io"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package gameservers
package sdkserver

import (
"net/http"
Expand Down

0 comments on commit d43f4a7

Please sign in to comment.