Skip to content

Commit

Permalink
Changing the group name for allocation policy to multicluster.agones.dev
Browse files Browse the repository at this point in the history
  • Loading branch information
pooneh-m authored and zx-zx committed Apr 15, 2019
1 parent 0e2acc1 commit c736ca9
Show file tree
Hide file tree
Showing 66 changed files with 619 additions and 398 deletions.
2 changes: 1 addition & 1 deletion build/boilerplate.go.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018 Google LLC All Rights Reserved.
// Copyright 2019 Google LLC All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion build/build-image/Dockerfile
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.

# ForceUpdate 7 -- change here if you need to force a rebuild
# ForceUpdate 7-- change here if you need to force a rebuild

FROM debian:stretch

Expand Down
3 changes: 2 additions & 1 deletion build/build-image/gen-crd-client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ rsync -r /go/src/agones.dev/agones/vendor/k8s.io/ /go/src/k8s.io/
cd /go/src/k8s.io/code-generator
./generate-groups.sh "all" \
agones.dev/agones/pkg/client \
agones.dev/agones/pkg/apis stable:v1alpha1 \
agones.dev/agones/pkg/apis "stable:v1alpha1 multicluster:v1alpha1" \
--go-header-file=/go/src/agones.dev/agones/build/boilerplate.go.txt

Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ metadata:
chart: {{ template "agones.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
name: gameserverallocationpolicies.stable.agones.dev
name: gameserverallocationpolicies.multicluster.agones.dev
spec:
group: stable.agones.dev
group: multicluster.agones.dev
names:
kind: GameServerAllocationPolicy
plural: gameserverallocationpolicies
Expand Down
4 changes: 2 additions & 2 deletions install/yaml/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -793,9 +793,9 @@ metadata:
chart: agones-0.10.0
release: agones-manual
heritage: Tiller
name: gameserverallocationpolicies.stable.agones.dev
name: gameserverallocationpolicies.multicluster.agones.dev
spec:
group: stable.agones.dev
group: multicluster.agones.dev
names:
kind: GameServerAllocationPolicy
plural: gameserverallocationpolicies
Expand Down
23 changes: 23 additions & 0 deletions pkg/apis/multicluster/register.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright 2017 Google LLC All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package multicluster

const (
// GroupName is the Scheme Group Name for Agones Custom Resource Definitions
GroupName = "multicluster.agones.dev"
// VersionAnnotation is the key for version annotation
// associated with the CRD
VersionAnnotation = GroupName + "/sdk-version"
)
59 changes: 59 additions & 0 deletions pkg/apis/multicluster/v1alpha1/register.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// Copyright 2017 Google LLC All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package v1alpha1

import (
"agones.dev/agones/pkg/apis/multicluster"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
k8sruntime "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/kubernetes/scheme"
)

// SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: multicluster.GroupName, Version: "v1alpha1"}

// Kind takes an unqualified kind and returns back a Group qualified GroupKind
func Kind(kind string) schema.GroupKind {
return SchemeGroupVersion.WithKind(kind).GroupKind()
}

// Resource takes an unqualified resource and returns a Group qualified GroupResource
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}

var (
// SchemeBuilder registers our types
SchemeBuilder = k8sruntime.NewSchemeBuilder(addKnownTypes)
// AddToScheme local alias for SchemeBuilder.AddToScheme
AddToScheme = SchemeBuilder.AddToScheme
)

func init() {
if err := AddToScheme(scheme.Scheme); err != nil {
panic(err)
}
}

// Adds the list of known types to api.Scheme.
func addKnownTypes(scheme *k8sruntime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&GameServerAllocationPolicy{},
&GameServerAllocationPolicyList{},
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
}
101 changes: 101 additions & 0 deletions pkg/apis/multicluster/v1alpha1/zz_generated.deepcopy.go

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

2 changes: 0 additions & 2 deletions pkg/apis/stable/v1alpha1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ func addKnownTypes(scheme *k8sruntime.Scheme) error {
&FleetAllocationList{},
&GameServerAllocation{},
&GameServerAllocationList{},
&GameServerAllocationPolicy{},
&GameServerAllocationPolicyList{},
&FleetAutoscaler{},
&FleetAutoscalerList{},
)
Expand Down
96 changes: 1 addition & 95 deletions pkg/apis/stable/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 c736ca9

Please sign in to comment.