Skip to content

Commit

Permalink
fix: renamed apiserver module
Browse files Browse the repository at this point in the history
Signed-off-by: Bruno Bressi <[email protected]>
  • Loading branch information
puffitos committed Jan 24, 2024
1 parent 29fba3b commit 942d8f7
Show file tree
Hide file tree
Showing 57 changed files with 85 additions and 85 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,10 @@ Steve Features
--------------

Steve's main use is as an opinionated consumer of
[rancher/apiserver](https://gitlab.devops.telekom.de/caas/rancher/apiserver), which it uses to
[rancher/apiserver](https://github.com/caas-team/apiserver), which it uses to
dynamically register every Kubernetes API as its own. It implements
apiserver
[Stores](https://pkg.go.dev/gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/types#Store) to
[Stores](https://pkg.go.dev/github.com/caas-team/apiserver/pkg/types#Store) to
use Kubernetes as its data store.

### Stores
Expand Down Expand Up @@ -345,7 +345,7 @@ resource for preference storage instead.
Counts keeps track of the number of resources and updates the count in a
buffered stream that the dashboard can subscribe to.

#### [Subscribe](https://gitlab.devops.telekom.de/caas/rancher/apiserver/tree/master/pkg/subscribe)
#### [Subscribe](https://github.com/caas-team/apiserver/tree/master/pkg/subscribe)

Steve exposes a websocket endpoint on /v1/subscribe for sending streams of
events. Connect to the endpoint using a websocket client like websocat:
Expand All @@ -354,7 +354,7 @@ events. Connect to the endpoint using a websocket client like websocat:
websocat -k wss://127.0.0.1:9443/v1/subscribe
```

Review the [apiserver](https://gitlab.devops.telekom.de/caas/rancher/apiserver#subscribe) guide
Review the [apiserver](https://github.com/caas-team/apiserver#subscribe) guide
for details.

In addition to regular Kubernetes resources, steve allows you to subscribe to
Expand All @@ -375,8 +375,8 @@ data is always redacted, you could implement a store like this:

```go
import (
"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/store/empty"
"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/types"
"github.com/caas-team/apiserver/pkg/store/empty"
"github.com/caas-team/apiserver/pkg/types"
)

type redactStore struct {
Expand Down Expand Up @@ -461,7 +461,7 @@ Steve implements access control on schemas based on the user's RBAC in
Kubernetes.

The apiserver
[`Server`](https://pkg.go.dev/gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/server#Server)
[`Server`](https://pkg.go.dev/github.com/caas-team/apiserver/pkg/server#Server)
object exposes an AccessControl field which is used to customize how access
control is performed on server requests.

Expand All @@ -482,7 +482,7 @@ checked for existence in the AccessSet, and filtered out if it is not
available.

This final set of schemas is inserted into the
[`types.APIRequest`](https://pkg.go.dev/gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/types#APIRequest)
[`types.APIRequest`](https://pkg.go.dev/github.com/caas-team/apiserver/pkg/types#APIRequest)
object and passed to the apiserver handler.

### Authentication
Expand Down Expand Up @@ -683,13 +683,13 @@ From here, the list is passed to the
[listprocessor](https://pkg.go.dev/github.com/caas-team/steve/pkg/stores/partition/listprocessor)
to filter, sort, and paginate the list. The partition store formats the list as
a
[types.APIObjectList](https://pkg.go.dev/gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/types#APIObjectList)
[types.APIObjectList](https://pkg.go.dev/github.com/caas-team/apiserver/pkg/types#APIObjectList)
and it is returned up the chain of nested stores.
Most stores in steve are implementations of the apiserver
[Store](https://pkg.go.dev/gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/types#Store)
[Store](https://pkg.go.dev/github.com/caas-team/apiserver/pkg/types#Store)
interface, which returns apiserver
[types](https://pkg.go.dev/gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/types). The
[types](https://pkg.go.dev/github.com/caas-team/apiserver/pkg/types). The
partitioner implements its own store type called
[UnstructuredStore](https://pkg.go.dev/github.com/caas-team/steve/pkg/stores/partition#UnstructuredStore)
which returns
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -608,8 +608,8 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
gitlab.devops.telekom.de/caas/rancher/apiserver v0.0.0-20240124101749-f82a882c4527 h1:2E3Uh1cuLrb1p/E395AkI2KvYxmJMXQJiyaO8Gg7QEI=
gitlab.devops.telekom.de/caas/rancher/apiserver v0.0.0-20240124101749-f82a882c4527/go.mod h1:wLYNaze/kRkrq0snLLVUMrrKQRaF1SKPUGEyq1ADuR0=
github.com/caas-team/apiserver v0.0.0-20240124101749-f82a882c4527 h1:2E3Uh1cuLrb1p/E395AkI2KvYxmJMXQJiyaO8Gg7QEI=
github.com/caas-team/apiserver v0.0.0-20240124101749-f82a882c4527/go.mod h1:wLYNaze/kRkrq0snLLVUMrrKQRaF1SKPUGEyq1ADuR0=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4=
go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs=
Expand Down
4 changes: 2 additions & 2 deletions pkg/accesscontrol/access_control.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package accesscontrol

import (
apiserver "github.com/caas-team/apiserver/pkg/server"
"github.com/caas-team/apiserver/pkg/types"
"github.com/caas-team/steve/pkg/attributes"
"github.com/rancher/wrangler/pkg/kv"
apiserver "gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/server"
"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/types"
"k8s.io/apimachinery/pkg/runtime/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/accesscontrol/access_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package accesscontrol
import (
"sort"

"github.com/caas-team/apiserver/pkg/types"
"github.com/caas-team/steve/pkg/attributes"
"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/types"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/sets"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/attributes/attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package attributes
import (
"fmt"

"github.com/caas-team/apiserver/pkg/types"
"github.com/rancher/wrangler/pkg/data/convert"
"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/types"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"net/http"
"time"

"github.com/caas-team/apiserver/pkg/types"
"github.com/caas-team/steve/pkg/attributes"
"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/types"
"k8s.io/apiserver/pkg/endpoints/request"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/kubernetes"
Expand Down
2 changes: 1 addition & 1 deletion pkg/clustercache/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import (
"sync"
"time"

"github.com/caas-team/apiserver/pkg/types"
"github.com/caas-team/steve/pkg/attributes"
"github.com/caas-team/steve/pkg/schema"
"github.com/rancher/wrangler/pkg/merr"
"github.com/rancher/wrangler/pkg/summary/client"
"github.com/rancher/wrangler/pkg/summary/informer"
"github.com/sirupsen/logrus"
"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/types"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand Down
2 changes: 1 addition & 1 deletion pkg/controllers/schema/schemas.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import (
"sync/atomic"
"time"

"github.com/caas-team/apiserver/pkg/types"
"github.com/caas-team/steve/pkg/attributes"
"github.com/caas-team/steve/pkg/resources/common"
schema2 "github.com/caas-team/steve/pkg/schema"
"github.com/caas-team/steve/pkg/schema/converter"
apiextcontrollerv1 "github.com/rancher/wrangler/pkg/generated/controllers/apiextensions.k8s.io/v1"
v1 "github.com/rancher/wrangler/pkg/generated/controllers/apiregistration.k8s.io/v1"
"github.com/sirupsen/logrus"
"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/types"
"golang.org/x/sync/errgroup"
"golang.org/x/sync/semaphore"
authorizationv1 "k8s.io/api/authorization/v1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"net/http"
"strconv"

"github.com/caas-team/apiserver/pkg/apierror"
"github.com/prometheus/client_golang/prometheus"
"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/apierror"
)

type MetricLogger struct {
Expand Down
4 changes: 2 additions & 2 deletions pkg/resources/apigroups/apigroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (

"github.com/caas-team/steve/pkg/schema"

"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/store/empty"
"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/types"
"github.com/caas-team/apiserver/pkg/store/empty"
"github.com/caas-team/apiserver/pkg/types"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/discovery"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/cluster/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import (
"fmt"
"net/http"

"github.com/caas-team/apiserver/pkg/types"
"github.com/caas-team/steve/pkg/attributes"
steveschema "github.com/caas-team/steve/pkg/schema"
"github.com/caas-team/steve/pkg/stores/proxy"
"github.com/pborman/uuid"
"github.com/rancher/wrangler/pkg/apply"
"github.com/rancher/wrangler/pkg/yaml"
"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/types"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
Expand Down
4 changes: 2 additions & 2 deletions pkg/resources/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import (
"context"
"net/http"

"github.com/caas-team/apiserver/pkg/store/empty"
"github.com/caas-team/apiserver/pkg/types"
"github.com/caas-team/steve/pkg/accesscontrol"
"github.com/caas-team/steve/pkg/attributes"
steveschema "github.com/caas-team/steve/pkg/schema"
"github.com/caas-team/steve/pkg/stores/proxy"
detector "github.com/rancher/kubernetes-provider-detector"
"github.com/rancher/wrangler/pkg/genericcondition"
"github.com/rancher/wrangler/pkg/schemas"
"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/store/empty"
"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/types"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
schema2 "k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/version"
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/common/dynamiccolumns.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"context"
"fmt"

"github.com/caas-team/apiserver/pkg/types"
"github.com/caas-team/steve/pkg/attributes"
"github.com/rancher/wrangler/pkg/ratelimit"
"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/types"
"k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/common/formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package common
import (
"strings"

"github.com/caas-team/apiserver/pkg/types"
"github.com/caas-team/steve/pkg/accesscontrol"
"github.com/caas-team/steve/pkg/attributes"
"github.com/caas-team/steve/pkg/schema"
Expand All @@ -13,7 +14,6 @@ import (
corecontrollers "github.com/rancher/wrangler/pkg/generated/controllers/core/v1"
"github.com/rancher/wrangler/pkg/slice"
"github.com/rancher/wrangler/pkg/summary"
"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/types"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/common/formatter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"net/url"
"testing"

"github.com/caas-team/apiserver/pkg/types"
"github.com/stretchr/testify/assert"
"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/types"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
schema2 "k8s.io/apimachinery/pkg/runtime/schema"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/counts/buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package counts
import (
"time"

"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/types"
"github.com/caas-team/apiserver/pkg/types"
)

// debounceDuration determines how long events will be held before they are sent to the consumer
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/counts/buffer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"testing"
"time"

"github.com/caas-team/apiserver/pkg/types"
"github.com/stretchr/testify/assert"
"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/types"
)

func Test_countsBuffer(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/resources/counts/counts.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (
"strconv"
"sync"

"github.com/caas-team/apiserver/pkg/store/empty"
"github.com/caas-team/apiserver/pkg/types"
"github.com/caas-team/steve/pkg/accesscontrol"
"github.com/caas-team/steve/pkg/attributes"
"github.com/caas-team/steve/pkg/clustercache"
"github.com/rancher/wrangler/pkg/summary"
"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/store/empty"
"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/types"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/runtime"
schema2 "k8s.io/apimachinery/pkg/runtime/schema"
Expand Down
6 changes: 3 additions & 3 deletions pkg/resources/counts/counts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import (
"testing"
"time"

"github.com/caas-team/apiserver/pkg/server"
"github.com/caas-team/apiserver/pkg/store/empty"
"github.com/caas-team/apiserver/pkg/types"
"github.com/caas-team/steve/pkg/accesscontrol"
"github.com/caas-team/steve/pkg/attributes"
"github.com/caas-team/steve/pkg/clustercache"
Expand All @@ -15,9 +18,6 @@ import (
"github.com/rancher/wrangler/pkg/schemas"
"github.com/rancher/wrangler/pkg/summary"
"github.com/stretchr/testify/assert"
"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/server"
"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/store/empty"
"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/types"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
schema2 "k8s.io/apimachinery/pkg/runtime/schema"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/formatters/formatter.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package formatters

import (
"github.com/caas-team/apiserver/pkg/types"
"github.com/rancher/norman/types/convert"
"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/types"
)

func DropHelmData(request *types.APIRequest, resource *types.RawResource) {
Expand Down
6 changes: 3 additions & 3 deletions pkg/resources/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ package resources
import (
"context"

"github.com/caas-team/apiserver/pkg/store/apiroot"
"github.com/caas-team/apiserver/pkg/subscribe"
"github.com/caas-team/apiserver/pkg/types"
"github.com/caas-team/steve/pkg/accesscontrol"
"github.com/caas-team/steve/pkg/client"
"github.com/caas-team/steve/pkg/clustercache"
Expand All @@ -17,9 +20,6 @@ import (
"github.com/caas-team/steve/pkg/stores/proxy"
"github.com/caas-team/steve/pkg/summarycache"
corecontrollers "github.com/rancher/wrangler/pkg/generated/controllers/core/v1"
"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/store/apiroot"
"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/subscribe"
"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/types"
"k8s.io/apiserver/pkg/endpoints/request"
"k8s.io/client-go/discovery"
)
Expand Down
6 changes: 3 additions & 3 deletions pkg/resources/schemas/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import (
"sync"
"time"

"github.com/caas-team/apiserver/pkg/builtin"
schemastore "github.com/caas-team/apiserver/pkg/store/schema"
"github.com/caas-team/apiserver/pkg/types"
"github.com/caas-team/steve/pkg/accesscontrol"
"github.com/caas-team/steve/pkg/schema"
"github.com/rancher/wrangler/pkg/broadcast"
"github.com/rancher/wrangler/pkg/schemas/validation"
"github.com/sirupsen/logrus"
"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/builtin"
schemastore "gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/store/schema"
"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/types"
"k8s.io/apimachinery/pkg/api/equality"
"k8s.io/apiserver/pkg/authentication/user"
"k8s.io/apiserver/pkg/endpoints/request"
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/schemas/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"testing"
"time"

"github.com/caas-team/apiserver/pkg/types"
"github.com/caas-team/steve/pkg/accesscontrol"
acfake "github.com/caas-team/steve/pkg/accesscontrol/fake"
"github.com/caas-team/steve/pkg/attributes"
Expand All @@ -16,7 +17,6 @@ import (
"github.com/golang/mock/gomock"
v1schema "github.com/rancher/wrangler/pkg/schemas"
"github.com/stretchr/testify/assert"
"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/types"
"k8s.io/apiserver/pkg/authentication/user"
"k8s.io/apiserver/pkg/endpoints/request"
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/resources/userpreferences/localpref.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"path/filepath"

"github.com/adrg/xdg"
"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/store/empty"
"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/types"
"github.com/caas-team/apiserver/pkg/store/empty"
"github.com/caas-team/apiserver/pkg/types"
"k8s.io/apiserver/pkg/endpoints/request"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/userpreferences/userpreferences.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package userpreferences
import (
"net/http"

"gitlab.devops.telekom.de/caas/rancher/apiserver/pkg/types"
"github.com/caas-team/apiserver/pkg/types"
)

type UserPreference struct {
Expand Down
Loading

0 comments on commit 942d8f7

Please sign in to comment.