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

policy: regenerate Server go bindings #11920

Merged
merged 1 commit into from
Jan 15, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions controller/api/destination/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/linkerd/linkerd2-proxy-api/go/net"
"github.com/linkerd/linkerd2/controller/api/destination/watcher"
"github.com/linkerd/linkerd2/controller/api/util"
"github.com/linkerd/linkerd2/controller/gen/apis/server/v1beta1"
"github.com/linkerd/linkerd2/controller/gen/apis/server/v1beta2"
"github.com/linkerd/linkerd2/controller/k8s"
"github.com/linkerd/linkerd2/pkg/addr"
pkgk8s "github.com/linkerd/linkerd2/pkg/k8s"
Expand Down Expand Up @@ -722,12 +722,12 @@ func TestGetProfiles(t *testing.T) {
}

// Server is created, setting the port to opaque
(*l5dClient).ServerV1beta1().Servers("ns").Create(context.Background(), &v1beta1.Server{
(*l5dClient).ServerV1beta2().Servers("ns").Create(context.Background(), &v1beta2.Server{
ObjectMeta: metav1.ObjectMeta{
Name: "srv-hostport-mapping-2",
Namespace: "ns",
},
Spec: v1beta1.ServerSpec{
Spec: v1beta2.ServerSpec{
PodSelector: &metav1.LabelSelector{
MatchLabels: map[string]string{
"app": "hostport-mapping-2",
Expand Down
2 changes: 1 addition & 1 deletion controller/api/destination/test_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ spec:
name: http
protocol: TCP`,
`
apiVersion: policy.linkerd.io/v1beta1
apiVersion: policy.linkerd.io/v1beta2
kind: Server
metadata:
name: srv
Expand Down
14 changes: 7 additions & 7 deletions controller/api/destination/watcher/endpoints_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"sync"
"time"

"github.com/linkerd/linkerd2/controller/gen/apis/server/v1beta1"
"github.com/linkerd/linkerd2/controller/gen/apis/server/v1beta2"
"github.com/linkerd/linkerd2/controller/k8s"
consts "github.com/linkerd/linkerd2/pkg/k8s"
"github.com/prometheus/client_golang/prometheus"
Expand Down Expand Up @@ -506,15 +506,15 @@ func (ew *EndpointsWatcher) getServicePublisher(id ServiceID) (sp *servicePublis
func (ew *EndpointsWatcher) addServer(obj interface{}) {
ew.Lock()
defer ew.Unlock()
server := obj.(*v1beta1.Server)
server := obj.(*v1beta2.Server)
for _, sp := range ew.publishers {
sp.updateServer(server, true)
}
}

func (ew *EndpointsWatcher) updateServer(oldObj interface{}, newObj interface{}) {
oldServer := oldObj.(*v1beta1.Server)
newServer := newObj.(*v1beta1.Server)
oldServer := oldObj.(*v1beta2.Server)
newServer := newObj.(*v1beta2.Server)
oldUpdated := latestUpdated(oldServer.ManagedFields)
updated := latestUpdated(newServer.ManagedFields)
if !updated.IsZero() && updated != oldUpdated {
Expand All @@ -528,7 +528,7 @@ func (ew *EndpointsWatcher) updateServer(oldObj interface{}, newObj interface{})
func (ew *EndpointsWatcher) deleteServer(obj interface{}) {
ew.Lock()
defer ew.Unlock()
server := obj.(*v1beta1.Server)
server := obj.(*v1beta2.Server)
for _, sp := range ew.publishers {
sp.updateServer(server, false)
}
Expand Down Expand Up @@ -700,7 +700,7 @@ func (sp *servicePublisher) metricsLabels(port Port, hostname string) prometheus
return endpointsLabels(sp.cluster, sp.id.Namespace, sp.id.Name, strconv.Itoa(int(port)), hostname)
}

func (sp *servicePublisher) updateServer(server *v1beta1.Server, isAdd bool) {
func (sp *servicePublisher) updateServer(server *v1beta2.Server, isAdd bool) {
sp.Lock()
defer sp.Unlock()

Expand Down Expand Up @@ -1181,7 +1181,7 @@ func (pp *portPublisher) unsubscribe(listener EndpointUpdateListener) {
pp.metrics.setSubscribers(len(pp.listeners))
}

func (pp *portPublisher) updateServer(server *v1beta1.Server, selector labels.Selector, isAdd bool) {
func (pp *portPublisher) updateServer(server *v1beta2.Server, selector labels.Selector, isAdd bool) {
updated := false
for id, address := range pp.addresses.Addresses {
if address.Pod != nil && selector.Matches(labels.Set(address.Pod.Labels)) {
Expand Down
6 changes: 3 additions & 3 deletions controller/api/destination/watcher/pod_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"sync"
"time"

"github.com/linkerd/linkerd2/controller/gen/apis/server/v1beta1"
"github.com/linkerd/linkerd2/controller/gen/apis/server/v1beta2"
"github.com/linkerd/linkerd2/controller/k8s"
consts "github.com/linkerd/linkerd2/pkg/k8s"
"github.com/linkerd/linkerd2/pkg/util"
Expand Down Expand Up @@ -229,8 +229,8 @@ func (pw *PodWatcher) submitPodUpdate(pod *corev1.Pod, remove bool) {
}

func (pw *PodWatcher) updateServer(oldObj interface{}, newObj interface{}) {
oldServer := oldObj.(*v1beta1.Server)
newServer := newObj.(*v1beta1.Server)
oldServer := oldObj.(*v1beta2.Server)
newServer := newObj.(*v1beta2.Server)

oldUpdated := latestUpdated(oldServer.ManagedFields)
updated := latestUpdated(newServer.ManagedFields)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// +k8s:deepcopy-gen=package

package v1beta1
package v1beta2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package v1beta1
package v1beta2

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -13,7 +13,7 @@ var (
// of the group and the version of the API.
SchemeGroupVersion = schema.GroupVersion{
Group: server.GroupName,
Version: "v1beta1",
Version: "v1beta2",
}

// SchemeBuilder collects functions that add things to a scheme. It's to
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package v1beta1
package v1beta2

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -29,9 +29,10 @@ type Server struct {

// ServerSpec specifies a Server resource.
type ServerSpec struct {
PodSelector *metav1.LabelSelector `json:"podSelector"`
Port intstr.IntOrString `json:"port,omitempty"`
ProxyProtocol string `json:"proxyProtocol,omitempty"`
PodSelector *metav1.LabelSelector `json:"podSelector"`
ExternalWorkloadSelector *metav1.LabelSelector `json:"externalWorkloadSelector"`
Port intstr.IntOrString `json:"port,omitempty"`
ProxyProtocol string `json:"proxyProtocol,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down

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

16 changes: 8 additions & 8 deletions controller/gen/client/clientset/versioned/clientset.go

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

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

4 changes: 2 additions & 2 deletions controller/gen/client/clientset/versioned/fake/register.go

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

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

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

Loading
Loading