Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2e94176
BUMP: update golang to 1.20
sttts Oct 7, 2023
cee4183
go.mod
sttts Sep 17, 2023
448c6ab
Rebase to 1.28
sttts Oct 7, 2023
08a7af7
Delete CEL APIConversion
sttts Sep 17, 2023
7b33619
BORING: sync feature gates with upstream
sttts Sep 17, 2023
619f58f
BORING: server: update admission list
sttts Sep 26, 2023
25db331
EASY: server: update storage registries, exclude some
sttts Sep 26, 2023
9cc873c
BORING: mini-aggregator: adapt to v1.28 changes
sttts Sep 26, 2023
3b71c57
INTERESTING: (non-cluster) discovery client used by CEL admission
sttts Sep 26, 2023
861db95
EASY: server: move WithAuditEventClusterAnnotation after preHandlerMu…
sttts Sep 26, 2023
bc4d7cd
EASY: admission: reference LocalAdminCluster instead of system:admin
sttts Sep 26, 2023
d6ca9d6
INTERESTING: remove limitranges from the default kcp APIs, to be move…
sttts Sep 27, 2023
7991057
EASY: apiextensions clients from client-go
sttts Sep 27, 2023
39c6560
EASY: cache-server: adapt to renamed ShardAnnotationKey
sttts Sep 27, 2023
d1aadd8
EASY: server: adapt to removal of special generic core scheme
sttts Sep 27, 2023
76f1934
EASY: codegen/applyconfiguration: remove apiextensionsv1 input dir to…
sttts Oct 7, 2023
02ebb6d
make codegen
sttts Oct 7, 2023
492f3e2
Bump golangci-lint to 1.54.2 for golang 1.20 compatibility
sttts Oct 7, 2023
3889e2b
EASY: virtual/framework: fix openapi handler
sttts Oct 7, 2023
b90fe8d
EASY: server: update allowed/disallowed flags
mjudeikis Sep 30, 2023
4605626
EASY: informers: update built-in GVKs, scheme is bigger now
mjudeikis Sep 30, 2023
2defdf2
EASY: admission/apiresourceschema: adapt to new validation fields
mjudeikis Sep 30, 2023
8a1316d
e2e/authorizer: fix service account test to manually create token secret
sttts Oct 7, 2023
0010628
EASY: virtual/apiexport: add status to built-in validatingadmissionpo…
mjudeikis Oct 7, 2023
0c24100
Fix linting
sttts Oct 8, 2023
bc29b0d
WTF: cliplugins/workspace/plugin: fix unit test
sttts Oct 8, 2023
c86c5f6
SQUASH: schema import fix
mjudeikis Oct 8, 2023
19f76b8
CICD: update golang base image to .120
mjudeikis Oct 8, 2023
762df29
CICD: Fix codegen
mjudeikis Oct 8, 2023
ea6fd03
Makefile: increase golangci-lint timeout to 10m
sttts Oct 8, 2023
b7c837b
Makefile: bump logcheck
sttts Oct 8, 2023
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: 1 addition & 1 deletion .github/workflows/docs-gen-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

- uses: actions/setup-go@v4
with:
go-version: v1.19
go-version: v1.20
cache: true

