Skip to content

web: fix bind request format#454

Merged
gman0 merged 1 commit into
kbind-dev:mainfrom
gman0:web-fix-bind-request-format
Feb 3, 2026
Merged

web: fix bind request format#454
gman0 merged 1 commit into
kbind-dev:mainfrom
gman0:web-fix-bind-request-format

Conversation

@gman0

@gman0 gman0 commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

Summary

I've started getting an error I haven't seen before:

Screenshot from 2026-02-03 13-11-11

Snippet from backend logs:

E0203 13:07:24.825942  304155 handler.go:365] "invalid bind request" err="missing cluster identity" method="POST" url="/api/bind?cluster_id=qa4l1c3g0gcx1r02&consumer_id=d36d467f-7e9d-4f1b-8d9e-e0612160c37f"
I0203 13:10:51.839099  304155 manager.go:299] "User is allowed to bind" subject="kube-bind-embedded-user" cluster="qa4l1c3g0gcx1r02" method="POST" path="/api/bind" groups=["engineering","devops"] user="kube-bind-embedded-user"
E0203 13:10:51.839157  304155 handler.go:365] "invalid bind request" err="missing cluster identity" method="POST" url="/api/bind?cluster_id=qa4l1c3g0gcx1r02&consumer_id=d36d467f-7e9d-4f1b-8d9e-e0612160c37f"

After closer inspection, the request payload DOES contain the cluster identity:

https://github.com/kube-bind/kube-bind/blob/ce81e736053180fe0a9e1d4b92d62c095703f504/backend/http/handler.go#L348-L352

{
  "metadata": {
    "name": "cowboys"
  },
  "templateRef": {
    "name": "cowboys"
  },
  "clusterIdentity": {
    "identity": "d36d467f-7e9d-4f1b-8d9e-e0612160c37f"
  }
}

Which, after being unmarshalled into BindableResourcesRequest, results in:

v1alpha2.BindableResourcesRequest{
  TypeMeta:v1.TypeMeta{
    Kind:"",
    APIVersion:""
  },
  ObjectMeta:v1.ObjectMeta{
    Name:"cowboys",
    GenerateName:"",
    Namespace:"",
    SelfLink:"",
    UID:"",
    ResourceVersion:"",
    Generation:0,
    CreationTimestamp:time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC),
    DeletionTimestamp:<nil>,
    DeletionGracePeriodSeconds:(*int64)(nil),
    Labels:map[string]string(nil),
    Annotations:map[string]string(nil),
    OwnerReferences:[]v1.OwnerReference(nil),
    Finalizers:[]string(nil),
    ManagedFields:[]v1.ManagedFieldsEntry(nil)
  },
  Spec:v1alpha2.BindableResourcesRequestSpec{
    TemplateRef:v1alpha2.APIServiceExportTemplateRef{
      Name:""
    },
    ClusterIdentity:v1alpha2.ClusterIdentity{
      Identity:""
    },
    Author:"",
    KubeconfigSecretRef:(*v1alpha2.LocalSecretKeyRef)(nil),
    TTLAfterFinished:(*v1.Duration)(nil)
  },
  Status:v1alpha2.BindableResourcesRequestStatus{
    Phase:"",
    KubeconfigSecretRef:(*v1alpha2.LocalSecretKeyRef)(nil),
    CompletionTime:<nil>,
    Conditions:[]v1.Condition(nil)
  }
}

Clearly, the payload is missing spec dictionary. This PR adds it, and the BindableResourcesRequest struct is now populated correctly.

What Type of PR Is This?

/kind bug

???

Related Issue(s)

Fixes #

Release Notes

NONE

@gman0
gman0 requested a review from a team as a code owner February 3, 2026 12:50
},
clusterIdentity: {
identity: clusterIdentity
spec: {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

web/src/types/binding.ts needs updating

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and author was made required:

// Author is the identifier of the entity that created this binding request.
	// This is used for audit purposes and to track who initiated the binding.
	//
	// +required
	// +kubebuilder:validation:Required
	Author string `json:"author"`

either add placeholder from UI or make it optional

On-behalf-of: @SAP robert.vasek@sap.com
Signed-off-by: Robert Vasek <robert.vasek@clyso.com>
@gman0
gman0 force-pushed the web-fix-bind-request-format branch from d90ddb3 to a4c2242 Compare February 3, 2026 13:52
@gman0
gman0 merged commit 569e737 into kbind-dev:main Feb 3, 2026
7 checks passed
@gman0
gman0 deleted the web-fix-bind-request-format branch February 3, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants