Skip to content
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
2 changes: 2 additions & 0 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
go-version: v1.25.4
- name: Delete non-semver tags
run: 'git tag -d $(git tag -l | grep -v "^v")'
- name: Set LDFLAGS

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can we also change the version in GIT_VERSION env to match version from release?
it is pinned to v0.0.0 atm eg. kube-bind-v0.0.0-a8dfe3c

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

you want to use this for the image or smth else?

Currently this is the version:

v1.34.0+kube-bind-v0.5.1-58-g18cec9fd6a50c3

run: echo LDFLAGS="$(make ldflags)" >> $GITHUB_ENV
- name: Run GoReleaser on tag
if: github.event_name != 'pull_request'
uses: goreleaser/goreleaser-action@v3
Expand Down
9 changes: 9 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
version: 2

git:
tag_sort: -version:refname
ignore_tags:
- "cli/*"
- "sdk/*"

builds:
- id: "kubectl-bind"
dir: cli
main: ./cmd/kubectl-bind
binary: bin/kubectl-bind
ldflags:
- "{{ .Env.LDFLAGS }}"
goos:
- linux
- darwin
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,11 @@ helm-build-local: ## Build and package Helm charts locally for testing
helm-clean: ## Clean up built helm charts
rm -f ./bin/*.tgz

.PHONY: goreleaser-test
goreleaser-test: ## Test GoReleaser flow locally
@command -v goreleaser >/dev/null 2>&1 || { echo "goreleaser not found. Install from: https://goreleaser.com/install/"; exit 1; }
LDFLAGS="$(LDFLAGS)" goreleaser release --snapshot --clean

.PHONY: helm-push-local
helm-push-local: ## Push Helm charts to IMAGE_REPO registry
@echo "Pushing Helm charts to registry: $(IMAGE_REPO)"
Expand Down
9 changes: 6 additions & 3 deletions docs/content/setup/kubectl-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ The `kubectl bind` plugin is the primary command-line interface for interacting

```bash
# Download and install for Linux/macOS
curl -LO https://github.com/kube-bind/kube-bind/releases/latest/download/kubectl-bind-linux-amd64
chmod +x kubectl-bind-linux-amd64
sudo mv kubectl-bind-linux-amd64 /usr/local/bin/kubectl-bind
OS=$(uname | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/')
VERSION=$(curl -s https://api.github.com/repos/kube-bind/kube-bind/releases/latest | grep '"tag_name"' | cut -d'"' -f4)
curl -LO https://github.com/kube-bind/kube-bind/releases/download/${VERSION}/kubectl-bind_${VERSION#v}_${OS}_${ARCH}.tar.gz
tar -xzf kubectl-bind_${VERSION#v}_${OS}_${ARCH}.tar.gz
sudo mv bin/kubectl-bind /usr/local/bin/kubectl-bind
```

## Basic Usage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (c *controller) enqueueProvider(logger klog.Logger, obj any) {
// Try to map the provider name back to the consumer name,
// but only to check if we "own" the object; we will actually
// enqueue the provider key after all.
consumerKey, err := c.isolationStrategy.ToConsumerKey(types.NamespacedName{
consumerKey, err := c.reconciler.isolationStrategy.ToConsumerKey(types.NamespacedName{
Namespace: ns,
Name: name,
})
Expand Down Expand Up @@ -216,7 +216,7 @@ func (c *controller) enqueueConsumer(logger klog.Logger, obj any) {
return
}

providerKey, err := c.isolationStrategy.ToProviderKey(types.NamespacedName{
providerKey, err := c.reconciler.isolationStrategy.ToProviderKey(types.NamespacedName{
Namespace: ns,
Name: name,
})
Expand Down Expand Up @@ -250,7 +250,7 @@ func (c *controller) enqueueServiceNamespace(logger klog.Logger, obj any) {
return // not for us
}

strategy := c.isolationStrategy.(*isolation.ServiceNamespacedStrategy)
strategy := c.reconciler.isolationStrategy.(*isolation.ServiceNamespacedStrategy)
nsOnProviderCluster, err := strategy.ProviderNamespace(name)
if err != nil {
runtime.HandleError(err)
Expand Down Expand Up @@ -289,7 +289,7 @@ func (c *controller) Start(ctx context.Context, numThreads int) {
// APIServiceNamespaces are only of interest when syncing namespaced
// objects, and since these event handlers need the appropriate isolation
// strategy, we only start them when necessary.
if _, ok := c.isolationStrategy.(*isolation.ServiceNamespacedStrategy); ok {
if _, ok := c.reconciler.isolationStrategy.(*isolation.ServiceNamespacedStrategy); ok {
c.serviceNamespaceInformer.Informer().AddDynamicEventHandler(ctx, controllerName, cache.ResourceEventHandlerFuncs{
AddFunc: func(obj any) {
c.enqueueServiceNamespace(logger, obj)
Expand Down