core/api: move to core/proto
This is keeping in line with conventions that protobuf files generally
live in a 'proto/' directory. Even without that, a lot of the protos in
there aren't actually part of an API, so keeping them in `api/` is a bit
of a misnomer.
We also remove unused protos that were part of the old
integrity/lifecycle flow. Again, these will make a comeback.
Test Plan: this should fail. part of a larger stack. D590 is the first tip of the stack that should work.
X-Origin-Diff: phab/D588
GitOrigin-RevId: 4a7af494810348f6bcabd49e63902b4c47e6ec35
diff --git a/core/tests/e2e/BUILD.bazel b/core/tests/e2e/BUILD.bazel
index e2983bc..a0cc433 100644
--- a/core/tests/e2e/BUILD.bazel
+++ b/core/tests/e2e/BUILD.bazel
@@ -10,7 +10,7 @@
importpath = "git.monogon.dev/source/nexantic.git/core/tests/e2e",
visibility = ["//visibility:private"],
deps = [
- "//core/api/api:go_default_library",
+ "//core/proto/api:go_default_library",
"@io_k8s_api//apps/v1:go_default_library",
"@io_k8s_api//core/v1:go_default_library",
"@io_k8s_apimachinery//pkg/api/resource:go_default_library",
@@ -33,9 +33,9 @@
embed = [":go_default_library"],
rundir = ".",
deps = [
- "//core/api/api:go_default_library",
"//core/internal/common:go_default_library",
"//core/internal/launch:go_default_library",
+ "//core/proto/api:go_default_library",
"@io_k8s_api//core/v1:go_default_library",
"@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library",
"@io_k8s_kubernetes//pkg/api/v1/pod:go_default_library",
diff --git a/core/tests/e2e/condition_helpers.go b/core/tests/e2e/condition_helpers.go
index df5d38c..7f9bc63 100644
--- a/core/tests/e2e/condition_helpers.go
+++ b/core/tests/e2e/condition_helpers.go
@@ -21,15 +21,15 @@
"errors"
"time"
- apipb "git.monogon.dev/source/nexantic.git/core/generated/api"
+ apb "git.monogon.dev/source/nexantic.git/core/proto/api"
)
-func waitForCondition(ctx context.Context, client apipb.NodeDebugServiceClient, condition string) error {
+func waitForCondition(ctx context.Context, client apb.NodeDebugServiceClient, condition string) error {
var lastErr = errors.New("No RPC for checking condition completed")
for {
- reqCtx, cancel := context.WithTimeout(ctx, 5*time.Second)
+ reqT, cancel := context.WithTimeout(ctx, 5*time.Second)
defer cancel()
- res, err := client.GetCondition(reqCtx, &apipb.GetConditionRequest{Name: condition})
+ res, err := client.GetCondition(reqT, &apb.GetConditionRequest{Name: condition})
if err != nil {
if err == ctx.Err() {
return err
diff --git a/core/tests/e2e/kubernetes_helpers.go b/core/tests/e2e/kubernetes_helpers.go
index e633538..d0337e6 100644
--- a/core/tests/e2e/kubernetes_helpers.go
+++ b/core/tests/e2e/kubernetes_helpers.go
@@ -30,17 +30,17 @@
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/clientcmd"
- apipb "git.monogon.dev/source/nexantic.git/core/generated/api"
+ apb "git.monogon.dev/source/nexantic.git/core/proto/api"
)
// getKubeClientSet gets a Kubeconfig from the debug API and creates a K8s ClientSet using it. The identity used has
// the system:masters group and thus has RBAC access to everything.
-func getKubeClientSet(ctx context.Context, client apipb.NodeDebugServiceClient, port uint16) (kubernetes.Interface, error) {
+func getKubeClientSet(ctx context.Context, client apb.NodeDebugServiceClient, port uint16) (kubernetes.Interface, error) {
var lastErr = errors.New("context canceled before any operation completed")
for {
- reqCtx, cancel := context.WithTimeout(ctx, 5*time.Second)
+ reqT, cancel := context.WithTimeout(ctx, 5*time.Second)
defer cancel()
- res, err := client.GetDebugKubeconfig(reqCtx, &apipb.GetDebugKubeconfigRequest{Id: "debug-user", Groups: []string{"system:masters"}})
+ res, err := client.GetDebugKubeconfig(reqT, &apb.GetDebugKubeconfigRequest{Id: "debug-user", Groups: []string{"system:masters"}})
if err == nil {
rawClientConfig, err := clientcmd.NewClientConfigFromBytes([]byte(res.DebugKubeconfig))
if err != nil {
diff --git a/core/tests/e2e/main_test.go b/core/tests/e2e/main_test.go
index 3ab03df..ae14a9a 100644
--- a/core/tests/e2e/main_test.go
+++ b/core/tests/e2e/main_test.go
@@ -34,9 +34,9 @@
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
podv1 "k8s.io/kubernetes/pkg/api/v1/pod"
- apipb "git.monogon.dev/source/nexantic.git/core/generated/api"
"git.monogon.dev/source/nexantic.git/core/internal/common"
"git.monogon.dev/source/nexantic.git/core/internal/launch"
+ apb "git.monogon.dev/source/nexantic.git/core/proto/api"
)
const (
@@ -90,7 +90,7 @@
if err != nil {
fmt.Printf("Failed to dial debug service (is it running): %v\n", err)
}
- debugClient := apipb.NewNodeDebugServiceClient(grpcClient)
+ debugClient := apb.NewNodeDebugServiceClient(grpcClient)
// This exists to keep the parent around while all the children race
// It currently tests both a set of OS-level conditions and Kubernetes Deployments and StatefulSets