mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-13 05:02:50 +00:00
refactor services to v1beta3
This commit is contained in:
@@ -57,7 +57,7 @@ func (e *EndpointController) SyncServiceEndpoints() error {
|
||||
continue
|
||||
}
|
||||
glog.Infof("About to update endpoints for service %v", service.Name)
|
||||
pods, err := e.client.Pods(service.Namespace).List(labels.Set(service.Selector).AsSelector())
|
||||
pods, err := e.client.Pods(service.Namespace).List(labels.Set(service.Spec.Selector).AsSelector())
|
||||
if err != nil {
|
||||
glog.Errorf("Error syncing service: %#v, skipping.", service)
|
||||
resultErr = err
|
||||
@@ -65,7 +65,7 @@ func (e *EndpointController) SyncServiceEndpoints() error {
|
||||
}
|
||||
endpoints := []string{}
|
||||
for _, pod := range pods.Items {
|
||||
port, err := findPort(&pod.DesiredState.Manifest, service.ContainerPort)
|
||||
port, err := findPort(&pod.DesiredState.Manifest, service.Spec.ContainerPort)
|
||||
if err != nil {
|
||||
glog.Errorf("Failed to find port for service: %v, %v", service, err)
|
||||
continue
|
||||
|
@@ -182,8 +182,10 @@ func TestSyncEndpointsItemsPreexisting(t *testing.T) {
|
||||
Items: []api.Service{
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo"},
|
||||
Selector: map[string]string{
|
||||
"foo": "bar",
|
||||
Spec: api.ServiceSpec{
|
||||
Selector: map[string]string{
|
||||
"foo": "bar",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -219,8 +221,10 @@ func TestSyncEndpointsItemsPreexistingIdentical(t *testing.T) {
|
||||
Items: []api.Service{
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo"},
|
||||
Selector: map[string]string{
|
||||
"foo": "bar",
|
||||
Spec: api.ServiceSpec{
|
||||
Selector: map[string]string{
|
||||
"foo": "bar",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -248,8 +252,10 @@ func TestSyncEndpointsItems(t *testing.T) {
|
||||
Items: []api.Service{
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo"},
|
||||
Selector: map[string]string{
|
||||
"foo": "bar",
|
||||
Spec: api.ServiceSpec{
|
||||
Selector: map[string]string{
|
||||
"foo": "bar",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -277,8 +283,10 @@ func TestSyncEndpointsPodError(t *testing.T) {
|
||||
serviceList := api.ServiceList{
|
||||
Items: []api.Service{
|
||||
{
|
||||
Selector: map[string]string{
|
||||
"foo": "bar",
|
||||
Spec: api.ServiceSpec{
|
||||
Selector: map[string]string{
|
||||
"foo": "bar",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
Reference in New Issue
Block a user