- uses: actions/setup-python@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version: v1.19
go-version: v1.20
- name: Delete non-semver tags
run: 'git tag -d $(git tag -l | grep -v "^v")'
- name: Set LDFLAGS
Expand Down
1 change: 0 additions & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ linters:
- bidichk
- bodyclose
- containedctx
- depguard
- dupword
- durationcheck
- errcheck
Expand Down
16 changes: 8 additions & 8 deletions .prow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ presubmits:
preset-goproxy: "true"
spec:
containers:
- image: ghcr.io/kcp-dev/infra/build:1.19.9-2
- image: ghcr.io/kcp-dev/infra/build:1.20.8-1
command:
- make
- verify-boilerplate
Expand All @@ -27,7 +27,7 @@ presubmits:
preset-goproxy: "true"
spec:
containers:
- image: ghcr.io/kcp-dev/infra/build:1.19.9-2
- image: ghcr.io/kcp-dev/infra/build:1.20.8-1
command:
- make
- verify-codegen
Expand All @@ -44,7 +44,7 @@ presubmits:
preset-goproxy: "true"
spec:
containers:
- image: ghcr.io/kcp-dev/infra/build:1.19.9-2
- image: ghcr.io/kcp-dev/infra/build:1.20.8-1
command:
- make
- lint
Expand Down Expand Up @@ -83,7 +83,7 @@ presubmits:
preset-goproxy: "true"
spec:
containers:
- image: ghcr.io/kcp-dev/infra/build:1.19.9-2
- image: ghcr.io/kcp-dev/infra/build:1.20.8-1
command:
- make
- test
Expand All @@ -103,7 +103,7 @@ presubmits:
preset-goproxy: "true"
spec:
containers:
- image: ghcr.io/kcp-dev/infra/build:1.19.9-2
- image: ghcr.io/kcp-dev/infra/build:1.20.8-1
command:
- ./hack/run-with-prometheus.sh
- make
Expand All @@ -130,7 +130,7 @@ presubmits:
preset-goproxy: "true"
spec:
containers:
- image: ghcr.io/kcp-dev/infra/build:1.19.9-2
- image: ghcr.io/kcp-dev/infra/build:1.20.8-1
command:
- ./hack/run-with-prometheus.sh
- make
Expand Down Expand Up @@ -159,7 +159,7 @@ presubmits:
preset-goproxy: "true"
spec:
containers:
- image: ghcr.io/kcp-dev/infra/build:1.19.9-2
- image: ghcr.io/kcp-dev/infra/build:1.20.8-1
command:
- ./hack/run-with-prometheus.sh
- make
Expand All @@ -184,7 +184,7 @@ presubmits:
preset-goproxy: "true"
spec:
containers:
- image: ghcr.io/kcp-dev/infra/build:1.19.9-2
- image: ghcr.io/kcp-dev/infra/build:1.20.8-1
command:
- ./hack/run-with-prometheus.sh
- make
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.

# Build the binary
FROM --platform=${BUILDPLATFORM} docker.io/golang:1.19 AS builder
FROM --platform=${BUILDPLATFORM} docker.io/golang:1.20 AS builder
WORKDIR /workspace

# Install dependencies.
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,19 @@ OPENSHIFT_GOIMPORTS_BIN := openshift-goimports
OPENSHIFT_GOIMPORTS := $(TOOLS_DIR)/$(OPENSHIFT_GOIMPORTS_BIN)-$(OPENSHIFT_GOIMPORTS_VER)
export OPENSHIFT_GOIMPORTS # so hack scripts can use it

GOLANGCI_LINT_VER := v1.50.1
GOLANGCI_LINT_VER := v1.54.2
GOLANGCI_LINT_BIN := golangci-lint
GOLANGCI_LINT := $(TOOLS_GOBIN_DIR)/$(GOLANGCI_LINT_BIN)-$(GOLANGCI_LINT_VER)

STATICCHECK_VER := 2022.1
STATICCHECK_VER := 2023.1
STATICCHECK_BIN := staticcheck
STATICCHECK := $(TOOLS_GOBIN_DIR)/$(STATICCHECK_BIN)-$(STATICCHECK_VER)

GOTESTSUM_VER := v1.8.1
GOTESTSUM_BIN := gotestsum
GOTESTSUM := $(abspath $(TOOLS_DIR))/$(GOTESTSUM_BIN)-$(GOTESTSUM_VER)

LOGCHECK_VER := v0.4.0
LOGCHECK_VER := v0.7.0
LOGCHECK_BIN := logcheck
LOGCHECK := $(TOOLS_GOBIN_DIR)/$(LOGCHECK_BIN)-$(LOGCHECK_VER)
export LOGCHECK # so hack scripts can use it
Expand Down Expand Up @@ -141,7 +141,7 @@ $(CODE_GENERATOR):
GOBIN=$(TOOLS_GOBIN_DIR) $(GO_INSTALL) github.com/kcp-dev/code-generator/v2 $(CODE_GENERATOR_BIN) $(CODE_GENERATOR_VER)

lint: $(GOLANGCI_LINT) $(STATICCHECK) $(LOGCHECK) ## Verify lint
$(GOLANGCI_LINT) run ./...
$(GOLANGCI_LINT) run --timeout 10m ./...
$(STATICCHECK) -checks ST1019,ST1005 ./...
./hack/verify-contextual-logging.sh
.PHONY: lint
Expand Down
4 changes: 0 additions & 4 deletions cmd/cache-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ package main

