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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ linters:
- staticcheck
text: QF1008 # "could remove embedded field" often impedes readability and clarity
paths:
- third_party$
- builtin$
- examples$
- third_party
# TODO(embik): this is a blanket ignore specifically because of github.com/dev-kcp/client-go.
- listers
issues:
max-issues-per-linter: 0
max-same-issues: 0
Expand Down
2 changes: 2 additions & 0 deletions .prow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ presubmits:
value: '2'
- name: E2E_PARALLELISM
value: '3'
- name: TEST_ARGS
value: '-timeout 20m'
resources:
requests:
memory: 6Gi
Expand Down
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ COPY sdk/go.mod sdk/go.mod
COPY sdk/go.sum sdk/go.sum
COPY cli/go.mod cli/go.mod
COPY cli/go.sum cli/go.sum
COPY staging/src/github.com/kcp-dev/apimachinery/go.mod staging/src/github.com/kcp-dev/apimachinery/go.mod
COPY staging/src/github.com/kcp-dev/apimachinery/go.sum staging/src/github.com/kcp-dev/apimachinery/go.sum
COPY staging/src/github.com/kcp-dev/client-go/go.mod staging/src/github.com/kcp-dev/client-go/go.mod
COPY staging/src/github.com/kcp-dev/client-go/go.sum staging/src/github.com/kcp-dev/client-go/go.sum
COPY staging/src/github.com/kcp-dev/code-generator/go.mod staging/src/github.com/kcp-dev/code-generator/go.mod
COPY staging/src/github.com/kcp-dev/code-generator/go.sum staging/src/github.com/kcp-dev/code-generator/go.sum
USER 0

# Install kubectl.
Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ $(KCP_APIGEN_GEN):
lint: $(GOLANGCI_LINT) $(LOGCHECK) ## Verify lint
echo "Linting root module..."; \
$(GOLANGCI_LINT) run $(GOLANGCI_LINT_FLAGS) -c $(ROOT_DIR)/.golangci.yaml --timeout 20m
for MOD in $$(git ls-files '**/go.mod' | sed 's,/go.mod,,'); do \
# TODO(embik): stop skipping lint for staging repositories
for MOD in $$(git ls-files '**/go.mod' | sed 's,/go.mod,,' | grep -v staging); do \
if [ "$$MOD" != "." ]; then \
echo "Linting $$MOD module..."; \
(cd $$MOD && $(GOLANGCI_LINT) run $(GOLANGCI_LINT_FLAGS) -c $(ROOT_DIR)/.golangci.yaml --timeout 20m); \
Expand Down Expand Up @@ -251,9 +252,10 @@ $(TOOLS_DIR)/verify_boilerplate.py:
curl --fail --retry 3 -L -o $(TOOLS_DIR)/verify_boilerplate.py https://raw.githubusercontent.com/kubernetes/repo-infra/201dcad9616c117927232ee0bc499ff38a27023e/hack/verify_boilerplate.py
chmod +x $(TOOLS_DIR)/verify_boilerplate.py


.PHONY: verify-boilerplate
verify-boilerplate: $(TOOLS_DIR)/verify_boilerplate.py ## Verify boilerplate
$(TOOLS_DIR)/verify_boilerplate.py --boilerplate-dir=hack/boilerplate --skip docs/venv --skip pkg/network/dialer
$(TOOLS_DIR)/verify_boilerplate.py --boilerplate-dir=hack/boilerplate --skip docs/venv --skip pkg/network/dialer --skip staging/src

ifdef ARTIFACT_DIR
GOTESTSUM_ARGS += --junitfile=$(ARTIFACT_DIR)/junit.xml
Expand Down
5 changes: 4 additions & 1 deletion cli/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,7 @@ require (
sigs.k8s.io/yaml v1.4.0 // indirect
)

