Skip to content
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

Rename PetSet to StatefulSet #35663

Merged
merged 7 commits into from
Oct 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
268 changes: 134 additions & 134 deletions api/openapi-spec/swagger.json

Large diffs are not rendered by default.

168 changes: 84 additions & 84 deletions api/swagger-spec/apps_v1alpha1.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: "apps/v1alpha1"
kind: PetSet
kind: StatefulSet
metadata:
name: calico-etcd
namespace: kube-system
Expand Down
10 changes: 5 additions & 5 deletions cmd/kube-controller-manager/app/controllermanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,15 +440,15 @@ func StartControllers(s *options.CMServer, kubeconfig *restclient.Config, rootCl

groupVersion = "apps/v1alpha1"
resources, found = resourceMap[groupVersion]
glog.Infof("Attempting to start petset, full resource map %+v", resourceMap)
glog.Infof("Attempting to start statefulset, full resource map %+v", resourceMap)
if containsVersion(versions, groupVersion) && found {
glog.Infof("Starting %s apis", groupVersion)
if containsResource(resources, "petsets") {
glog.Infof("Starting PetSet controller")
if containsResource(resources, "statefulsets") {
glog.Infof("Starting StatefulSet controller")
resyncPeriod := ResyncPeriod(s)()
go petset.NewPetSetController(
go petset.NewStatefulSetController(
sharedInformers.Pods().Informer(),
client("petset-controller"),
client("statefulset-controller"),
resyncPeriod,
).Run(1, wait.NeverStop)
time.Sleep(wait.Jitter(s.ControllerStartInterval.Duration, ControllerStartJitter))
Expand Down
1 change: 0 additions & 1 deletion cmd/libs/go2idl/client-gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ func main() {
"k8s.io/kubernetes/pkg/fields",
"k8s.io/kubernetes/pkg/labels",
"k8s.io/kubernetes/pkg/watch",
"k8s.io/kubernetes/pkg/client/unversioned",
"k8s.io/kubernetes/pkg/apimachinery/registered",
}

Expand Down
304 changes: 152 additions & 152 deletions docs/api-reference/apps/v1alpha1/definitions.html

Large diffs are not rendered by default.

98 changes: 49 additions & 49 deletions docs/api-reference/apps/v1alpha1/operations.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions examples/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ func validateObject(obj runtime.Object) (errors field.ErrorList) {
t.Namespace = api.NamespaceDefault
}
errors = expvalidation.ValidateDaemonSet(t)
case *apps.PetSet:
case *apps.StatefulSet:
if t.Namespace == "" {
t.Namespace = api.NamespaceDefault
}
errors = appsvalidation.ValidatePetSet(t)
errors = appsvalidation.ValidateStatefulSet(t)
default:
errors = field.ErrorList{}
errors = append(errors, field.InternalError(field.NewPath(""), fmt.Errorf("no validation defined for %#v", obj)))
Expand Down Expand Up @@ -221,7 +221,7 @@ func TestExampleObjectSchemas(t *testing.T) {
"cassandra-daemonset": &extensions.DaemonSet{},
"cassandra-controller": &api.ReplicationController{},
"cassandra-service": &api.Service{},
"cassandra-petset": &apps.PetSet{},
"cassandra-petset": &apps.StatefulSet{},
},
"../examples/cluster-dns": {
"dns-backend-rc": &api.ReplicationController{},
Expand Down
2 changes: 1 addition & 1 deletion examples/storage/cassandra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ of three pods.

```yaml
apiVersion: "apps/v1alpha1"
kind: PetSet
kind: StatefulSet
metadata:
name: cassandra
spec:
Expand Down
2 changes: 1 addition & 1 deletion examples/storage/cassandra/cassandra-petset.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: "apps/v1alpha1"
kind: PetSet
kind: StatefulSet
metadata:
name: cassandra
spec:
Expand Down
30 changes: 15 additions & 15 deletions hack/make-rules/test-cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ runTests() {
hpa_min_field=".spec.minReplicas"
hpa_max_field=".spec.maxReplicas"
hpa_cpu_field=".spec.targetCPUUtilizationPercentage"
petset_replicas_field=".spec.replicas"
statefulset_replicas_field=".spec.replicas"
job_parallelism_field=".spec.parallelism"
deployment_replicas=".spec.replicas"
secret_data=".data"
Expand Down Expand Up @@ -1185,7 +1185,7 @@ __EOF__
kube::test::if_has_string "${output_message}" "/api/v1/namespaces/default/pods 200 OK"
kube::test::if_has_string "${output_message}" "/api/v1/namespaces/default/replicationcontrollers 200 OK"
kube::test::if_has_string "${output_message}" "/api/v1/namespaces/default/services 200 OK"
kube::test::if_has_string "${output_message}" "/apis/apps/v1alpha1/namespaces/default/petsets 200 OK"
kube::test::if_has_string "${output_message}" "/apis/apps/v1alpha1/namespaces/default/statefulsets 200 OK"
kube::test::if_has_string "${output_message}" "/apis/autoscaling/v1/namespaces/default/horizontalpodautoscalers 200"
kube::test::if_has_string "${output_message}" "/apis/batch/v1/namespaces/default/jobs 200 OK"
kube::test::if_has_string "${output_message}" "/apis/extensions/v1beta1/namespaces/default/deployments 200 OK"
Expand Down Expand Up @@ -2396,33 +2396,33 @@ __EOF__



############
# Pet Sets #
############
#################
# Stateful Sets #
#################

kube::log::status "Testing kubectl(${version}:petsets)"
kube::log::status "Testing kubectl(${version}:statefulsets)"

### Create and stop petset, make sure it doesn't leak pods
# Pre-condition: no petset exists
kube::test::get_object_assert petset "{{range.items}}{{$id_field}}:{{end}}" ''
# Command: create petset
### Create and stop statefulset, make sure it doesn't leak pods
# Pre-condition: no statefulset exists
kube::test::get_object_assert statefulset "{{range.items}}{{$id_field}}:{{end}}" ''
# Command: create statefulset
kubectl create -f hack/testdata/nginx-petset.yaml "${kube_flags[@]}"

### Scale petset test with current-replicas and replicas
### Scale statefulset test with current-replicas and replicas
# Pre-condition: 0 replicas
kube::test::get_object_assert 'petset nginx' "{{$petset_replicas_field}}" '0'
kube::test::get_object_assert 'statefulset nginx' "{{$statefulset_replicas_field}}" '0'
# Command: Scale up
kubectl scale --current-replicas=0 --replicas=1 petset nginx "${kube_flags[@]}"
kubectl scale --current-replicas=0 --replicas=1 statefulset nginx "${kube_flags[@]}"
# Post-condition: 1 replica, named nginx-0
kube::test::get_object_assert 'petset nginx' "{{$petset_replicas_field}}" '1'
kube::test::get_object_assert 'statefulset nginx' "{{$statefulset_replicas_field}}" '1'
# Typically we'd wait and confirm that N>1 replicas are up, but this framework
# doesn't start the scheduler, so pet-0 will block all others.
# TODO: test robust scaling in an e2e.
wait-for-pods-with-label "app=nginx-petset" "nginx-0"

### Clean up
kubectl delete -f hack/testdata/nginx-petset.yaml "${kube_flags[@]}"
# Post-condition: no pods from petset controller
# Post-condition: no pods from statefulset controller
wait-for-pods-with-label "app=nginx-petset" ""


Expand Down
2 changes: 1 addition & 1 deletion hack/testdata/nginx-petset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
app: nginx-petset
---
apiVersion: apps/v1alpha1
kind: PetSet
kind: StatefulSet
metadata:
name: nginx
spec:
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/defaulting_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ func TestDefaulting(t *testing.T) {
{Group: "", Version: "v1", Kind: "SecretList"}: {},
{Group: "", Version: "v1", Kind: "Service"}: {},
{Group: "", Version: "v1", Kind: "ServiceList"}: {},
{Group: "apps", Version: "v1alpha1", Kind: "PetSet"}: {},
{Group: "apps", Version: "v1alpha1", Kind: "PetSetList"}: {},
{Group: "apps", Version: "v1alpha1", Kind: "StatefulSet"}: {},
{Group: "apps", Version: "v1alpha1", Kind: "StatefulSetList"}: {},
{Group: "autoscaling", Version: "v1", Kind: "HorizontalPodAutoscaler"}: {},
{Group: "autoscaling", Version: "v1", Kind: "HorizontalPodAutoscalerList"}: {},
{Group: "batch", Version: "v1", Kind: "Job"}: {},
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/unversioned/group_version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func TestKindForGroupVersionKinds(t *testing.T) {
ok: true,
},
{
input: []GroupVersionKind{{Group: "apps", Version: "v1alpha1", Kind: "PetSet"}},
input: []GroupVersionKind{{Group: "apps", Version: "v1alpha1", Kind: "StatefulSet"}},
target: GroupVersionKind{},
ok: false,
},
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/apps/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ func Resource(resource string) unversioned.GroupResource {
func addKnownTypes(scheme *runtime.Scheme) error {
// TODO this will get cleaned up with the scheme types are fixed
scheme.AddKnownTypes(SchemeGroupVersion,
&PetSet{},
&PetSetList{},
&StatefulSet{},
&StatefulSetList{},
&api.ListOptions{},
&api.DeleteOptions{},
)
Expand Down