Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #102 from FabianKramm/master
Browse files Browse the repository at this point in the history
update dependencies
  • Loading branch information
FabianKramm authored Feb 11, 2021
2 parents 3886dad + 06e2fdc commit 49ff65c
Show file tree
Hide file tree
Showing 790 changed files with 62,300 additions and 18,019 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
test:
runs-on: ubuntu-18.04
steps:
- name: Set up Go 1.13
- name: Set up Go 1.15
uses: actions/setup-go@v1
with:
go-version: 1.13
go-version: 1.15
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Test
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Build the manager binary
FROM golang:1.13 as builder
FROM golang:1.15 as builder

WORKDIR /workspace

# Install Helm 3
RUN bash -c "curl -s https://get.helm.sh/helm-v3.3.1-linux-amd64.tar.gz > helm3.tar.gz" && tar -zxvf helm3.tar.gz linux-amd64/helm && chmod +x linux-amd64/helm && mv linux-amd64/helm /workspace/helm && rm helm3.tar.gz && rm -R linux-amd64
RUN bash -c "curl -s https://get.helm.sh/helm-v3.5.2-linux-amd64.tar.gz > helm3.tar.gz" && tar -zxvf helm3.tar.gz linux-amd64/helm && chmod +x linux-amd64/helm && mv linux-amd64/helm /workspace/helm && rm helm3.tar.gz && rm -R linux-amd64

# Copy the Go Modules manifests
COPY go.mod go.mod
Expand Down
30 changes: 15 additions & 15 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module github.com/loft-sh/kiosk