import (
"flag"
"math/rand"
"os"
"strings"
"time"

"github.com/spf13/cobra"

Expand All @@ -36,8 +34,6 @@ import (
)

func main() {
rand.Seed(time.Now().UTC().UnixNano())

rootDir := flag.String("root-directory", ".kcp-cache", "Path to the root directory where all files required by this server will be stored")

var cacheServerFlags, remainingFlags []string //nolint:prealloc
Expand Down
4 changes: 0 additions & 4 deletions cmd/kcp-core/kcpcore.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ package main

import (
"fmt"
"math/rand"
"os"
"strings"
"time"

"github.com/spf13/cobra"

Expand All @@ -46,8 +44,6 @@ import (
)

func main() {
rand.Seed(time.Now().UTC().UnixNano())

cmd := &cobra.Command{
Use: "kcp-core",
Short: "kcp control plane core",
Expand Down
4 changes: 0 additions & 4 deletions cmd/kcp-front-proxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ package main
import (
"context"
goflags "flag"
"math/rand"
"net/http"
"os"
"time"

"github.com/spf13/cobra"
"github.com/spf13/pflag"
Expand All @@ -43,8 +41,6 @@ import (
func main() {
ctx := genericapiserver.SetupSignalContext()

rand.Seed(time.Now().UTC().UnixNano())

pflag.CommandLine.SetNormalizeFunc(utilflag.WordSepNormalizeFunc)
pflag.CommandLine.AddGoFlagSet(goflags.CommandLine)

Expand Down
4 changes: 0 additions & 4 deletions cmd/kcp/kcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ package main

import (
"fmt"
"math/rand"
"os"
"strings"
"time"

"github.com/spf13/cobra"

Expand All @@ -46,8 +44,6 @@ import (
)

func main() {
rand.Seed(time.Now().UTC().UnixNano())

cmd := &cobra.Command{
Use: "kcp",
Short: "Kube for Control Plane (KCP)",
Expand Down
2 changes: 1 addition & 1 deletion cmd/sharded-test-server/virtual.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ func (v *VirtualWorkspace) waitForReady(ctx context.Context) (<-chan error, erro
vwHost := fmt.Sprintf("https://%s", net.JoinHostPort("localhost", virtualWorkspacePort(v.index)))
kubeconfigPath := filepath.Join(v.workDirPath, fmt.Sprintf(".kcp-virtual-workspaces-%d/virtualworkspace.kubeconfig", v.index))

if err := wait.PollImmediateInfiniteWithContext(ctx, time.Millisecond*500, func(ctx context.Context) (bool, error) {
if err := wait.PollUntilContextCancel(ctx, time.Millisecond*500, true, func(ctx context.Context) (bool, error) {
select {
case <-ctx.Done():
return false, fmt.Errorf("context canceled")
Expand Down
2 changes: 1 addition & 1 deletion cmd/virtual-workspaces/command/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func Run(ctx context.Context, o *options.Options) error {

// resolve identities for system APIBindings
identityConfig, resolveIdentities := bootstrap.NewConfigWithWildcardIdentities(nonIdentityConfig, bootstrap.KcpRootGroupExportNames, bootstrap.KcpRootGroupResourceExportNames, localShardKubeClusterClient)
if err := wait.PollImmediateInfiniteWithContext(ctx, time.Millisecond*500, func(ctx context.Context) (bool, error) {
if err := wait.PollUntilContextCancel(ctx, time.Millisecond*500, true, func(ctx context.Context) (bool, error) {
if err := resolveIdentities(ctx); err != nil {
logger.V(3).Info("failed to resolve identities, keeping trying: ", "err", err)
return false, nil
Expand Down
4 changes: 0 additions & 4 deletions cmd/virtual-workspaces/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ package main
import (
goflag "flag"
"fmt"
"math/rand"
"os"
"time"

"github.com/spf13/pflag"

Expand All @@ -33,8 +31,6 @@ import (
func main() {
ctx := genericapiserver.SetupSignalContext()

rand.Seed(time.Now().UTC().UnixNano())

pflag.CommandLine.AddGoFlagSet(goflag.CommandLine)

command := virtualworkspacecommand.NewCommand(ctx, os.Stderr)
Expand Down
2 changes: 1 addition & 1 deletion config/crds/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func CreateSingle(ctx context.Context, client apiextensionsv1client.CustomResour

logger.Info("waiting for CRD to be established")
var lastMsg string
return wait.PollImmediateInfiniteWithContext(ctx, 100*time.Millisecond, func(ctx context.Context) (bool, error) {
return wait.PollUntilContextCancel(ctx, 100*time.Millisecond, true, func(ctx context.Context) (bool, error) {
crd, err := client.Get(ctx, rawCRD.Name, metav1.GetOptions{})
if err != nil {
if apierrors.IsNotFound(err) {
Expand Down
4 changes: 2 additions & 2 deletions config/helpers/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func Bootstrap(ctx context.Context, discoveryClient discovery.DiscoveryInterface
for _, opt := range opts {
transformers = append(transformers, opt.TransformFile)
}
return wait.PollImmediateInfiniteWithContext(ctx, time.Second, func(ctx context.Context) (bool, error) {
return wait.PollUntilContextCancel(ctx, time.Second, true, func(ctx context.Context) (bool, error) {
if err := CreateResourcesFromFS(ctx, dynamicClient, mapper, batteriesIncluded, fs, transformers...); err != nil {
klog.FromContext(ctx).WithValues("err", err).Info("failed to bootstrap resources, retrying")
// invalidate cache if resources not found
Expand Down Expand Up @@ -266,7 +266,7 @@ func BindRootAPIs(ctx context.Context, kcpClient kcpclient.Interface, exportName
return err
}

if err := wait.PollImmediateInfiniteWithContext(ctx, time.Second, func(ctx context.Context) (bool, error) {
if err := wait.PollUntilContextCancel(ctx, time.Second, true, func(ctx context.Context) (bool, error) {
existing, err := kcpClient.ApisV1alpha1().APIBindings().Get(ctx, exportName, metav1.GetOptions{})
if err != nil {
logger.Error(err, "error getting APIBinding", "name", exportName)
Expand Down
2 changes: 1 addition & 1 deletion config/root-phase0/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func Bootstrap(ctx context.Context, kcpClient kcpclient.Interface, rootDiscovery
}

// set LogicalCluster to Initializing
return wait.PollImmediateUntilWithContext(ctx, time.Millisecond*100, func(ctx context.Context) (done bool, err error) {
return wait.PollUntilContextCancel(ctx, time.Millisecond*100, true, func(ctx context.Context) (done bool, err error) {
logger := klog.FromContext(ctx).WithValues("bootstrapping", "root-phase0")
logicalCluster, err := kcpClient.CoreV1alpha1().LogicalClusters().Get(ctx, corev1alpha1.LogicalClusterName, metav1.GetOptions{})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion config/system-crds/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func Bootstrap(ctx context.Context, crdClient apiextensionsclient.Interface, dis
{Group: apis.GroupName, Resource: "apiconversions"},
}

if err := wait.PollImmediateInfiniteWithContext(ctx, time.Second, func(ctx context.Context) (bool, error) {
if err := wait.PollUntilContextCancel(ctx, time.Second, true, func(ctx context.Context) (bool, error) {
if err := configcrds.Create(ctx, crdClient.ApiextensionsV1().CustomResourceDefinitions(), crds...); err != nil {
logger.Error(err, "failed to bootstrap system CRDs, retrying")
return false, nil // keep retrying
Expand Down
2 changes: 1 addition & 1 deletion docs/content/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ contribution. See the [DCO](https://github.com/kcp-dev/kcp/tree/main/DCO) file f
### Prerequisites

1. Clone this repository.
2. [Install Go](https://golang.org/doc/install) (currently 1.19).
2. [Install Go](https://golang.org/doc/install) (currently 1.20).
3. Install [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl).

Please note that the go language version numbers in these files must exactly agree: go/go.mod file, kcp/.ci-operator.yaml, kcp/Dockerfile, and in all the kcp/.github/workflows yaml files that specify go-version. In kcp/.ci-operator.yaml the go version is indicated by the "tag" attribute. In kcp/Dockerfile it is indicated by the "golang" attribute. In go.mod it is indicated by the "go" directive." In the .github/workflows yaml files it is indicated by "go-version"
Expand Down
Loading