Skip to content

Commit ff5c039

Browse files
committed
it's now compatible with kcp 0.28
On-behalf-of: @SAP [email protected]
1 parent 8b197c7 commit ff5c039

File tree

3 files changed

+2
-24
lines changed

3 files changed

+2
-24
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ $(YQ):
9898
yq_*
9999

100100
KCP = _tools/kcp
101-
KCP_VERSION = 0.27.1
101+
KCP_VERSION = 0.28.1
102102

103103
.PHONY: $(KCP)
104104
$(KCP):

internal/controller/syncmanager/controller.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package syncmanager
1818

1919
import (
2020
"context"
21-
"errors"
2221
"fmt"
2322

2423
"go.uber.org/zap"
@@ -74,7 +73,7 @@ type Reconciler struct {
7473
stateNamespace string
7574
agentName string
7675

77-
// only one of these two must be set
76+
// endpointSlice is preferred over apiExport
7877
apiExport *kcpapisv1alpha1.APIExport
7978
endpointSlice *kcpapisv1alpha1.APIExportEndpointSlice
8079

@@ -105,8 +104,6 @@ type syncWorker struct {
105104
}
106105

107106
// Add creates a new controller and adds it to the given manager.
108-
//
109-
// Only one of apiExport and endpointSlice must be given.
110107
func Add(
111108
ctx context.Context,
112109
localManager manager.Manager,
@@ -119,13 +116,6 @@ func Add(
119116
stateNamespace string,
120117
agentName string,
121118
) error {
122-
if apiExport != nil && endpointSlice != nil {
123-
return errors.New("this controller works either with APIExport or APIExportEndpointSlice, not both")
124-
}
125-
if apiExport == nil && endpointSlice == nil {
126-
return errors.New("neither APIExport nor APIExportEndpointSlice provided")
127-
}
128-
129119
discoveryClient, err := discovery.NewClient(localManager.GetConfig())
130120
if err != nil {
131121
return fmt.Errorf("failed to create discovery client: %w", err)

test/utils/fixtures.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -129,18 +129,6 @@ func CreateAPIExport(t *testing.T, ctx context.Context, client ctrlruntimeclient
129129
t.Fatalf("Failed to create APIExport: %v", err)
130130
}
131131

132-
err := wait.PollUntilContextTimeout(ctx, 500*time.Millisecond, 30*time.Second, false, func(ctx context.Context) (done bool, err error) {
133-
err = client.Get(ctx, ctrlruntimeclient.ObjectKeyFromObject(apiExport), apiExport)
134-
if err != nil {
135-
return false, err
136-
}
137-
138-
return conditions.IsTrue(apiExport, kcpapisv1alpha1.APIExportVirtualWorkspaceURLsReady), nil
139-
})
140-
if err != nil {
141-
t.Fatalf("Failed to wait for APIExport virtual workspace to become ready: %v", err)
142-
}
143-
144132
// grant permissions to access/manage the APIExport
145133
if rbacSubject != nil {
146134
clusterRoleName := "api-syncagent"

0 commit comments

Comments
 (0)