replace github.com/kcp-dev/kcp/sdk => ../sdk
replace (
github.com/kcp-dev/client-go => ../staging/src/github.com/kcp-dev/client-go
github.com/kcp-dev/kcp/sdk => ../sdk
)
2 changes: 0 additions & 2 deletions cli/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/kcp-dev/apimachinery/v2 v2.0.1-0.20250728122101-adbf20db3e51 h1:l38RDS+VUMx9etvyaCgJIZa4nM7FaNevNubWN0kDZY4=
github.com/kcp-dev/apimachinery/v2 v2.0.1-0.20250728122101-adbf20db3e51/go.mod h1:rF1jfvUfPjFXs+HV/LN1BtPzAz1bfjJOwVa+hAVfroQ=
github.com/kcp-dev/client-go v0.0.0-20250728134101-0355faa9361b h1:2LGrXvY9sc4l5yjKIbMZ86GEou7NyrHhA4qBPaeFfxs=
github.com/kcp-dev/client-go v0.0.0-20250728134101-0355faa9361b/go.mod h1:QdO8AaGAZPr/rIZ1iVanCM3tUOiiuX897GWv7WTByLE=
github.com/kcp-dev/logicalcluster/v3 v3.0.5 h1:JbYakokb+5Uinz09oTXomSUJVQsqfxEvU4RyHUYxHOU=
github.com/kcp-dev/logicalcluster/v3 v3.0.5/go.mod h1:EWBUBxdr49fUB1cLMO4nOdBWmYifLbP1LfoL20KkXYY=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
Expand Down
6 changes: 1 addition & 5 deletions docs/generators/cli-doc/go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
eel.dev/expr v0.19.1 h1:NciYrtDRIR0lNCnH1LFJegdjspNx9fI59O7TWcua/W4=
cel.dev/expr v0.19.1 h1:NciYrtDRIR0lNCnH1LFJegdjspNx9fI59O7TWcua/W4=
cel.dev/expr v0.19.1/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw=
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0=
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
Expand Down Expand Up @@ -61,10 +61,6 @@ github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8Hm
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/kcp-dev/apimachinery/v2 v2.0.1-0.20250512171935-ebb573a40077 h1:lDi9nZ75ypmRJwDFXUN70Cdu8+HxAjPU1kcnn+l4MvI=
github.com/kcp-dev/apimachinery/v2 v2.0.1-0.20250512171935-ebb573a40077/go.mod h1:jnMZxVnCuKlkIXc4J1Qtmy1Lyo171CDF/RQhNAo0tvA=
github.com/kcp-dev/client-go v0.0.0-20250707095244-decc4df45adb h1:PTfc4FGjz1Dx+6epz92G4RJj3BYrqg0+XYTiGJQR1cc=
github.com/kcp-dev/client-go v0.0.0-20250707095244-decc4df45adb/go.mod h1:iv3cC1ShwBGzFfNjB+6KWvZviWPe6+MbRlQ7SZoZPFc=
github.com/kcp-dev/apimachinery/v2 v2.0.1-0.20250728122101-adbf20db3e51 h1:l38RDS+VUMx9etvyaCgJIZa4nM7FaNevNubWN0kDZY4=
github.com/kcp-dev/apimachinery/v2 v2.0.1-0.20250728122101-adbf20db3e51/go.mod h1:rF1jfvUfPjFXs+HV/LN1BtPzAz1bfjJOwVa+hAVfroQ=
github.com/kcp-dev/client-go v0.0.0-20250728134101-0355faa9361b h1:2LGrXvY9sc4l5yjKIbMZ86GEou7NyrHhA4qBPaeFfxs=
Expand Down
6 changes: 6 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,9 @@ replace (
k8s.io/sample-cli-plugin => github.com/kcp-dev/kubernetes/staging/src/k8s.io/sample-cli-plugin v0.0.0-20251003054701-d4b0368d53f0
k8s.io/sample-controller => github.com/kcp-dev/kubernetes/staging/src/k8s.io/sample-controller v0.0.0-20251003054701-d4b0368d53f0
)

replace (
github.com/kcp-dev/apimachinery/v2 => ./staging/src/github.com/kcp-dev/apimachinery
github.com/kcp-dev/client-go => ./staging/src/github.com/kcp-dev/client-go
github.com/kcp-dev/code-generator/v3 => ./staging/src/github.com/kcp-dev/code-generator
)
6 changes: 0 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,6 @@ github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8Hm
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/kcp-dev/apimachinery/v2 v2.0.1-0.20250728122101-adbf20db3e51 h1:l38RDS+VUMx9etvyaCgJIZa4nM7FaNevNubWN0kDZY4=
github.com/kcp-dev/apimachinery/v2 v2.0.1-0.20250728122101-adbf20db3e51/go.mod h1:rF1jfvUfPjFXs+HV/LN1BtPzAz1bfjJOwVa+hAVfroQ=
github.com/kcp-dev/client-go v0.0.0-20250728134101-0355faa9361b h1:2LGrXvY9sc4l5yjKIbMZ86GEou7NyrHhA4qBPaeFfxs=
github.com/kcp-dev/client-go v0.0.0-20250728134101-0355faa9361b/go.mod h1:QdO8AaGAZPr/rIZ1iVanCM3tUOiiuX897GWv7WTByLE=
github.com/kcp-dev/code-generator/v3 v3.0.0-20250728122101-5b4ff5c24054 h1:yEt2JpW+bXYPHDDVp7CYBSj2QCfT3Hja5q+9uQrqn38=
github.com/kcp-dev/code-generator/v3 v3.0.0-20250728122101-5b4ff5c24054/go.mod h1:PZBfAWJtztxgGCiIjH+txB7aZbMBUOCN5HFms7h7CwE=
github.com/kcp-dev/embeddedetcd v1.0.3-0.20250805142358-a4839a83564a h1:P2+BWZW1yzo/TEOgKcdLgDMhJuXwH6Yv79vji+ikfRk=
github.com/kcp-dev/embeddedetcd v1.0.3-0.20250805142358-a4839a83564a/go.mod h1:/rP5E1xbbdx0MhSh1vKHzIzDadKgE91FGpNYpngtks0=
github.com/kcp-dev/kubernetes v0.0.0-20251003054701-d4b0368d53f0 h1:mAHGMA1n4fyssJa9uoelo0AvaDcF8zhX7rZYutDXZmE=
Expand Down
5 changes: 5 additions & 0 deletions sdk/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,8 @@ require (
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 // indirect
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
)

