Skip to content
This repository was archived by the owner on Jun 22, 2023. It is now read-only.

Commit 828688e

Browse files
Allow creating multiple bindings with same name
1 parent acadbbe commit 828688e

File tree

1 file changed

+2
-1
lines changed
  • cmd/kcp-catalog/bind/catalogentry

1 file changed

+2
-1
lines changed

cmd/kcp-catalog/bind/catalogentry/bind.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import (
3434
"k8s.io/apimachinery/pkg/runtime"
3535
"k8s.io/apimachinery/pkg/types"
3636
utilerrors "k8s.io/apimachinery/pkg/util/errors"
37+
utilrand "k8s.io/apimachinery/pkg/util/rand"
3738
"k8s.io/apimachinery/pkg/util/wait"
3839
"k8s.io/cli-runtime/pkg/genericclioptions"
3940
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -144,7 +145,7 @@ func (b *BindOptions) Run(ctx context.Context) error {
144145

145146
apiBinding := &apisv1alpha1.APIBinding{
146147
ObjectMeta: metav1.ObjectMeta{
147-
Name: ref.Workspace.ExportName,
148+
Name: fmt.Sprintf("%s-%s", ref.Workspace.ExportName, utilrand.String(10)),
148149
},
149150
Spec: apisv1alpha1.APIBindingSpec{
150151
Reference: ref,

0 commit comments

Comments
 (0)