Skip to content

Instantly share code, notes, and snippets.

Avatar

Dr. Stefan Schimanski sttts

View GitHub Profile
View gist:bafd277eb6cb5ce626f3f188ac55085d
commit 4175145b779c0f7709a010d763dc194fe926532c
Author: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
Date: Mon Sep 19 11:01:37 2022 +0200
WIP
diff --git a/cmd/cache-server/main.go b/cmd/cache-server/main.go
index abf99223..3baa2b94 100644
--- a/cmd/cache-server/main.go
+++ b/cmd/cache-server/main.go
View gist:d6a4a00383496a82ab2fb44c081e479b
commit ea73ce4085fa7f05993a075daa9b9e59eaf50933
Author: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
Date: Mon Sep 19 11:01:37 2022 +0200
WIP
diff --git a/cmd/cache-server/options/options.go b/cmd/cache-server/options/options.go
new file mode 100644
index 00000000..575d1f84
--- /dev/null
View gist:31a0e47d5e267ff194aa0f860a6f88e9
diff --git a/cmd/cache-server/main.go b/cmd/cache-server/main.go
index abf99223..3baa2b94 100644
--- a/cmd/cache-server/main.go
+++ b/cmd/cache-server/main.go
@@ -26,7 +26,7 @@ import (
"k8s.io/component-base/cli"
cacheserver "github.com/kcp-dev/kcp/pkg/cache/server"
- "github.com/kcp-dev/kcp/pkg/cache/server/options"
+ "github.com/kcp-dev/kcp/cmd/cache-server/options"
View gist:619c05f67e80ada799d8e2c4c662a15f
diff --git a/cmd/cache-server/main.go b/cmd/cache-server/main.go
index 71cab85e..d6a0da19 100644
--- a/cmd/cache-server/main.go
+++ b/cmd/cache-server/main.go
@@ -84,7 +84,12 @@ func main() {
return err
}
}
- return server.Run(ctx)
+
View gist:1f63f82d1eeb4d98fecacf5a288f6441
diff --git a/pkg/reconciler/workload/apiexport/workload_apiexport_controller.go b/pkg/reconciler/workload/apiexport/workload_apiexport_controller.go
index fd2fc569..14f9d0b2 100644
--- a/pkg/reconciler/workload/apiexport/workload_apiexport_controller.go
+++ b/pkg/reconciler/workload/apiexport/workload_apiexport_controller.go
@@ -145,7 +145,7 @@ func (c *controller) enqueueNegotiatedAPIResource(obj interface{}) {
clusterName := logicalcluster.From(resource)
key := clusters.ToClusterAwareKey(clusterName, TemporaryComputeServiceExportName)
- if _, err := c.apiExportsLister.Get(clusters.ToClusterAwareKey(clusterName, TemporaryComputeServiceExportName)); errors.IsNotFound(err) {
+ if _, err := c.apiExportsLister.Cluster(clusterName).Get(TemporaryComputeServiceExportName); errors.IsNotFound(err) {
View gist:8e3b8e28c6f0a0c6af94ed592a84ada3
This file has been truncated, but you can view the full file.
time="2022-09-02T15:14:41+02:00" level=info msg="found a *dst.SelectorExpr: &dst.SelectorExpr{X:(*dst.Ident)(0x1400874e980), Sel:(*dst.Ident)(0x1400874ea00), Decs:dst.SelectorExprDecorations{NodeDecs:dst.NodeDecs{Before:0, Start:dst.Decorations(nil), End:dst.Decorations(nil), After:0}, X:dst.Decorations(nil)}}" relPath=main.go
time="2022-09-02T15:14:41+02:00" level=info msg="found a *dst.SelectorExpr: &dst.SelectorExpr{X:(*dst.Ident)(0x1400874eb80), Sel:(*dst.Ident)(0x1400874ec00), Decs:dst.SelectorExprDecorations{NodeDecs:dst.NodeDecs{Before:0, Start:dst.Decorations(nil), End:dst.Decorations(nil), After:0}, X:dst.Decorations(nil)}}" relPath=main.go
time="2022-09-02T15:14:41+02:00" level=info msg="found a *dst.Ident: &dst.Ident{Name:\"Errorf\", Obj:(*dst.Object)(nil), Path:\"fmt\", Decs:dst.IdentDecorations{NodeDecs:dst.NodeDecs{Before:0, Start:dst.Decorations(nil), End:dst.Decorations(nil), After:0}, X:dst.Decorations(nil)}}" relPath=main.go
View gist:81d5ef7258c1232278455a77fcd0cb93
diff --git a/pkg/authorization/workspace_content_authorizer.go b/pkg/authorization/workspace_content_authorizer.go
index 762a39a3d..cd3519b84 100644
--- a/pkg/authorization/workspace_content_authorizer.go
+++ b/pkg/authorization/workspace_content_authorizer.go
@@ -18,6 +18,7 @@ package authorization
import (
"context"
+ "fmt"
"strings"
View gist:e4cb8e0cad2c4fa2cf222663fa9bdbdd
diff --git a/pkg/authorization/toplevel_org_authorizer.go b/pkg/authorization/toplevel_org_authorizer.go
index 9f24d3243..f635b9f2e 100644
--- a/pkg/authorization/toplevel_org_authorizer.go
+++ b/pkg/authorization/toplevel_org_authorizer.go
@@ -36,6 +36,7 @@ import (
tenancyv1alpha1 "github.com/kcp-dev/kcp/pkg/apis/tenancy/v1alpha1"
tenancyv1 "github.com/kcp-dev/kcp/pkg/client/listers/tenancy/v1alpha1"
rbacwrapper "github.com/kcp-dev/kcp/pkg/virtual/framework/wrappers/rbac"
+ authorizationv1 "k8s.io/api/authorization/v1"
)
View gist:a57ad8c7498773cd573d15696e739e1e
commit 17672e1f1b9c0c8e6fd6a30721a495602f513c81
Author: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
Date: Fri Jul 29 22:22:34 2022 +0200
e2e/syncer-fixture: fix cleanup
diff --git a/test/e2e/framework/fixture.go b/test/e2e/framework/fixture.go
index ff3f3226..4a43c048 100644
--- a/test/e2e/framework/fixture.go
+++ b/test/e2e/framework/fixture.go
View gist:c6358d88525e81877c5c7d11ca00a61e
diff --git a/pkg/server/controllers.go b/pkg/server/controllers.go
index 456aaedf..55214a9e 100644
--- a/pkg/server/controllers.go
+++ b/pkg/server/controllers.go
@@ -592,7 +592,8 @@ func (s *Server) installAPIBindingController(ctx context.Context, config *rest.C
crdsSynced := s.ApiExtensionsSharedInformerFactory.Apiextensions().V1().CustomResourceDefinitions().Informer().HasSynced()
exportsSynced := s.KcpSharedInformerFactory.Apis().V1alpha1().APIExports().Informer().HasSynced()
bindingsSynced := s.KcpSharedInformerFactory.Apis().V1alpha1().APIBindings().Informer().HasSynced()
- return crdsSynced && exportsSynced && bindingsSynced, nil
+ remoteExportSyncer := s.TemporaryRootShardKcpSharedInformerFactory.Apis().V1alpha1().APIExports().Informer().HasSynced()