replace (
github.com/kcp-dev/apimachinery/v2 => ../staging/src/github.com/kcp-dev/apimachinery
github.com/kcp-dev/client-go => ../staging/src/github.com/kcp-dev/client-go
)
4 changes: 0 additions & 4 deletions sdk/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@ github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8Hm
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/kcp-dev/apimachinery/v2 v2.0.1-0.20250728122101-adbf20db3e51 h1:l38RDS+VUMx9etvyaCgJIZa4nM7FaNevNubWN0kDZY4=
github.com/kcp-dev/apimachinery/v2 v2.0.1-0.20250728122101-adbf20db3e51/go.mod h1:rF1jfvUfPjFXs+HV/LN1BtPzAz1bfjJOwVa+hAVfroQ=
github.com/kcp-dev/client-go v0.0.0-20250728134101-0355faa9361b h1:2LGrXvY9sc4l5yjKIbMZ86GEou7NyrHhA4qBPaeFfxs=
github.com/kcp-dev/client-go v0.0.0-20250728134101-0355faa9361b/go.mod h1:QdO8AaGAZPr/rIZ1iVanCM3tUOiiuX897GWv7WTByLE=
github.com/kcp-dev/logicalcluster/v3 v3.0.5 h1:JbYakokb+5Uinz09oTXomSUJVQsqfxEvU4RyHUYxHOU=
github.com/kcp-dev/logicalcluster/v3 v3.0.5/go.mod h1:EWBUBxdr49fUB1cLMO4nOdBWmYifLbP1LfoL20KkXYY=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ package cache
import (
"fmt"

"github.com/kcp-dev/logicalcluster/v3"

"k8s.io/apimachinery/pkg/api/meta"

"github.com/kcp-dev/logicalcluster/v3"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ package cache
import (
"testing"

"github.com/kcp-dev/logicalcluster/v3"
"github.com/stretchr/testify/require"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/kcp-dev/logicalcluster/v3"
)

func TestClusterIndexFunc(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ package cache
import (
"context"

"github.com/kcp-dev/logicalcluster/v3"

"k8s.io/client-go/tools/cache"

"github.com/kcp-dev/logicalcluster/v3"
)

// ScopeableSharedIndexInformer is an informer that knows how to scope itself down to one cluster,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import (
"fmt"
"strings"

"github.com/kcp-dev/logicalcluster/v3"

"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/client-go/tools/cache"

"github.com/kcp-dev/logicalcluster/v3"
)

// DeletionHandlingMetaClusterNamespaceKeyFunc checks for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ import (
"testing"

"github.com/google/go-cmp/cmp"
"github.com/kcp-dev/logicalcluster/v3"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/tools/cache"

"github.com/kcp-dev/logicalcluster/v3"
)

func TestDeletionHandlingMetaClusterNamespaceKeyFunc(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ limitations under the License.
package cache

import (
"github.com/kcp-dev/logicalcluster/v3"

"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -28,6 +26,8 @@ import (
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/client-go/tools/cache"
"k8s.io/klog/v2"

"github.com/kcp-dev/logicalcluster/v3"
)

// ListAllByCluster used to list items belongs to a cluster from Indexer.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ package cache
import (
"testing"

"github.com/kcp-dev/logicalcluster/v3"
"github.com/stretchr/testify/require"

"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/tools/cache"

"github.com/kcp-dev/logicalcluster/v3"
)

func newUnstructured(cluster, namespace, name string, labels labels.Set) *unstructured.Unstructured {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ limitations under the License.
package client

import (
"github.com/kcp-dev/logicalcluster/v3"

"k8s.io/client-go/rest"

"github.com/kcp-dev/logicalcluster/v3"
)

// SetCluster modifies the config host path to include the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"net/http"
"sync"

"github.com/kcp-dev/logicalcluster/v3"

"k8s.io/client-go/rest"

"github.com/kcp-dev/logicalcluster/v3"
)

// Constructor is a wrapper around a constructor method for the client of type R.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@ import (
"sync"
"time"

"github.com/kcp-dev/logicalcluster/v3"

utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/client-go/tools/cache"

kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache"
"github.com/kcp-dev/logicalcluster/v3"
)

// scopedSharedIndexInformer ensures that event handlers added to the underlying
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import (
"sync"
"time"

"github.com/kcp-dev/logicalcluster/v3"

"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
Expand All @@ -39,6 +37,7 @@ import (
"k8s.io/utils/ptr"

kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache"
"github.com/kcp-dev/logicalcluster/v3"
)

// Optional configuration options for [SharedInformer.AddEventHandlerWithOptions].
Expand Down

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.

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