Skip to content

Commit

Permalink
DS: changes to server and storage
Browse files Browse the repository at this point in the history
  • Loading branch information
foxish committed Jul 25, 2017
1 parent 55e968d commit 14d5793
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/kube-apiserver/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,9 @@ func BuildStorageFactory(s *options.ServerRunOptions) (*serverstorage.DefaultSto
return nil, fmt.Errorf("error in initializing storage factory: %s", err)
}

// keep Deployments and NetworkPolicies in extensions for backwards compatibility, we'll have to migrate at some point, eventually
// keep Deployments, NetworkPolicies and Daemonsets in extensions for backwards compatibility, we'll have to migrate at some point, eventually
storageFactory.AddCohabitatingResources(extensions.Resource("deployments"), apps.Resource("deployments"))
storageFactory.AddCohabitatingResources(extensions.Resource("daemonsets"), apps.Resource("daemonsets"))
storageFactory.AddCohabitatingResources(extensions.Resource("networkpolicies"), networking.Resource("networkpolicies"))
for _, override := range s.Etcd.EtcdServersOverrides {
tokens := strings.Split(override, "#")
Expand Down
6 changes: 6 additions & 0 deletions pkg/registry/apps/rest/storage_apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"k8s.io/kubernetes/pkg/apis/apps"
controllerrevisionsstore "k8s.io/kubernetes/pkg/registry/apps/controllerrevision/storage"
statefulsetstore "k8s.io/kubernetes/pkg/registry/apps/statefulset/storage"
daemonsetstore "k8s.io/kubernetes/pkg/registry/extensions/daemonset/storage"
deploymentstore "k8s.io/kubernetes/pkg/registry/extensions/deployment/storage"
)

Expand Down Expand Up @@ -88,6 +89,11 @@ func (p RESTStorageProvider) v1beta2Storage(apiResourceConfigSource serverstorag
storage["statefulsets"] = statefulsetStorage
storage["statefulsets/status"] = statefulsetStatusStorage
}
if apiResourceConfigSource.ResourceEnabled(version.WithResource("daemonsets")) {
daemonSetStorage, daemonSetStatusStorage := daemonsetstore.NewREST(restOptionsGetter)
storage["daemonsets"] = daemonSetStorage
storage["daemonsets/status"] = daemonSetStatusStorage
}
return storage
}

Expand Down
2 changes: 2 additions & 0 deletions staging/src/k8s.io/api/apps/v1beta2/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&Scale{},
&StatefulSet{},
&StatefulSetList{},
&DaemonSet{},
&DaemonSetList{},
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
Expand Down
5 changes: 5 additions & 0 deletions test/integration/etcd/etcd_storage_path_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ var etcdStorageData = map[schema.GroupVersionResource]struct {
expectedEtcdPath: "/registry/deployments/etcdstoragepathtestnamespace/deployment3",
expectedGVK: gvkP("extensions", "v1beta1", "Deployment"),
},
gvr("apps", "v1beta2", "daemonsets"): {
stub: `{"metadata": {"name": "ds5"}, "spec": {"selector": {"matchLabels": {"a": "b"}}, "template": {"metadata": {"labels": {"a": "b"}}, "spec": {"containers": [{"image": "fedora:latest", "name": "container6"}]}}}}`,
expectedEtcdPath: "/registry/daemonsets/etcdstoragepathtestnamespace/ds5",
expectedGVK: gvkP("extensions", "v1beta1", "DaemonSet"),
},
// --

// k8s.io/kubernetes/pkg/apis/autoscaling/v1
Expand Down

0 comments on commit 14d5793

Please sign in to comment.