require (
github.com/Azure/go-autorest v13.0.0+incompatible // indirect
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c // indirect
github.com/evanphx/json-patch v4.9.0+incompatible
Expand All @@ -17,25 +16,26 @@ require (
github.com/pkg/errors v0.9.1
github.com/rancher/kine v0.3.2 // indirect
github.com/sirupsen/logrus v1.6.0
github.com/spf13/cobra v1.0.0
github.com/spf13/cobra v1.1.1
github.com/spf13/pflag v1.0.5
github.com/ugorji/go v1.1.4 // indirect
gomodules.xyz/jsonpatch v2.0.0+incompatible // indirect
gotest.tools v2.2.0+incompatible
k8s.io/api v0.19.3
k8s.io/apiextensions-apiserver v0.19.3
k8s.io/apimachinery v0.19.3
k8s.io/apiserver v0.19.3
k8s.io/cli-runtime v0.19.3
k8s.io/client-go v0.19.3
k8s.io/component-base v0.19.3
k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14
k8s.io/api v0.20.2
k8s.io/apiextensions-apiserver v0.20.2
k8s.io/apimachinery v0.20.2
k8s.io/apiserver v0.20.2
k8s.io/cli-runtime v0.20.2
k8s.io/client-go v0.20.2
k8s.io/component-base v0.20.2
k8s.io/gengo v0.0.0-20201113003025-83324d819ded
k8s.io/klog v1.0.0
k8s.io/kube-aggregator v0.19.3
k8s.io/kube-controller-manager v0.19.3
k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6
k8s.io/kubectl v0.19.3
k8s.io/kube-aggregator v0.20.2
k8s.io/kube-controller-manager v0.20.2
k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd
k8s.io/kubectl v0.20.2
sigs.k8s.io/apiserver-builder-alpha v1.18.0
sigs.k8s.io/controller-runtime v0.7.0
sigs.k8s.io/controller-runtime v0.8.2
)

go 1.13
Expand Down
211 changes: 211 additions & 0 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion hack/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ echo "Generate conversion, deepcopy, defaulter, openapi, client, lister & inform

conversion-gen --input-dirs github.com/loft-sh/kiosk/pkg/apis/... -o $GOPATH/src --go-header-file ./hack/boilerplate.go.txt -O zz_generated.conversion --extra-peer-dirs k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/conversion,k8s.io/apimachinery/pkg/runtime
deepcopy-gen --input-dirs github.com/loft-sh/kiosk/pkg/apis/... -o $GOPATH/src --go-header-file ./hack/boilerplate.go.txt -O zz_generated.deepcopy
openapi-gen --input-dirs github.com/loft-sh/kiosk/pkg/apis/... -o $GOPATH/src --go-header-file ./hack/boilerplate.go.txt -i k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/api/resource,k8s.io/apimachinery/pkg/version,k8s.io/apimachinery/pkg/runtime,k8s.io/apimachinery/pkg/util/intstr,k8s.io/api/admission/v1,k8s.io/api/admission/v1beta1,k8s.io/api/admissionregistration/v1,k8s.io/api/admissionregistration/v1beta1,k8s.io/api/apps/v1,k8s.io/api/apps/v1beta1,k8s.io/api/apps/v1beta2,k8s.io/api/authentication/v1,k8s.io/api/authentication/v1beta1,k8s.io/api/authorization/v1,k8s.io/api/authorization/v1beta1,k8s.io/api/autoscaling/v1,k8s.io/api/autoscaling/v2beta1,k8s.io/api/autoscaling/v2beta2,k8s.io/api/batch/v1,k8s.io/api/batch/v1beta1,k8s.io/api/batch/v2alpha1,k8s.io/api/certificates/v1beta1,k8s.io/api/coordination/v1,k8s.io/api/coordination/v1beta1,k8s.io/api/core/v1,k8s.io/api/discovery/v1alpha1,k8s.io/api/events/v1beta1,k8s.io/api/extensions/v1beta1,k8s.io/api/networking/v1,k8s.io/api/networking/v1beta1,k8s.io/api/node/v1alpha1,k8s.io/api/node/v1beta1,k8s.io/api/policy/v1beta1,k8s.io/api/rbac/v1,k8s.io/api/rbac/v1alpha1,k8s.io/api/rbac/v1beta1,k8s.io/api/scheduling/v1,k8s.io/api/scheduling/v1alpha1,k8s.io/api/scheduling/v1beta1,k8s.io/api/settings/v1alpha1,k8s.io/api/storage/v1,k8s.io/api/storage/v1alpha1,k8s.io/api/storage/v1beta1,k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1,k8s.io/client-go/pkg/apis/clientauthentication/v1beta1,k8s.io/api/core/v1 --report-filename violations.report --output-package github.com/loft-sh/kiosk/pkg/openapi
openapi-gen --input-dirs github.com/loft-sh/kiosk/pkg/apis/... -o $GOPATH/src --go-header-file ./hack/boilerplate.go.txt -i k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/api/resource,k8s.io/apimachinery/pkg/version,k8s.io/apimachinery/pkg/runtime,k8s.io/apimachinery/pkg/util/intstr,k8s.io/api/admission/v1,k8s.io/api/admission/v1beta1,k8s.io/api/admissionregistration/v1,k8s.io/api/admissionregistration/v1beta1,k8s.io/api/apps/v1,k8s.io/api/apps/v1beta1,k8s.io/api/apps/v1beta2,k8s.io/api/authentication/v1,k8s.io/api/authentication/v1beta1,k8s.io/api/authorization/v1,k8s.io/api/authorization/v1beta1,k8s.io/api/autoscaling/v1,k8s.io/api/autoscaling/v2beta1,k8s.io/api/autoscaling/v2beta2,k8s.io/api/batch/v1,k8s.io/api/batch/v1beta1,k8s.io/api/batch/v2alpha1,k8s.io/api/certificates/v1beta1,k8s.io/api/coordination/v1,k8s.io/api/coordination/v1beta1,k8s.io/api/core/v1,k8s.io/api/discovery/v1alpha1,k8s.io/api/events/v1beta1,k8s.io/api/extensions/v1beta1,k8s.io/api/networking/v1,k8s.io/api/networking/v1beta1,k8s.io/api/node/v1alpha1,k8s.io/api/node/v1beta1,k8s.io/api/policy/v1beta1,k8s.io/api/rbac/v1,k8s.io/api/rbac/v1alpha1,k8s.io/api/rbac/v1beta1,k8s.io/api/scheduling/v1,k8s.io/api/scheduling/v1alpha1,k8s.io/api/scheduling/v1beta1,k8s.io/api/storage/v1,k8s.io/api/storage/v1alpha1,k8s.io/api/storage/v1beta1,k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1,k8s.io/client-go/pkg/apis/clientauthentication/v1beta1,k8s.io/api/core/v1 --report-filename violations.report --output-package github.com/loft-sh/kiosk/pkg/openapi
client-gen -o $GOPATH/src --go-header-file ./hack/boilerplate.go.txt --input-base github.com/loft-sh/kiosk/pkg/apis --input tenancy/v1alpha1 --input config/v1alpha1 --clientset-path github.com/loft-sh/kiosk/pkg/client/clientset_generated --clientset-name clientset
lister-gen --input-dirs github.com/loft-sh/kiosk/pkg/apis/... -o $GOPATH/src --go-header-file ./hack/boilerplate.go.txt --output-package github.com/loft-sh/kiosk/pkg/client/listers_generated
informer-gen --input-dirs github.com/loft-sh/kiosk/pkg/apis/... -o $GOPATH/src --go-header-file ./hack/boilerplate.go.txt --output-package github.com/loft-sh/kiosk/pkg/client/informers_generated --listers-package github.com/loft-sh/kiosk/pkg/client/listers_generated --versioned-clientset-package github.com/loft-sh/kiosk/pkg/client/clientset_generated/clientset
9 changes: 9 additions & 0 deletions pkg/apiserver/registry/account/rest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
tenancyv1alpha1 "github.com/loft-sh/kiosk/pkg/apis/tenancy/v1alpha1"
rbacv1 "k8s.io/api/rbac/v1"
"sigs.k8s.io/controller-runtime/pkg/client"

testingutil "github.com/loft-sh/kiosk/pkg/util/testing"

Expand Down Expand Up @@ -215,9 +216,17 @@ func TestAccountUpdate(t *testing.T) {
userCtx := request.WithUser(ctx, &user.DefaultInfo{Name: "foo"})
accountStorage := NewAccountREST(fakeClient, fakeClient, scheme).(*accountREST)

// Get old account
oldAccount := &configv1alpha1.Account{}
err := fakeClient.Get(ctx, client.ObjectKey{Name: "test"}, oldAccount)
if err != nil {
t.Fatal(err)
}

newObj, updated, err := accountStorage.Update(userCtx, "test", &fakeUpdater{out: &tenancy.Account{
ObjectMeta: metav1.ObjectMeta{
Name: "test",
ResourceVersion: oldAccount.ResourceVersion,
Labels: map[string]string{
"Updated": "true",
},
Expand Down
13 changes: 7 additions & 6 deletions pkg/apiserver/registry/space/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,13 @@ func (r *spaceStorage) Create(ctx context.Context, obj runtime.Object, createVal

return nil, err
}

// wait until we get access
err = r.waitForAccess(ctx, a.GetUser(), namespace)
if err != nil {
// if this happens it is kind of weird, but its not a reason to return an error and abort the request
klog.Infof("error waiting for access to namespace %s for user %s: %v", namespace.Name, a.GetUser().GetName(), err)
}
} else {
err := r.client.Create(ctx, namespace, &client.CreateOptions{
Raw: options,
Expand All @@ -297,12 +304,6 @@ func (r *spaceStorage) Create(ctx context.Context, obj runtime.Object, createVal
}
}

err = r.waitForAccess(ctx, a.GetUser(), namespace)
if err != nil {
// if this happens it is kind of weird, but its not a reason to return an error and abort the request
klog.Infof("error waiting for access to namespace %s for user %s: %v", namespace.Name, a.GetUser().GetName(), err)
}

return ConvertNamespace(namespace), nil
}

Expand Down
14 changes: 11 additions & 3 deletions pkg/apiserver/registry/space/rest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package space
import (
tenancyv1alpha1 "github.com/loft-sh/kiosk/pkg/apis/tenancy/v1alpha1"
rbacv1 "k8s.io/api/rbac/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
"testing"

"github.com/loft-sh/kiosk/pkg/apis/tenancy"
Expand Down Expand Up @@ -243,11 +244,17 @@ func TestCreateSpace(t *testing.T) {
t.Fatal("Expected error but got nil")
}

// Get old account
oldAccount := &configv1alpha1.Account{}
err = fakeClient.Get(ctx, client.ObjectKey{Name: "test"}, oldAccount)
if err != nil {
t.Fatal(err)
}

// Set index value
test := "test"
newAccount := &configv1alpha1.Account{
ObjectMeta: metav1.ObjectMeta{
Name: "test",
},
ObjectMeta: oldAccount.ObjectMeta,
Spec: configv1alpha1.AccountSpec{
Subjects: []rbacv1.Subject{
{
Expand All @@ -258,6 +265,7 @@ func TestCreateSpace(t *testing.T) {
},
Space: configv1alpha1.AccountSpace{
Limit: &spaceLimit,
ClusterRole: &test,
SpaceTemplate: configv1alpha1.AccountSpaceTemplate{
ObjectMeta: metav1.ObjectMeta{
Annotations: map[string]string{
Expand Down
5 changes: 3 additions & 2 deletions pkg/apiserver/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,9 @@ func (o *ServerOptions) RunServer(stopCh <-chan struct{}, title, version string,
handler = genericfilters.WithCORS(handler, genericConfig.CorsAllowedOriginList, nil, nil, nil, "true")
handler = genericfilters.WithTimeoutForNonLongRunningRequests(handler, genericConfig.LongRunningFunc, genericConfig.RequestTimeout)
handler = genericfilters.WithMaxInFlightLimit(handler, genericConfig.MaxRequestsInFlight, genericConfig.MaxMutatingRequestsInFlight, genericConfig.LongRunningFunc)
handler = genericapifilters.WithRequestInfo(handler, server.NewRequestInfoResolver(genericConfig))
handler = genericfilters.WithPanicRecovery(handler)
infoResolver := server.NewRequestInfoResolver(genericConfig)
handler = genericapifilters.WithRequestInfo(handler, infoResolver)
handler = genericfilters.WithPanicRecovery(handler, infoResolver)
if err := aggregatedAPIServerConfig.InsecureServingInfo.Serve(handler, genericConfig.RequestTimeout, stopCh); err != nil {
return err
}
Expand Down
Loading

0 comments on commit 49ff65c

Please sign in to comment.