forked from hswaw/hscloud
go: re-do the entire thing
This is a mega-change, but attempting to split this up further is probably not worth the effort. Summary: 1. Bump up bazel, rules_go, and others. 2. Switch to new go target naming (bye bye go_default_library) 3. Move go deps to go.mod/go.sum, use make gazelle generate from that 4. Bump up Python deps a bit And also whatever was required to actually get things to work - loads of small useless changes. Tested to work on NixOS and Ubuntu 20.04: $ bazel build //... $ bazel test //... Change-Id: I8364bdaa1406b9ae4d0385a6b607f3e7989f98a9 Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/1583 Reviewed-by: q3k <q3k@hackerspace.pl>master
parent
291f554164
commit
97b5cd7b58
2
.bazelrc
2
.bazelrc
|
@ -6,3 +6,5 @@ build --stamp
|
|||
build --workspace_status_command=./bzl/workspace-status.sh
|
||||
test --build_tests_only
|
||||
test --test_output=errors
|
||||
build --cxxopt=-std=c++14
|
||||
build --host_cxxopt=-std=c++14
|
||||
|
|
|
@ -1 +1 @@
|
|||
5.2.0
|
||||
5.4.1
|
||||
|
|
15
BUILD
15
BUILD
|
@ -2,15 +2,24 @@
|
|||
load("@bazel_gazelle//:def.bzl", "gazelle")
|
||||
|
||||
# Used by //go/workspace tests.
|
||||
exports_files(["WORKSPACE", "default.nix"])
|
||||
exports_files([
|
||||
"WORKSPACE",
|
||||
"default.nix",
|
||||
])
|
||||
|
||||
# gazelle:prefix code.hackerspace.pl/hscloud
|
||||
# gazelle:go_naming_convention go_default_library
|
||||
# gazelle:go_naming_convention import
|
||||
# gazelle:exclude **/gomod-generated-placeholder.go
|
||||
gazelle(name = "gazelle")
|
||||
|
||||
gazelle(
|
||||
name = "gazelle",
|
||||
name = "gazelle-update-repos",
|
||||
args = [
|
||||
"-from_file=go.mod",
|
||||
"-to_macro=third_party/go/repositories.bzl%go_repositories",
|
||||
"-prune",
|
||||
],
|
||||
command = "update-repos",
|
||||
)
|
||||
|
||||
config_setting(
|
||||
|
|
184
WORKSPACE
184
WORKSPACE
|
@ -2,50 +2,15 @@ workspace(
|
|||
name = "hscloud",
|
||||
)
|
||||
|
||||
local_repository(
|
||||
name = "rules_jvm_external",
|
||||
path = "/home/q3k/Software/rules_jvm_external",
|
||||
)
|
||||
|
||||
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
|
||||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
|
||||
|
||||
# Protobuf deps (shared between many rules).
|
||||
# Load this as early as possible, to avoid a different version being pulled in by deps of something else
|
||||
http_archive(
|
||||
name = "com_google_protobuf",
|
||||
sha256 = "8b28fdd45bab62d15db232ec404248901842e5340299a57765e48abe8a80d930",
|
||||
strip_prefix = "protobuf-3.20.1",
|
||||
urls = ["https://github.com/google/protobuf/archive/v3.20.1.tar.gz"],
|
||||
)
|
||||
|
||||
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
|
||||
|
||||
protobuf_deps()
|
||||
|
||||
rules_python_version = "0.13.0"
|
||||
http_archive(
|
||||
name = "rules_python",
|
||||
sha256 = "8c8fe44ef0a9afc256d1e75ad5f448bb59b81aba149b8958f02f7b3a98f5d9b4",
|
||||
strip_prefix = "rules_python-{}".format(rules_python_version),
|
||||
url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/{}.tar.gz".format(rules_python_version),
|
||||
)
|
||||
|
||||
# Download Go/Gazelle rules
|
||||
http_archive(
|
||||
name = "io_bazel_rules_go",
|
||||
sha256 = "099a9fb96a376ccbbb7d291ed4ecbdfd42f6bc822ab77ae6f1b5cb9e914e94fa",
|
||||
urls = [
|
||||
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.35.0/rules_go-v0.35.0.zip",
|
||||
"https://github.com/bazelbuild/rules_go/releases/download/v0.35.0/rules_go-v0.35.0.zip",
|
||||
],
|
||||
)
|
||||
|
||||
http_archive(
|
||||
name = "bazel_gazelle",
|
||||
sha256 = "448e37e0dbf61d6fa8f00aaa12d191745e14f07c31cabfa731f0c8e8a4f41b97",
|
||||
urls = [
|
||||
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.28.0/bazel-gazelle-v0.28.0.tar.gz",
|
||||
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.28.0/bazel-gazelle-v0.28.0.tar.gz",
|
||||
],
|
||||
)
|
||||
|
||||
# Gazelle started requiring this after we bumped the version to v0.28.0.
|
||||
# Load skylib
|
||||
http_archive(
|
||||
name = "bazel_skylib",
|
||||
sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
|
||||
|
@ -59,6 +24,67 @@ load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
|
|||
|
||||
bazel_skylib_workspace()
|
||||
|
||||
load("@bazel_skylib//lib:versions.bzl", "versions")
|
||||
|
||||
versions.check(minimum_bazel_version = "5.4.1")
|
||||
|
||||
# Protobuf deps (shared between many rules).
|
||||
# Load this as early as possible, to avoid a different version being pulled in by deps of something else
|
||||
http_archive(
|
||||
name = "com_google_protobuf",
|
||||
sha256 = "76a33e2136f23971ce46c72fd697cd94dc9f73d56ab23b753c3e16854c90ddfd",
|
||||
strip_prefix = "protobuf-2c5fa078d8e86e5f4bd34e6f4c9ea9e8d7d4d44a",
|
||||
urls = [
|
||||
"https://github.com/protocolbuffers/protobuf/archive/2c5fa078d8e86e5f4bd34e6f4c9ea9e8d7d4d44a.tar.gz",
|
||||
],
|
||||
)
|
||||
|
||||
http_archive(
|
||||
name = "rules_proto",
|
||||
sha256 = "dc3fb206a2cb3441b485eb1e423165b231235a1ea9b031b4433cf7bc1fa460dd",
|
||||
strip_prefix = "rules_proto-5.3.0-21.7",
|
||||
urls = [
|
||||
"https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz",
|
||||
],
|
||||
)
|
||||
|
||||
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
|
||||
|
||||
rules_proto_dependencies()
|
||||
|
||||
rules_proto_toolchains()
|
||||
|
||||
rules_python_version = "0.24.0"
|
||||
|
||||
http_archive(
|
||||
name = "rules_python",
|
||||
sha256 = "0a8003b044294d7840ac7d9d73eef05d6ceb682d7516781a4ec62eeb34702578",
|
||||
strip_prefix = "rules_python-{}".format(rules_python_version),
|
||||
url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/{}.tar.gz".format(rules_python_version),
|
||||
)
|
||||
|
||||
# Download Go/Gazelle rules
|
||||
http_archive(
|
||||
name = "io_bazel_rules_go",
|
||||
sha256 = "51dc53293afe317d2696d4d6433a4c33feedb7748a9e352072e2ec3c0dafd2c6",
|
||||
urls = [
|
||||
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.40.1/rules_go-v0.40.1.zip",
|
||||
"https://github.com/bazelbuild/rules_go/releases/download/v0.40.1/rules_go-v0.40.1.zip",
|
||||
],
|
||||
)
|
||||
|
||||
http_archive(
|
||||
name = "bazel_gazelle",
|
||||
sha256 = "29d5dafc2a5582995488c6735115d1d366fcd6a0fc2e2a153f02988706349825",
|
||||
urls = [
|
||||
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.31.0/bazel-gazelle-v0.31.0.tar.gz",
|
||||
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.31.0/bazel-gazelle-v0.31.0.tar.gz",
|
||||
],
|
||||
)
|
||||
|
||||
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
|
||||
load("//third_party/go:repositories.bzl", "go_repositories")
|
||||
|
||||
# Python rules
|
||||
load("@rules_python//python:repositories.bzl", "python_register_toolchains")
|
||||
|
||||
|
@ -77,19 +103,38 @@ pip_parse(
|
|||
)
|
||||
|
||||
load("@pydeps//:requirements.bzl", "install_deps")
|
||||
|
||||
install_deps()
|
||||
|
||||
# Setup Go toolchain.
|
||||
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains")
|
||||
|
||||
go_register_toolchains(version = "1.18.3")
|
||||
# gazelle:repository_macro third_party/go/repositories.bzl%go_repositories
|
||||
# gazelle:repository go_repository name=hscloud importpath=code.hackerspace.pl/hscloud
|
||||
go_repositories()
|
||||
|
||||
load("@bazel_gazelle//:deps.bzl", "go_repository")
|
||||
|
||||
go_repository(
|
||||
name = "org_golang_x_mod",
|
||||
build_external = "external",
|
||||
importpath = "golang.org/x/mod",
|
||||
sum = "h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=",
|
||||
version = "v0.10.0",
|
||||
)
|
||||
|
||||
go_rules_dependencies()
|
||||
|
||||
go_register_toolchains(go_version = "1.20.5")
|
||||
|
||||
# IMPORTANT: match protobuf version above with the one loaded by grpc
|
||||
http_archive(
|
||||
name = "com_github_grpc_grpc",
|
||||
sha256 = "419dba362eaf8f1d36849ceee17c3e2ff8ff12ac666b42d3ff02a164ebe090e9",
|
||||
strip_prefix = "grpc-1.30.0",
|
||||
urls = ["https://github.com/grpc/grpc/archive/v1.30.0.tar.gz"],
|
||||
patch_args = ["-p1"],
|
||||
patches = [
|
||||
"//third_party:grpc_extra_deps.patch",
|
||||
],
|
||||
sha256 = "931f07db9d48cff6a6007c1033ba6d691fe655bea2765444bc1ad974dfc840aa",
|
||||
strip_prefix = "grpc-1.56.2",
|
||||
urls = ["https://github.com/grpc/grpc/archive/v1.56.2.tar.gz"],
|
||||
)
|
||||
|
||||
# Load grpc deps after Go, to prevent overriding Go toolchains/SDK.
|
||||
|
@ -101,47 +146,20 @@ load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
|
|||
|
||||
grpc_extra_deps()
|
||||
|
||||
load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies")
|
||||
|
||||
go_rules_dependencies()
|
||||
|
||||
# gazelle:repository_macro third_party/go/repositories.bzl%go_repositories
|
||||
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
|
||||
|
||||
# Force newer version of golang.org/x/crypto that gazelle_dependencies would
|
||||
# usually get.
|
||||
go_repository(
|
||||
name = "org_golang_x_crypto",
|
||||
build_naming_convention = "go_default_library",
|
||||
importpath = "golang.org/x/crypto",
|
||||
sum = "h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg=",
|
||||
version = "v0.0.0-20210921155107-089bfa567519",
|
||||
)
|
||||
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
|
||||
|
||||
gazelle_dependencies()
|
||||
|
||||
# Load Go third-party packages.
|
||||
load("//third_party/go:repositories.bzl", "go_repositories")
|
||||
|
||||
go_repositories()
|
||||
|
||||
# Docker rules
|
||||
|
||||
http_archive(
|
||||
name = "io_bazel_rules_docker",
|
||||
sha256 = "27d53c1d646fc9537a70427ad7b034734d08a9c38924cc6357cc973fed300820",
|
||||
strip_prefix = "rules_docker-0.24.0",
|
||||
urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.24.0/rules_docker-v0.24.0.tar.gz"],
|
||||
sha256 = "b1e80761a8a8243d03ebca8845e9cc1ba6c82ce7c5179ce2b295cd36f7e394bf",
|
||||
urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.25.0/rules_docker-v0.25.0.tar.gz"],
|
||||
)
|
||||
|
||||
load("@io_bazel_rules_docker//toolchains/docker:toolchain.bzl", docker_toolchain_configure = "toolchain_configure")
|
||||
|
||||
# This forces the use of Docker $HOME/.docker configuration.
|
||||
docker_toolchain_configure(
|
||||
name = "docker_config",
|
||||
docker_path = "/usr/bin/docker",
|
||||
)
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_docker//repositories:repositories.bzl",
|
||||
container_repositories = "repositories",
|
||||
|
@ -254,12 +272,16 @@ gerrit_owners_deps()
|
|||
|
||||
# Go image repos for Docker
|
||||
|
||||
load("@io_bazel_rules_docker//go:image.bzl", go_image_repositories = "repositories")
|
||||
load(
|
||||
"@io_bazel_rules_docker//go:image.bzl",
|
||||
go_image_repos = "repositories",
|
||||
)
|
||||
|
||||
go_image_repositories()
|
||||
go_image_repos()
|
||||
|
||||
# //hswaw/site deps.
|
||||
load("//hswaw/site:deps.bzl", "hswaw_site_deps")
|
||||
|
||||
hswaw_site_deps()
|
||||
|
||||
# noVNC, used by //dc/drackvm.
|
||||
|
@ -287,7 +309,7 @@ filegroup(
|
|||
http_file(
|
||||
name = "calicoctl_3_15",
|
||||
downloaded_file_path = "calicoctl",
|
||||
urls = ["https://github.com/projectcalico/calicoctl/releases/download/v3.15.5/calicoctl"],
|
||||
sha256 = "f49e9e8d25108f7f22d5a51c756b2fe40cbe36347ad297e31a767376172f2845",
|
||||
executable = True,
|
||||
sha256 = "f49e9e8d25108f7f22d5a51c756b2fe40cbe36347ad297e31a767376172f2845",
|
||||
urls = ["https://github.com/projectcalico/calicoctl/releases/download/v3.15.5/calicoctl"],
|
||||
)
|
||||
|
|
|
@ -22,10 +22,10 @@ go_test(
|
|||
|
||||
container_layer(
|
||||
name = "layer_bin",
|
||||
directory = "/app/matrix/",
|
||||
files = [
|
||||
":media-repo-proxy",
|
||||
],
|
||||
directory = "/app/matrix/",
|
||||
)
|
||||
|
||||
container_image(
|
||||
|
@ -38,10 +38,9 @@ container_image(
|
|||
|
||||
container_push(
|
||||
name = "push",
|
||||
image = ":runtime",
|
||||
format = "Docker",
|
||||
image = ":runtime",
|
||||
registry = "registry.k0.hswaw.net",
|
||||
repository = "q3k/media-repo-proxy",
|
||||
tag = "1631791816-{STABLE_GIT_COMMIT}",
|
||||
)
|
||||
|
||||
|
|
|
@ -2,35 +2,35 @@ load("@io_bazel_rules_docker//container:container.bzl", "container_image", "cont
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "wellknown_lib",
|
||||
srcs = ["main.go"],
|
||||
importpath = "code.hackerspace.pl/hscloud/app/matrix/wellknown",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = [
|
||||
"//go/mirko:go_default_library",
|
||||
"@com_github_golang_glog//:go_default_library",
|
||||
"//go/mirko",
|
||||
"@com_github_golang_glog//:glog",
|
||||
],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "wellknown",
|
||||
embed = [":go_default_library"],
|
||||
embed = [":wellknown_lib"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
name = "wellknown_test",
|
||||
srcs = ["server_test.go"],
|
||||
embed = [":go_default_library"],
|
||||
deps = ["@com_github_go_test_deep//:go_default_library"],
|
||||
embed = [":wellknown_lib"],
|
||||
deps = ["@com_github_go_test_deep//:deep"],
|
||||
)
|
||||
|
||||
container_layer(
|
||||
name = "layer_bin",
|
||||
directory = "/app/matrix/",
|
||||
files = [
|
||||
":wellknown",
|
||||
],
|
||||
directory = "/app/matrix/",
|
||||
)
|
||||
|
||||
container_image(
|
||||
|
@ -43,8 +43,8 @@ container_image(
|
|||
|
||||
container_push(
|
||||
name = "push",
|
||||
image = ":runtime",
|
||||
format = "Docker",
|
||||
image = ":runtime",
|
||||
registry = "registry.k0.hswaw.net",
|
||||
repository = "q3k/wellknown",
|
||||
tag = "{BUILD_TIMESTAMP}-{STABLE_GIT_COMMIT}",
|
||||
|
|
|
@ -1,32 +1,30 @@
|
|||
load("@io_bazel_rules_docker//container:container.bzl", "container_image", "container_layer", "container_push")
|
||||
load("@subpar//:subpar.bzl", "par_binary")
|
||||
load("@pydeps//:requirements.bzl", "requirement")
|
||||
|
||||
par_binary(
|
||||
py_binary(
|
||||
name = "ripe-sync",
|
||||
srcs = [
|
||||
"ripe-sync.py",
|
||||
],
|
||||
legacy_create_init = False,
|
||||
deps = [
|
||||
requirement("requests"),
|
||||
"//bgpwtf/cccampix/proto:ix_py_proto",
|
||||
"//bgpwtf/cccampix/proto:ix_grpc_proto",
|
||||
"//bgpwtf/cccampix/proto:ix_py_proto",
|
||||
],
|
||||
legacy_create_init = False,
|
||||
zip_safe = False,
|
||||
)
|
||||
|
||||
container_layer(
|
||||
name = "layer_bin",
|
||||
files = [
|
||||
"//bgpwtf/cccampix:ripe-sync.par",
|
||||
"//bgpwtf/cccampix/irr:irr",
|
||||
"//bgpwtf/cccampix/pgpencryptor:pgpencryptor",
|
||||
"//bgpwtf/cccampix/peeringdb:peeringdb",
|
||||
"//bgpwtf/cccampix/verifier:verifier",
|
||||
"//bgpwtf/cccampix/frontend:frontend.par",
|
||||
],
|
||||
directory = "/ix/",
|
||||
files = [
|
||||
"//bgpwtf/cccampix:ripe-sync",
|
||||
"//bgpwtf/cccampix/frontend",
|
||||
"//bgpwtf/cccampix/irr",
|
||||
"//bgpwtf/cccampix/peeringdb",
|
||||
"//bgpwtf/cccampix/pgpencryptor",
|
||||
"//bgpwtf/cccampix/verifier",
|
||||
],
|
||||
)
|
||||
|
||||
container_image(
|
||||
|
@ -41,8 +39,8 @@ container_image(
|
|||
|
||||
container_push(
|
||||
name = "push",
|
||||
image = ":runtime",
|
||||
format = "Docker",
|
||||
image = ":runtime",
|
||||
registry = "registry.k0.hswaw.net",
|
||||
repository = "bgpwtf/cccampix",
|
||||
tag = "{BUILD_TIMESTAMP}-{STABLE_GIT_COMMIT}",
|
||||
|
|
|
@ -1,21 +1,22 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "birdie_lib",
|
||||
srcs = ["birdie.go"],
|
||||
importpath = "code.hackerspace.pl/hscloud/bgpwtf/cccampix/birdie",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = [
|
||||
"//bgpwtf/cccampix/proto:go_default_library",
|
||||
"@com_github_golang_glog//:go_default_library",
|
||||
"//bgpwtf/cccampix/proto",
|
||||
"@com_github_golang_glog//:glog",
|
||||
"@org_golang_google_grpc//:go_default_library",
|
||||
"@org_golang_google_grpc//credentials:go_default_library",
|
||||
"@org_golang_google_grpc//credentials",
|
||||
],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "birdie",
|
||||
embed = [":go_default_library"],
|
||||
embed = [":birdie_lib"],
|
||||
pure = "on",
|
||||
static = "on",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
load("@subpar//:subpar.bzl", "par_binary")
|
||||
load("@pydeps//:requirements.bzl", "requirement")
|
||||
|
||||
py_library(
|
||||
name = "frontend_lib",
|
||||
srcs = [
|
||||
"frontend.py",
|
||||
"channel.py",
|
||||
"frontend.py",
|
||||
],
|
||||
data = glob([
|
||||
"templates/**",
|
||||
|
@ -15,8 +14,8 @@ py_library(
|
|||
requirement("flask"),
|
||||
requirement("werkzeug"),
|
||||
requirement("itsdangerous"),
|
||||
"//bgpwtf/cccampix/proto:ix_py_proto",
|
||||
"//bgpwtf/cccampix/proto:ix_grpc_proto",
|
||||
"//bgpwtf/cccampix/proto:ix_py_proto",
|
||||
],
|
||||
)
|
||||
|
||||
|
@ -31,22 +30,21 @@ py_binary(
|
|||
],
|
||||
)
|
||||
|
||||
par_binary(
|
||||
py_binary(
|
||||
name = "frontend",
|
||||
main = "server.py",
|
||||
srcs = [
|
||||
"server.py",
|
||||
],
|
||||
legacy_create_init = False,
|
||||
main = "server.py",
|
||||
visibility = [
|
||||
"//bgpwtf/cccampix:__pkg__",
|
||||
],
|
||||
deps = [
|
||||
":frontend_lib",
|
||||
requirement("gevent"),
|
||||
requirement("gunicorn"),
|
||||
requirement("greenlet"),
|
||||
],
|
||||
visibility = [
|
||||
"//bgpwtf/cccampix:__pkg__",
|
||||
],
|
||||
legacy_create_init = False,
|
||||
zip_safe = False,
|
||||
#no_remove = True,
|
||||
)
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "irr_lib",
|
||||
srcs = ["main.go"],
|
||||
importpath = "code.hackerspace.pl/hscloud/bgpwtf/cccampix/irr",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = [
|
||||
"//bgpwtf/cccampix/irr/provider:go_default_library",
|
||||
"//bgpwtf/cccampix/proto:go_default_library",
|
||||
"//go/mirko:go_default_library",
|
||||
"@com_github_golang_glog//:go_default_library",
|
||||
"@org_golang_google_grpc//codes:go_default_library",
|
||||
"@org_golang_google_grpc//status:go_default_library",
|
||||
"//bgpwtf/cccampix/irr/provider",
|
||||
"//bgpwtf/cccampix/proto",
|
||||
"//go/mirko",
|
||||
"@com_github_golang_glog//:glog",
|
||||
"@org_golang_google_grpc//codes",
|
||||
"@org_golang_google_grpc//status",
|
||||
],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "irr",
|
||||
embed = [":go_default_library"],
|
||||
embed = [":irr_lib"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "provider",
|
||||
srcs = [
|
||||
"arin.go",
|
||||
"iana.go",
|
||||
|
@ -12,21 +12,21 @@ go_library(
|
|||
importpath = "code.hackerspace.pl/hscloud/bgpwtf/cccampix/irr/provider",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//bgpwtf/cccampix/irr/whois:go_default_library",
|
||||
"//bgpwtf/cccampix/proto:go_default_library",
|
||||
"@com_github_golang_collections_go_datastructures//augmentedtree:go_default_library",
|
||||
"@com_github_golang_glog//:go_default_library",
|
||||
"@org_golang_google_grpc//codes:go_default_library",
|
||||
"@org_golang_google_grpc//status:go_default_library",
|
||||
"//bgpwtf/cccampix/irr/whois",
|
||||
"//bgpwtf/cccampix/proto",
|
||||
"@com_github_golang_collections_go_datastructures//augmentedtree",
|
||||
"@com_github_golang_glog//:glog",
|
||||
"@org_golang_google_grpc//codes",
|
||||
"@org_golang_google_grpc//status",
|
||||
],
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
name = "provider_test",
|
||||
srcs = ["rpsl_test.go"],
|
||||
embed = [":go_default_library"],
|
||||
embed = [":provider"],
|
||||
deps = [
|
||||
"//bgpwtf/cccampix/proto:go_default_library",
|
||||
"@com_github_go_test_deep//:go_default_library",
|
||||
"//bgpwtf/cccampix/proto",
|
||||
"@com_github_go_test_deep//:deep",
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "whois",
|
||||
srcs = ["whois.go"],
|
||||
importpath = "code.hackerspace.pl/hscloud/bgpwtf/cccampix/irr/whois",
|
||||
visibility = ["//visibility:public"],
|
||||
|
|
|
@ -2,17 +2,17 @@ load("@io_bazel_rules_docker//container:container.bzl", "container_image", "cont
|
|||
|
||||
container_layer(
|
||||
name = "layer_bin",
|
||||
files = [
|
||||
"@com_github_cloudflare_cfrpki//cmd/octorpki:octorpki",
|
||||
"entrypoint.sh",
|
||||
],
|
||||
directory = "/octorpki/",
|
||||
files = [
|
||||
"entrypoint.sh",
|
||||
"@com_github_cloudflare_cfrpki//cmd/octorpki",
|
||||
],
|
||||
visibility = ["//bgpwtf/cccampix:__pkg__"],
|
||||
)
|
||||
|
||||
container_layer(
|
||||
name = "layer_tals",
|
||||
files = glob(["tals/*"]),
|
||||
directory = "/octorpki/tals/",
|
||||
files = glob(["tals/*"]),
|
||||
visibility = ["//bgpwtf/cccampix:__pkg__"],
|
||||
)
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
//go:build tools
|
||||
|
||||
// +tools
|
||||
package octorpki
|
||||
|
||||
import (
|
||||
_ "github.com/cloudflare/cfrpki/cmd/octorpki"
|
||||
)
|
|
@ -1,22 +1,22 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "peeringdb_lib",
|
||||
srcs = ["main.go"],
|
||||
importpath = "code.hackerspace.pl/hscloud/bgpwtf/cccampix/peeringdb",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = [
|
||||
"//bgpwtf/cccampix/peeringdb/schema:go_default_library",
|
||||
"//bgpwtf/cccampix/proto:go_default_library",
|
||||
"//go/mirko:go_default_library",
|
||||
"@com_github_golang_glog//:go_default_library",
|
||||
"@org_golang_google_grpc//codes:go_default_library",
|
||||
"@org_golang_google_grpc//status:go_default_library",
|
||||
"//bgpwtf/cccampix/peeringdb/schema",
|
||||
"//bgpwtf/cccampix/proto",
|
||||
"//go/mirko",
|
||||
"@com_github_golang_glog//:glog",
|
||||
"@org_golang_google_grpc//codes",
|
||||
"@org_golang_google_grpc//status",
|
||||
],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "peeringdb",
|
||||
embed = [":go_default_library"],
|
||||
embed = [":peeringdb_lib"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "schema",
|
||||
srcs = [
|
||||
"schema.go",
|
||||
"urls.go",
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "pgpencryptor_lib",
|
||||
srcs = ["main.go"],
|
||||
importpath = "code.hackerspace.pl/hscloud/bgpwtf/cccampix/pgpencryptor",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = [
|
||||
"//bgpwtf/cccampix/pgpencryptor/gpg:go_default_library",
|
||||
"//bgpwtf/cccampix/pgpencryptor/hkp:go_default_library",
|
||||
"//bgpwtf/cccampix/pgpencryptor/model:go_default_library",
|
||||
"//bgpwtf/cccampix/proto:go_default_library",
|
||||
"//go/mirko:go_default_library",
|
||||
"@com_github_golang_glog//:go_default_library",
|
||||
"@com_github_lib_pq//:go_default_library",
|
||||
"@org_golang_google_grpc//codes:go_default_library",
|
||||
"@org_golang_google_grpc//status:go_default_library",
|
||||
"//bgpwtf/cccampix/pgpencryptor/gpg",
|
||||
"//bgpwtf/cccampix/pgpencryptor/hkp",
|
||||
"//bgpwtf/cccampix/pgpencryptor/model",
|
||||
"//bgpwtf/cccampix/proto",
|
||||
"//go/mirko",
|
||||
"@com_github_golang_glog//:glog",
|
||||
"@com_github_lib_pq//:pq",
|
||||
"@org_golang_google_grpc//codes",
|
||||
"@org_golang_google_grpc//status",
|
||||
],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "pgpencryptor",
|
||||
embed = [":go_default_library"],
|
||||
embed = [":pgpencryptor_lib"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "gpg",
|
||||
srcs = ["gpg.go"],
|
||||
importpath = "code.hackerspace.pl/hscloud/bgpwtf/cccampix/pgpencryptor/gpg",
|
||||
visibility = ["//visibility:public"],
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "hkp",
|
||||
srcs = ["hkp.go"],
|
||||
importpath = "code.hackerspace.pl/hscloud/bgpwtf/cccampix/pgpencryptor/hkp",
|
||||
visibility = ["//visibility:public"],
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "model",
|
||||
srcs = [
|
||||
"model.go",
|
||||
"pgp.go",
|
||||
|
@ -10,10 +10,10 @@ go_library(
|
|||
importpath = "code.hackerspace.pl/hscloud/bgpwtf/cccampix/pgpencryptor/model",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//bgpwtf/cccampix/pgpencryptor/model/migrations:go_default_library",
|
||||
"@com_github_golang_migrate_migrate_v4//:go_default_library",
|
||||
"@com_github_golang_migrate_migrate_v4//database/cockroachdb:go_default_library",
|
||||
"@com_github_jmoiron_sqlx//:go_default_library",
|
||||
"@com_github_lib_pq//:go_default_library",
|
||||
"//bgpwtf/cccampix/pgpencryptor/model/migrations",
|
||||
"@com_github_golang_migrate_migrate_v4//:migrate",
|
||||
"@com_github_golang_migrate_migrate_v4//database/cockroachdb",
|
||||
"@com_github_jmoiron_sqlx//:sqlx",
|
||||
"@com_github_lib_pq//:pq",
|
||||
],
|
||||
)
|
||||
|
|
|
@ -4,12 +4,12 @@ load("@io_bazel_rules_go//extras:embed_data.bzl", "go_embed_data")
|
|||
go_embed_data(
|
||||
name = "migrations_data",
|
||||
srcs = glob(["*.sql"]),
|
||||
package = "migrations",
|
||||
flatten = True,
|
||||
package = "migrations",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "migrations",
|
||||
srcs = [
|
||||
"migrations.go",
|
||||
":migrations_data", # keep
|
||||
|
@ -17,7 +17,7 @@ go_library(
|
|||
importpath = "code.hackerspace.pl/hscloud/bgpwtf/cccampix/pgpencryptor/model/migrations",
|
||||
visibility = ["//bgpwtf/cccampix/pgpencryptor/model:__subpackages__"],
|
||||
deps = [
|
||||
"//go/mirko:go_default_library",
|
||||
"@com_github_golang_migrate_migrate_v4//:go_default_library",
|
||||
"//go/mirko",
|
||||
"@com_github_golang_migrate_migrate_v4//:migrate",
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
load("@rules_proto//proto:defs.bzl", "proto_library")
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
|
||||
load("@com_github_grpc_grpc//bazel:python_rules.bzl", "py_proto_library", "py_grpc_library")
|
||||
|
||||
load("@com_github_grpc_grpc//bazel:python_rules.bzl", "py_grpc_library", "py_proto_library")
|
||||
|
||||
proto_library(
|
||||
name = "ix_proto",
|
||||
|
@ -18,7 +18,7 @@ go_proto_library(
|
|||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "proto",
|
||||
embed = [":ix_go_proto"],
|
||||
importpath = "code.hackerspace.pl/hscloud/bgpwtf/cccampix/proto",
|
||||
visibility = ["//visibility:public"],
|
||||
|
@ -26,13 +26,13 @@ go_library(
|
|||
|
||||
py_proto_library(
|
||||
name = "ix_py_proto",
|
||||
deps = [":ix_proto"],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [":ix_proto"],
|
||||
)
|
||||
|
||||
py_grpc_library(
|
||||
name = "ix_grpc_proto",
|
||||
srcs = [":ix_proto"],
|
||||
deps = [":ix_py_proto"],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [":ix_py_proto"],
|
||||
)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "verifier_lib",
|
||||
srcs = [
|
||||
"main.go",
|
||||
"processor_irr.go",
|
||||
|
@ -17,24 +17,24 @@ go_library(
|
|||
importpath = "code.hackerspace.pl/hscloud/bgpwtf/cccampix/verifier",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = [
|
||||
"//bgpwtf/cccampix/proto:go_default_library",
|
||||
"//bgpwtf/cccampix/verifier/model:go_default_library",
|
||||
"//go/mirko:go_default_library",
|
||||
"//go/pki:go_default_library",
|
||||
"//go/statusz:go_default_library",
|
||||
"@com_github_dustin_go_humanize//:go_default_library",
|
||||
"@com_github_golang_glog//:go_default_library",
|
||||
"@com_github_lib_pq//:go_default_library",
|
||||
"@com_github_sethvargo_go_password//password:go_default_library",
|
||||
"//bgpwtf/cccampix/proto",
|
||||
"//bgpwtf/cccampix/verifier/model",
|
||||
"//go/mirko",
|
||||
"//go/pki",
|
||||
"//go/statusz",
|
||||
"@com_github_dustin_go_humanize//:go-humanize",
|
||||
"@com_github_golang_glog//:glog",
|
||||
"@com_github_lib_pq//:pq",
|
||||
"@com_github_sethvargo_go_password//password",
|
||||
"@org_golang_google_grpc//:go_default_library",
|
||||
"@org_golang_google_grpc//codes:go_default_library",
|
||||
"@org_golang_google_grpc//status:go_default_library",
|
||||
"@org_golang_x_net//trace:go_default_library",
|
||||
"@org_golang_google_grpc//codes",
|
||||
"@org_golang_google_grpc//status",
|
||||
"@org_golang_x_net//trace",
|
||||
],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "verifier",
|
||||
embed = [":go_default_library"],
|
||||
embed = [":verifier_lib"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "model",
|
||||
srcs = [
|
||||
"allowed_prefixes.go",
|
||||
"checkable_peers.go",
|
||||
|
@ -17,12 +17,12 @@ go_library(
|
|||
importpath = "code.hackerspace.pl/hscloud/bgpwtf/cccampix/verifier/model",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//bgpwtf/cccampix/proto:go_default_library",
|
||||
"//bgpwtf/cccampix/verifier/model/migrations:go_default_library",
|
||||
"@com_github_golang_glog//:go_default_library",
|
||||
"@com_github_golang_migrate_migrate_v4//:go_default_library",
|
||||
"@com_github_golang_migrate_migrate_v4//database/cockroachdb:go_default_library",
|
||||
"@com_github_jmoiron_sqlx//:go_default_library",
|
||||
"@com_github_lib_pq//:go_default_library",
|
||||
"//bgpwtf/cccampix/proto",
|
||||
"//bgpwtf/cccampix/verifier/model/migrations",
|
||||
"@com_github_golang_glog//:glog",
|
||||
"@com_github_golang_migrate_migrate_v4//:migrate",
|
||||
"@com_github_golang_migrate_migrate_v4//database/cockroachdb",
|
||||
"@com_github_jmoiron_sqlx//:sqlx",
|
||||
"@com_github_lib_pq//:pq",
|
||||
],
|
||||
)
|
||||
|
|
|
@ -4,12 +4,12 @@ load("@io_bazel_rules_go//extras:embed_data.bzl", "go_embed_data")
|
|||
go_embed_data(
|
||||
name = "migrations_data",
|
||||
srcs = glob(["*.sql"]),
|
||||
package = "migrations",
|
||||
flatten = True,
|
||||
package = "migrations",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "migrations",
|
||||
srcs = [
|
||||
"migrations.go",
|
||||
":migrations_data", # keep
|
||||
|
@ -17,7 +17,7 @@ go_library(
|
|||
importpath = "code.hackerspace.pl/hscloud/bgpwtf/cccampix/verifier/model/migrations",
|
||||
visibility = ["//bgpwtf/cccampix/verifier/model:__subpackages__"],
|
||||
deps = [
|
||||
"//go/mirko:go_default_library",
|
||||
"@com_github_golang_migrate_migrate_v4//:go_default_library",
|
||||
"//go/mirko",
|
||||
"@com_github_golang_migrate_migrate_v4//:migrate",
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "invoice_lib",
|
||||
srcs = [
|
||||
"calc.go",
|
||||
"main.go",
|
||||
|
@ -13,27 +13,28 @@ go_library(
|
|||
importpath = "code.hackerspace.pl/hscloud/bgpwtf/invoice",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = [
|
||||
"//bgpwtf/invoice/proto:go_default_library",
|
||||
"//bgpwtf/invoice/templates:go_default_library",
|
||||
"//go/mirko:go_default_library",
|
||||
"//go/statusz:go_default_library",
|
||||
"@com_github_golang_glog//:go_default_library",
|
||||
"//bgpwtf/invoice/proto",
|
||||
"//bgpwtf/invoice/templates",
|
||||
"//go/mirko",
|
||||
"//go/statusz",
|
||||
"@com_github_golang_glog//:glog",
|
||||
"@com_github_golang_protobuf//proto:go_default_library",
|
||||
"@com_github_mattn_go_sqlite3//:go_default_library",
|
||||
"@com_github_sebastiaanklippert_go_wkhtmltopdf//:go_default_library",
|
||||
"@org_golang_google_grpc//codes:go_default_library",
|
||||
"@org_golang_google_grpc//status:go_default_library",
|
||||
"@com_github_mattn_go_sqlite3//:go-sqlite3",
|
||||
"@com_github_sebastiaanklippert_go_wkhtmltopdf//:go-wkhtmltopdf",
|
||||
"@org_golang_google_grpc//codes",
|
||||
"@org_golang_google_grpc//status",
|
||||
],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "invoice",
|
||||
embed = [":go_default_library"],
|
||||
embed = [":invoice_lib"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
name = "invoice_test",
|
||||
srcs = ["calc_test.go"],
|
||||
embed = [":go_default_library"],
|
||||
embed = [":invoice_lib"],
|
||||
deps = ["//bgpwtf/invoice/proto"],
|
||||
)
|
||||
|
|
|
@ -20,7 +20,7 @@ go_proto_library(
|
|||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "proto",
|
||||
embed = [":proto_go_proto"],
|
||||
importpath = "code.hackerspace.pl/hscloud/bgpwtf/invoice/proto",
|
||||
visibility = ["//visibility:public"],
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "recurrent_lib",
|
||||
srcs = ["main.go"],
|
||||
importpath = "code.hackerspace.pl/hscloud/bgpwtf/invoice/recurrent",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = [
|
||||
"//bgpwtf/invoice/proto:go_default_library",
|
||||
"//go/pki:go_default_library",
|
||||
"@com_github_golang_glog//:go_default_library",
|
||||
"//bgpwtf/invoice/proto",
|
||||
"//go/pki",
|
||||
"@com_github_golang_glog//:glog",
|
||||
"@com_github_golang_protobuf//proto:go_default_library",
|
||||
"@org_golang_google_grpc//:go_default_library",
|
||||
],
|
||||
|
@ -16,6 +16,6 @@ go_library(
|
|||
|
||||
go_binary(
|
||||
name = "recurrent",
|
||||
embed = [":go_default_library"],
|
||||
embed = [":recurrent_lib"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
wkhtml "github.com/sebastiaanklippert/go-wkhtmltopdf"
|
||||
wkhtml "github.com/SebastiaanKlippert/go-wkhtmltopdf"
|
||||
|
||||
pb "code.hackerspace.pl/hscloud/bgpwtf/invoice/proto"
|
||||
"code.hackerspace.pl/hscloud/bgpwtf/invoice/templates"
|
||||
|
|
|
@ -9,7 +9,7 @@ bindata(
|
|||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "templates",
|
||||
srcs = [
|
||||
":templates_bindata", # keep
|
||||
],
|
||||
|
|
|
@ -4,7 +4,11 @@ load("@io_bazel_rules_go//extras:embed_data.bzl", "go_embed_data")
|
|||
|
||||
go_embed_data(
|
||||
name = "static",
|
||||
srcs = ["index.html", "speedtest.js", "speedtest_worker.js"],
|
||||
srcs = [
|
||||
"index.html",
|
||||
"speedtest.js",
|
||||
"speedtest_worker.js",
|
||||
],
|
||||
package = "static",
|
||||
)
|
||||
|
||||
|
@ -19,15 +23,15 @@ go_library(
|
|||
container_image(
|
||||
name = "latest",
|
||||
base = "@prodimage-bionic//image",
|
||||
files = ["//bgpwtf/speedtest/backend:backend"],
|
||||
directory = "/hscloud",
|
||||
entrypoint = ["/hscloud/backend"],
|
||||
files = ["//bgpwtf/speedtest/backend"],
|
||||
)
|
||||
|
||||
container_push(
|
||||
name = "push",
|
||||
image = ":latest",
|
||||
format = "Docker",
|
||||
image = ":latest",
|
||||
registry = "registry.k0.hswaw.net",
|
||||
repository = "q3k/speedetst",
|
||||
tag = "{BUILD_TIMESTAMP}-{STABLE_GIT_COMMIT}",
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "backend_lib",
|
||||
srcs = ["main.go"],
|
||||
importpath = "code.hackerspace.pl/hscloud/bgpwtf/speedtest/backend",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = [
|
||||
"@com_github_golang_glog//:go_default_library",
|
||||
"//bgpwtf/speedtest:static_go", # keep
|
||||
"@com_github_golang_glog//:glog",
|
||||
],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "backend",
|
||||
embed = [":go_default_library"],
|
||||
embed = [":backend_lib"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
name = "backend_test",
|
||||
srcs = ["main_test.go"],
|
||||
embed = [":go_default_library"],
|
||||
embed = [":backend_lib"],
|
||||
)
|
||||
|
|
|
@ -30,7 +30,7 @@ echo STABLE_GIT_COMMIT $(git rev-parse HEAD)
|
|||
echo STABLE_GIT_VERSION $(rev .)
|
||||
echo STABLE_BUILDER $(id -un)@$(hostname -f):$(pwd)
|
||||
|
||||
# Kubernetes compatibility - see //third_party/go/kubernetes:version.bzl.
|
||||
# Kubernetes compatibility - see //third_party/go:kubernetes_version_def.bzl.
|
||||
echo STABLE_KUBERNETES_buildDate $(date -u +'%Y-%m-%dT%H:%M:%SZ')
|
||||
echo STABLE_KUBERNETES_gitCommit $(git rev-parse HEAD)
|
||||
echo STABLE_KUBERNETES_gitMajor $KUBE_MAJOR
|
||||
|
|
|
@ -2,7 +2,7 @@ load("@io_bazel_rules_docker//container:container.bzl", "container_image", "cont
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "admitomatic_lib",
|
||||
srcs = [
|
||||
"ingress.go",
|
||||
"main.go",
|
||||
|
@ -11,40 +11,40 @@ go_library(
|
|||
importpath = "code.hackerspace.pl/hscloud/cluster/admitomatic",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = [
|
||||
"//cluster/admitomatic/config:go_default_library",
|
||||
"//go/mirko:go_default_library",
|
||||
"@com_github_golang_glog//:go_default_library",
|
||||
"@io_k8s_api//admission/v1beta1:go_default_library",
|
||||
"@io_k8s_api//networking/v1beta1:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library",
|
||||
"@org_golang_google_protobuf//encoding/prototext:go_default_library",
|
||||
"//cluster/admitomatic/config",
|
||||
"//go/mirko",
|
||||
"@com_github_golang_glog//:glog",
|
||||
"@io_k8s_api//admission/v1beta1",
|
||||
"@io_k8s_api//networking/v1beta1",
|
||||
"@io_k8s_apimachinery//pkg/apis/meta/v1:meta",
|
||||
"@org_golang_google_protobuf//encoding/prototext",
|
||||
],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "admitomatic",
|
||||
embed = [":go_default_library"],
|
||||
embed = [":admitomatic_lib"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
name = "admitomatic_test",
|
||||
srcs = ["ingress_test.go"],
|
||||
embed = [":go_default_library"],
|
||||
embed = [":admitomatic_lib"],
|
||||
deps = [
|
||||
"@io_k8s_api//admission/v1beta1:go_default_library",
|
||||
"@io_k8s_api//networking/v1beta1:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/runtime:go_default_library",
|
||||
"@io_k8s_api//admission/v1beta1",
|
||||
"@io_k8s_api//networking/v1beta1",
|
||||
"@io_k8s_apimachinery//pkg/apis/meta/v1:meta",
|
||||
"@io_k8s_apimachinery//pkg/runtime",
|
||||
],
|
||||
)
|
||||
|
||||
container_layer(
|
||||
name = "layer_bin",
|
||||
directory = "/cluster/admitomatic/",
|
||||
files = [
|
||||
":admitomatic",
|
||||
],
|
||||
directory = "/cluster/admitomatic/",
|
||||
)
|
||||
|
||||
container_image(
|
||||
|
@ -57,8 +57,8 @@ container_image(
|
|||
|
||||
container_push(
|
||||
name = "push",
|
||||
image = ":runtime",
|
||||
format = "Docker",
|
||||
image = ":runtime",
|
||||
registry = "registry.k0.hswaw.net",
|
||||
repository = "cluster/admitomatic",
|
||||
tag = "{BUILD_TIMESTAMP}-{STABLE_GIT_COMMIT}",
|
||||
|
|
|
@ -16,7 +16,7 @@ go_proto_library(
|
|||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "config",
|
||||
embed = [":config_go_proto"],
|
||||
importpath = "code.hackerspace.pl/hscloud/cluster/admitomatic/config",
|
||||
visibility = ["//visibility:public"],
|
||||
|
|
|
@ -4,15 +4,15 @@ load("@io_bazel_rules_go//extras:embed_data.bzl", "go_embed_data")
|
|||
go_embed_data(
|
||||
name = "certs_data",
|
||||
srcs = glob(["*.crt"]),
|
||||
package = "certs",
|
||||
flatten = True,
|
||||
package = "certs",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "certs",
|
||||
srcs = [
|
||||
":certs_data", # keep
|
||||
],
|
||||
importpath = "code.hackerspace.pl/cluster/certs",
|
||||
importpath = "code.hackerspace.pl/hscloud/cluster/certs", # keep
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "clustercfg_lib",
|
||||
srcs = [
|
||||
"cmd_admincreds.go",
|
||||
"cmd_gencerts.go",
|
||||
|
@ -10,16 +10,16 @@ go_library(
|
|||
importpath = "code.hackerspace.pl/hscloud/cluster/clustercfg",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = [
|
||||
"//cluster/clustercfg/certs:go_default_library",
|
||||
"//go/workspace:go_default_library",
|
||||
"@com_github_spf13_cobra//:go_default_library",
|
||||
"@io_k8s_client_go//tools/clientcmd:go_default_library",
|
||||
"@io_k8s_client_go//tools/clientcmd/api:go_default_library",
|
||||
"//cluster/clustercfg/certs",
|
||||
"//go/workspace",
|
||||
"@com_github_spf13_cobra//:cobra",
|
||||
"@io_k8s_client_go//tools/clientcmd",
|
||||
"@io_k8s_client_go//tools/clientcmd/api",
|
||||
],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "clustercfg",
|
||||
embed = [":go_default_library"],
|
||||
embed = [":clustercfg_lib"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "certs",
|
||||
srcs = [
|
||||
"certs.go",
|
||||
"generator.go",
|
||||
|
|
|
@ -2,46 +2,46 @@ load("@io_bazel_rules_docker//container:container.bzl", "container_image", "cont
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "identd_lib",
|
||||
srcs = ["main.go"],
|
||||
importpath = "code.hackerspace.pl/hscloud/cluster/identd",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = [
|
||||
"//cluster/identd/ident:go_default_library",
|
||||
"//cluster/identd/kubenat:go_default_library",
|
||||
"//go/mirko:go_default_library",
|
||||
"@com_github_golang_glog//:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library",
|
||||
"//cluster/identd/ident",
|
||||
"//cluster/identd/kubenat",
|
||||
"//go/mirko",
|
||||
"@com_github_golang_glog//:glog",
|
||||
"@io_k8s_apimachinery//pkg/apis/meta/v1:meta",
|
||||
],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "identd",
|
||||
embed = [":go_default_library"],
|
||||
embed = [":identd_lib"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
container_layer(
|
||||
name = "layer_bin",
|
||||
directory = "/cluster/identd/",
|
||||
files = [
|
||||
":identd",
|
||||
],
|
||||
directory = "/cluster/identd/",
|
||||
)
|
||||
|
||||
container_image(
|
||||
name = "runtime",
|
||||
base = "@prodimage-bionic//image",
|
||||
entrypoint = "/cluster/identd/identd",
|
||||
layers = [
|
||||
":layer_bin",
|
||||
],
|
||||
entrypoint = "/cluster/identd/identd",
|
||||
)
|
||||
|
||||
container_push(
|
||||
name = "push",
|
||||
image = ":runtime",
|
||||
format = "Docker",
|
||||
image = ":runtime",
|
||||
registry = "registry.k0.hswaw.net",
|
||||
repository = "q3k/identd",
|
||||
tag = "{BUILD_TIMESTAMP}-{STABLE_GIT_COMMIT}",
|
||||
|
|
|
@ -17,7 +17,7 @@ go_proto_library(
|
|||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "cri",
|
||||
embed = [":cri_go_proto"],
|
||||
importpath = "code.hackerspace.pl/hscloud/cluster/identd/cri",
|
||||
visibility = ["//visibility:public"],
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "ident",
|
||||
srcs = [
|
||||
"client.go",
|
||||
"errors.go",
|
||||
|
@ -11,17 +11,17 @@ go_library(
|
|||
],
|
||||
importpath = "code.hackerspace.pl/hscloud/cluster/identd/ident",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = ["@com_github_golang_glog//:go_default_library"],
|
||||
deps = ["@com_github_golang_glog//:glog"],
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
name = "ident_test",
|
||||
srcs = [
|
||||
"e2e_test.go",
|
||||
"request_test.go",
|
||||
"response_test.go",
|
||||
"server_test.go",
|
||||
],
|
||||
embed = [":go_default_library"],
|
||||
deps = ["@com_github_go_test_deep//:go_default_library"],
|
||||
embed = [":ident"],
|
||||
deps = ["@com_github_go_test_deep//:deep"],
|
||||
)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "kubenat",
|
||||
srcs = [
|
||||
"kubenat.go",
|
||||
"pods.go",
|
||||
|
@ -10,25 +10,25 @@ go_library(
|
|||
importpath = "code.hackerspace.pl/hscloud/cluster/identd/kubenat",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//cluster/identd/cri:go_default_library",
|
||||
"@com_github_cenkalti_backoff//:go_default_library",
|
||||
"@com_github_golang_glog//:go_default_library",
|
||||
"//cluster/identd/cri",
|
||||
"@com_github_cenkalti_backoff//:backoff",
|
||||
"@com_github_golang_glog//:glog",
|
||||
"@org_golang_google_grpc//:go_default_library",
|
||||
"@org_golang_google_grpc//codes:go_default_library",
|
||||
"@org_golang_google_grpc//status:go_default_library",
|
||||
"@org_golang_google_grpc//codes",
|
||||
"@org_golang_google_grpc//status",
|
||||
],
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
name = "kubenat_test",
|
||||
srcs = [
|
||||
"kubenat_test.go",
|
||||
"pods_test.go",
|
||||
"translation_test.go",
|
||||
],
|
||||
embed = [":go_default_library"],
|
||||
embed = [":kubenat"],
|
||||
deps = [
|
||||
"@com_github_go_test_deep//:go_default_library",
|
||||
"@com_github_golang_glog//:go_default_library",
|
||||
"@com_github_go_test_deep//:deep",
|
||||
"@com_github_golang_glog//:glog",
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "prodaccess_lib",
|
||||
srcs = [
|
||||
"hspki.go",
|
||||
"kubernetes.go",
|
||||
|
@ -10,19 +10,19 @@ go_library(
|
|||
importpath = "code.hackerspace.pl/hscloud/cluster/prodaccess",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = [
|
||||
"//cluster/certs:go_default_library",
|
||||
"//cluster/prodvider/proto:go_default_library",
|
||||
"//go/pki:go_default_library",
|
||||
"//go/workspace:go_default_library",
|
||||
"@com_github_golang_glog//:go_default_library",
|
||||
"//cluster/certs",
|
||||
"//cluster/prodvider/proto",
|
||||
"//go/pki",
|
||||
"//go/workspace",
|
||||
"@com_github_golang_glog//:glog",
|
||||
"@org_golang_google_grpc//:go_default_library",
|
||||
"@org_golang_google_grpc//credentials:go_default_library",
|
||||
"@org_golang_x_crypto//ssh/terminal:go_default_library",
|
||||
"@org_golang_google_grpc//credentials",
|
||||
"@org_golang_x_crypto//ssh/terminal",
|
||||
],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "prodaccess",
|
||||
embed = [":go_default_library"],
|
||||
embed = [":prodaccess_lib"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
|
|
@ -14,7 +14,7 @@ import (
|
|||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials"
|
||||
|
||||
"code.hackerspace.pl/cluster/certs"
|
||||
"code.hackerspace.pl/hscloud/cluster/certs"
|
||||
pb "code.hackerspace.pl/hscloud/cluster/prodvider/proto"
|
||||
)
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ load("@io_bazel_rules_docker//container:container.bzl", "container_image", "cont
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "prodvider_lib",
|
||||
srcs = [
|
||||
"certs.go",
|
||||
"crdb.go",
|
||||
|
@ -14,39 +14,39 @@ go_library(
|
|||
importpath = "code.hackerspace.pl/hscloud/cluster/prodvider",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = [
|
||||
"//cluster/prodvider/proto:go_default_library",
|
||||
"@com_github_cloudflare_cfssl//config:go_default_library",
|
||||
"@com_github_cloudflare_cfssl//csr:go_default_library",
|
||||
"@com_github_cloudflare_cfssl//helpers:go_default_library",
|
||||
"@com_github_cloudflare_cfssl//signer:go_default_library",
|
||||
"@com_github_cloudflare_cfssl//signer/local:go_default_library",
|
||||
"@com_github_golang_glog//:go_default_library",
|
||||
"@in_gopkg_ldap_v3//:go_default_library",
|
||||
"@io_k8s_api//core/v1:go_default_library",
|
||||
"@io_k8s_api//rbac/v1:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/api/errors:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library",
|
||||
"@io_k8s_client_go//kubernetes:go_default_library",
|
||||
"@io_k8s_client_go//rest:go_default_library",
|
||||
"//cluster/prodvider/proto",
|
||||
"@com_github_cloudflare_cfssl//config",
|
||||
"@com_github_cloudflare_cfssl//csr",
|
||||
"@com_github_cloudflare_cfssl//helpers",
|
||||
"@com_github_cloudflare_cfssl//signer",
|
||||
"@com_github_cloudflare_cfssl//signer/local",
|
||||
"@com_github_go_ldap_ldap_v3//:ldap",
|
||||
"@com_github_golang_glog//:glog",
|
||||
"@io_k8s_api//core/v1:core",
|
||||
"@io_k8s_api//rbac/v1:rbac",
|
||||
"@io_k8s_apimachinery//pkg/api/errors",
|
||||
"@io_k8s_apimachinery//pkg/apis/meta/v1:meta",
|
||||
"@io_k8s_client_go//kubernetes",
|
||||
"@io_k8s_client_go//rest",
|
||||
"@org_golang_google_grpc//:go_default_library",
|
||||
"@org_golang_google_grpc//codes:go_default_library",
|
||||
"@org_golang_google_grpc//credentials:go_default_library",
|
||||
"@org_golang_google_grpc//status:go_default_library",
|
||||
"@org_golang_google_grpc//codes",
|
||||
"@org_golang_google_grpc//credentials",
|
||||
"@org_golang_google_grpc//status",
|
||||
],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "prodvider",
|
||||
embed = [":go_default_library"],
|
||||
embed = [":prodvider_lib"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
container_layer(
|
||||
name = "layer_bin",
|
||||
directory = "/cluster/prodvider/",
|
||||
files = [
|
||||
":prodvider",
|
||||
],
|
||||
directory = "/cluster/prodvider/",
|
||||
)
|
||||
|
||||
container_image(
|
||||
|
@ -59,8 +59,8 @@ container_image(
|
|||
|
||||
container_push(
|
||||
name = "push",
|
||||
image = ":runtime",
|
||||
format = "Docker",
|
||||
image = ":runtime",
|
||||
registry = "registry.k0.hswaw.net",
|
||||
repository = "q3k/prodvider",
|
||||
tag = "1680303245",
|
||||
|
|
|
@ -62,7 +62,7 @@ func (p *prodvider) crdbCreds(ctx context.Context, username, cluster string) (*p
|
|||
signerCert, _ := s.Certificate("", "")
|
||||
req := &csr.CertificateRequest{
|
||||
CN: username,
|
||||
KeyRequest: &csr.BasicKeyRequest{
|
||||
KeyRequest: &csr.KeyRequest{
|
||||
A: "rsa",
|
||||
S: 4096,
|
||||
},
|
||||
|
|
|
@ -60,7 +60,7 @@ func (p *prodvider) hspkiCreds(ctx context.Context, username string) (*pb.HSPKIK
|
|||
signerCert, _ := s.Certificate("", "")
|
||||
req := &csr.CertificateRequest{
|
||||
CN: principal,
|
||||
KeyRequest: &csr.BasicKeyRequest{
|
||||
KeyRequest: &csr.KeyRequest{
|
||||
A: "rsa",
|
||||
S: 4096,
|
||||
},
|
||||
|
|
|
@ -17,7 +17,7 @@ go_proto_library(
|
|||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "proto",
|
||||
embed = [":proto_go_proto"],
|
||||
importpath = "code.hackerspace.pl/hscloud/cluster/prodvider/proto",
|
||||
visibility = ["//visibility:public"],
|
||||
|
|
|
@ -7,10 +7,10 @@ import (
|
|||
"regexp"
|
||||
"strings"
|
||||
|
||||
ldap "github.com/go-ldap/ldap/v3"
|
||||
"github.com/golang/glog"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
ldap "gopkg.in/ldap.v3"
|
||||
|
||||
pb "code.hackerspace.pl/hscloud/cluster/prodvider/proto"
|
||||
)
|
||||
|
|
|
@ -3,7 +3,7 @@ load("//bzl:rules.bzl", "copy_go_binary")
|
|||
|
||||
copy_go_binary(
|
||||
name = "kubectl",
|
||||
src = "@io_k8s_kubernetes//cmd/kubectl:kubectl",
|
||||
src = "@io_k8s_kubernetes//cmd/kubectl",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
|
@ -30,7 +30,7 @@ sh_binary(
|
|||
|
||||
copy_go_binary(
|
||||
name = "cfssl",
|
||||
src = "@com_github_cloudflare_cfssl//cmd/cfssl:cfssl",
|
||||
src = "@com_github_cloudflare_cfssl//cmd/cfssl",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
|
@ -38,8 +38,7 @@ sh_binary(
|
|||
name = "rook-s3cmd-config",
|
||||
srcs = ["rook-s3cmd-config.sh"],
|
||||
data = [
|
||||
"@bazel_tools//tools/bash/runfiles",
|
||||
"@com_github_itchyny_gojq//cmd/gojq",
|
||||
":kubectl",
|
||||
"@bazel_tools//tools/bash/runfiles",
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "kartongips_lib",
|
||||
srcs = ["main.go"],
|
||||
importpath = "code.hackerspace.pl/hscloud/cluster/tools/kartongips",
|
||||
visibility = ["//visibility:private"],
|
||||
|
@ -9,14 +9,14 @@ go_library(
|
|||
"code.hackerspace.pl/hscloud/cluster/tools/kartongips.Version": "{STABLE_GIT_VERSION}",
|
||||
},
|
||||
deps = [
|
||||
"//cluster/tools/kartongips/cmd:go_default_library",
|
||||
"//cluster/tools/kartongips/pkg/kubecfg:go_default_library",
|
||||
"@com_github_sirupsen_logrus//:go_default_library",
|
||||
"//cluster/tools/kartongips/cmd",
|
||||
"//cluster/tools/kartongips/pkg/kubecfg",
|
||||
"@com_github_sirupsen_logrus//:logrus",
|
||||
],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "kartongips",
|
||||
embed = [":go_default_library"],
|
||||
embed = [":kartongips_lib"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "cmd",
|
||||
srcs = [
|
||||
"completion.go",
|
||||
"delete.go",
|
||||
|
@ -15,37 +15,36 @@ go_library(
|
|||
importpath = "code.hackerspace.pl/hscloud/cluster/tools/kartongips/cmd",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//cluster/tools/kartongips/pkg/kubecfg:go_default_library",
|
||||
"//cluster/tools/kartongips/utils:go_default_library",
|
||||
"@com_github_genuinetools_reg//registry:go_default_library",
|
||||
"@com_github_google_go_jsonnet//:go_default_library",
|
||||
"@com_github_mattn_go_isatty//:go_default_library",
|
||||
"@com_github_sirupsen_logrus//:go_default_library",
|
||||
"@com_github_spf13_cobra//:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/api/meta:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/apis/meta/v1/unstructured:go_default_library",
|
||||
"@io_k8s_client_go//discovery:go_default_library",
|
||||
"@io_k8s_client_go//dynamic:go_default_library",
|
||||
"@io_k8s_client_go//pkg/version:go_default_library",
|
||||
"@io_k8s_client_go//plugin/pkg/client/auth:go_default_library",
|
||||
"@io_k8s_client_go//restmapper:go_default_library",
|
||||
"@io_k8s_client_go//tools/clientcmd:go_default_library",
|
||||
"@io_k8s_klog//:go_default_library",
|
||||
"@org_golang_x_crypto//ssh/terminal:go_default_library",
|
||||
"//cluster/tools/kartongips/pkg/kubecfg",
|
||||
"//cluster/tools/kartongips/utils",
|
||||
"@com_github_genuinetools_reg//registry",
|
||||
"@com_github_google_go_jsonnet//:go-jsonnet",
|
||||
"@com_github_mattn_go_isatty//:go-isatty",
|
||||
"@com_github_sirupsen_logrus//:logrus",
|
||||
"@com_github_spf13_cobra//:cobra",
|
||||
"@io_k8s_apimachinery//pkg/api/meta",
|
||||
"@io_k8s_apimachinery//pkg/apis/meta/v1/unstructured",
|
||||
"@io_k8s_client_go//discovery",
|
||||
"@io_k8s_client_go//dynamic",
|
||||
"@io_k8s_client_go//plugin/pkg/client/auth",
|
||||
"@io_k8s_client_go//restmapper",
|
||||
"@io_k8s_client_go//tools/clientcmd",
|
||||
"@io_k8s_klog//:klog",
|
||||
"@org_golang_x_crypto//ssh/terminal",
|
||||
],
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
name = "cmd_test",
|
||||
srcs = [
|
||||
"completion_test.go",
|
||||
"show_test.go",
|
||||
"version_test.go",
|
||||
],
|
||||
embed = [":go_default_library"],
|
||||
embed = [":cmd"],
|
||||
deps = [
|
||||
"@com_github_spf13_cobra//:go_default_library",
|
||||
"@com_github_spf13_pflag//:go_default_library",
|
||||
"@in_gopkg_yaml_v2//:go_default_library",
|
||||
"@com_github_spf13_cobra//:cobra",
|
||||
"@com_github_spf13_pflag//:pflag",
|
||||
"@in_gopkg_yaml_v2//:yaml_v2",
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "kubecfg",
|
||||
srcs = [
|
||||
"delete.go",
|
||||
"diff.go",
|
||||
|
@ -12,52 +12,52 @@ go_library(
|
|||
importpath = "code.hackerspace.pl/hscloud/cluster/tools/kartongips/pkg/kubecfg",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//cluster/tools/kartongips/utils:go_default_library",
|
||||
"@com_github_evanphx_json_patch//:go_default_library",
|
||||
"@com_github_mattn_go_isatty//:go_default_library",
|
||||
"@com_github_sergi_go_diff//diffmatchpatch:go_default_library",
|
||||
"@com_github_sirupsen_logrus//:go_default_library",
|
||||
"@in_gopkg_yaml_v2//:go_default_library",
|
||||
"@io_k8s_apiextensions_apiserver//pkg/apis/apiextensions/v1beta1:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/api/equality:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/api/errors:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/api/meta:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/apis/meta/v1/unstructured:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/runtime:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/runtime/schema:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/util/diff:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/util/jsonmergepatch:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/util/sets:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/util/strategicpatch:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/util/wait:go_default_library",
|
||||
"@io_k8s_client_go//discovery:go_default_library",
|
||||
"@io_k8s_client_go//dynamic:go_default_library",
|
||||
"@io_k8s_client_go//util/retry:go_default_library",
|
||||
"@io_k8s_kube_openapi//pkg/util/proto:go_default_library",
|
||||
"@io_k8s_kubectl//pkg/util/openapi:go_default_library",
|
||||
"//cluster/tools/kartongips/utils",
|
||||
"@com_github_evanphx_json_patch//:json-patch",
|
||||
"@com_github_mattn_go_isatty//:go-isatty",
|
||||
"@com_github_sergi_go_diff//diffmatchpatch",
|
||||
"@com_github_sirupsen_logrus//:logrus",
|
||||
"@in_gopkg_yaml_v2//:yaml_v2",
|
||||
"@io_k8s_apiextensions_apiserver//pkg/apis/apiextensions/v1beta1",
|
||||
"@io_k8s_apimachinery//pkg/api/equality",
|
||||
"@io_k8s_apimachinery//pkg/api/errors",
|
||||
"@io_k8s_apimachinery//pkg/api/meta",
|
||||
"@io_k8s_apimachinery//pkg/apis/meta/v1:meta",
|
||||
"@io_k8s_apimachinery//pkg/apis/meta/v1/unstructured",
|
||||
"@io_k8s_apimachinery//pkg/runtime",
|
||||
"@io_k8s_apimachinery//pkg/runtime/schema",
|
||||
"@io_k8s_apimachinery//pkg/util/diff",
|
||||
"@io_k8s_apimachinery//pkg/util/jsonmergepatch",
|
||||
"@io_k8s_apimachinery//pkg/util/sets",
|
||||
"@io_k8s_apimachinery//pkg/util/strategicpatch",
|
||||
"@io_k8s_apimachinery//pkg/util/wait",
|
||||
"@io_k8s_client_go//discovery",
|
||||
"@io_k8s_client_go//dynamic",
|
||||
"@io_k8s_client_go//util/retry",
|
||||
"@io_k8s_kube_openapi//pkg/util/proto",
|
||||
"@io_k8s_kubectl//pkg/util/openapi",
|
||||
],
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
name = "kubecfg_test",
|
||||
srcs = [
|
||||
"diff_test.go",
|
||||
"update_test.go",
|
||||
],
|
||||
embed = [":go_default_library"],
|
||||
embed = [":kubecfg"],
|
||||
deps = [
|
||||
"//cluster/tools/kartongips/utils:go_default_library",
|
||||
"//cluster/tools/kartongips/utils",
|
||||
"@com_github_golang_protobuf//proto:go_default_library",
|
||||
"@com_github_googleapis_gnostic//openapiv2:go_default_library",
|
||||
"@com_github_stretchr_testify//require:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/api/equality:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/apis/meta/v1/unstructured:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/runtime/schema:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/util/diff:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/util/strategicpatch:go_default_library",
|
||||
"@io_k8s_kube_openapi//pkg/util/proto:go_default_library",
|
||||
"@io_k8s_kubectl//pkg/util/openapi:go_default_library",
|
||||
"@com_github_google_gnostic//openapiv2",
|
||||
"@com_github_stretchr_testify//require",
|
||||
"@io_k8s_apimachinery//pkg/api/equality",
|
||||
"@io_k8s_apimachinery//pkg/apis/meta/v1:meta",
|
||||
"@io_k8s_apimachinery//pkg/apis/meta/v1/unstructured",
|
||||
"@io_k8s_apimachinery//pkg/runtime/schema",
|
||||
"@io_k8s_apimachinery//pkg/util/diff",
|
||||
"@io_k8s_apimachinery//pkg/util/strategicpatch",
|
||||
"@io_k8s_kube_openapi//pkg/util/proto",
|
||||
"@io_k8s_kubectl//pkg/util/openapi",
|
||||
],
|
||||
)
|
||||
|
|
|
@ -442,7 +442,7 @@ func gcDelete(ctx context.Context, client dynamic.Interface, mapper meta.RESTMap
|
|||
}
|
||||
|
||||
func walkObjects(ctx context.Context, client dynamic.Interface, disco discovery.DiscoveryInterface, listopts metav1.ListOptions, callback func(runtime.Object) error) error {
|
||||
rsrclists, err := disco.ServerResources()
|
||||
rsrclists, err := disco.ServerPreferredResources()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"testing"
|
||||
|
||||
pb_proto "github.com/golang/protobuf/proto"
|
||||
openapi_v2 "github.com/googleapis/gnostic/openapiv2"
|
||||
openapi_v2 "github.com/google/gnostic/openapiv2"
|
||||
apiequality "k8s.io/apimachinery/pkg/api/equality"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "utils",
|
||||
srcs = [
|
||||
"acquire.go",
|
||||
"bindata.go",
|
||||
|
@ -16,34 +16,36 @@ go_library(
|
|||
importpath = "code.hackerspace.pl/hscloud/cluster/tools/kartongips/utils",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"@com_github_elazarl_go_bindata_assetfs//:go_default_library",
|
||||
"@com_github_genuinetools_reg//registry:go_default_library",
|
||||
"@com_github_genuinetools_reg//repoutils:go_default_library",
|
||||
"@com_github_ghodss_yaml//:go_default_library",
|
||||
"@com_github_google_go_jsonnet//:go_default_library",
|
||||
"@com_github_google_go_jsonnet//ast:go_default_library",
|
||||
"@com_github_googleapis_gnostic//openapiv2:go_default_library",
|
||||
"@com_github_sirupsen_logrus//:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/api/errors:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/api/meta:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/apis/meta/v1/unstructured:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/runtime:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/runtime/schema:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/util/runtime:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/util/yaml:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/version:go_default_library",
|
||||
"@io_k8s_client_go//discovery:go_default_library",
|
||||
"@io_k8s_client_go//dynamic:go_default_library",
|
||||
"@io_k8s_client_go//rest:go_default_library",
|
||||
"@io_k8s_kube_openapi//pkg/util/proto:go_default_library",
|
||||
"@io_k8s_kube_openapi//pkg/util/proto/validation:go_default_library",
|
||||
"@io_k8s_kubectl//pkg/util/openapi:go_default_library",
|
||||
"@com_github_elazarl_go_bindata_assetfs//:go-bindata-assetfs",
|
||||
"@com_github_genuinetools_reg//registry",
|
||||
"@com_github_genuinetools_reg//repoutils",
|
||||
"@com_github_ghodss_yaml//:yaml",
|
||||
"@com_github_google_gnostic//openapiv2",
|
||||
"@com_github_google_go_jsonnet//:go-jsonnet",
|
||||
"@com_github_google_go_jsonnet//ast",
|
||||
"@com_github_sirupsen_logrus//:logrus",
|
||||
"@io_k8s_apimachinery//pkg/api/errors",
|
||||
"@io_k8s_apimachinery//pkg/api/meta",
|
||||
"@io_k8s_apimachinery//pkg/apis/meta/v1:meta",
|
||||
"@io_k8s_apimachinery//pkg/apis/meta/v1/unstructured",
|
||||
"@io_k8s_apimachinery//pkg/runtime",
|
||||
"@io_k8s_apimachinery//pkg/runtime/schema",
|
||||
"@io_k8s_apimachinery//pkg/util/runtime",
|
||||
"@io_k8s_apimachinery//pkg/util/yaml",
|
||||
"@io_k8s_apimachinery//pkg/version",
|
||||
"@io_k8s_client_go//discovery",
|
||||
"@io_k8s_client_go//dynamic",
|
||||
"@io_k8s_client_go//openapi",
|
||||
"@io_k8s_client_go//openapi/cached",
|
||||
"@io_k8s_client_go//rest",
|
||||
"@io_k8s_kube_openapi//pkg/util/proto",
|
||||
"@io_k8s_kube_openapi//pkg/util/proto/validation",
|
||||
"@io_k8s_kubectl//pkg/util/openapi",
|
||||
],
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
name = "utils_test",
|
||||
srcs = [
|
||||
"acquire_test.go",
|
||||
"importer_test.go",
|
||||
|
@ -52,23 +54,23 @@ go_test(
|
|||
"openapi_test.go",
|
||||
"sort_test.go",
|
||||
],
|
||||
embed = [":go_default_library"],
|
||||
embed = [":utils"],
|
||||
deps = [
|
||||
"@com_github_golang_protobuf//proto:go_default_library",
|
||||
"@com_github_google_go_jsonnet//:go_default_library",
|
||||
"@com_github_googleapis_gnostic//openapiv2:go_default_library",
|
||||
"@com_github_sirupsen_logrus//:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/api/equality:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/api/meta:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/apis/meta/v1/unstructured:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/runtime/schema:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/util/diff:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/util/errors:go_default_library",
|
||||
"@io_k8s_apimachinery//pkg/version:go_default_library",
|
||||
"@io_k8s_client_go//discovery:go_default_library",
|
||||
"@io_k8s_client_go//discovery/fake:go_default_library",
|
||||
"@io_k8s_client_go//restmapper:go_default_library",
|
||||
"@io_k8s_client_go//testing:go_default_library",
|
||||
"@com_github_google_gnostic//openapiv2",
|
||||
"@com_github_google_go_jsonnet//:go-jsonnet",
|
||||
"@com_github_sirupsen_logrus//:logrus",
|
||||
"@io_k8s_apimachinery//pkg/api/equality",
|
||||
"@io_k8s_apimachinery//pkg/api/meta",
|
||||
"@io_k8s_apimachinery//pkg/apis/meta/v1:meta",
|
||||
"@io_k8s_apimachinery//pkg/apis/meta/v1/unstructured",
|
||||
"@io_k8s_apimachinery//pkg/runtime/schema",
|
||||
"@io_k8s_apimachinery//pkg/util/diff",
|
||||
"@io_k8s_apimachinery//pkg/util/errors",
|
||||
"@io_k8s_apimachinery//pkg/version",
|
||||
"@io_k8s_client_go//discovery",
|
||||
"@io_k8s_client_go//discovery/fake",
|
||||
"@io_k8s_client_go//restmapper",
|
||||
"@io_k8s_client_go//testing",
|
||||
],
|
||||
)
|
||||
|
|
|
@ -27,7 +27,7 @@ import (
|
|||
"sync"
|
||||
"syscall"
|
||||
|
||||
openapi_v2 "github.com/googleapis/gnostic/openapiv2"
|
||||
openapi_v2 "github.com/google/gnostic/openapiv2"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
errorsutil "k8s.io/apimachinery/pkg/api/errors"
|
||||
|
@ -38,6 +38,8 @@ import (
|
|||
"k8s.io/apimachinery/pkg/version"
|
||||
"k8s.io/client-go/discovery"
|
||||
"k8s.io/client-go/dynamic"
|
||||
openapi_v3 "k8s.io/client-go/openapi"
|
||||
cachedopenapi_v3 "k8s.io/client-go/openapi/cached"
|
||||
restclient "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
|
@ -57,7 +59,9 @@ type memcachedDiscoveryClient struct {
|
|||
lock sync.RWMutex
|
||||
groupToServerResources map[string]*cacheEntry
|
||||
groupList *metav1.APIGroupList
|
||||
openAPISchema *openapi_v2.Document
|
||||
cacheValid bool
|
||||
openapiV3Client openapi_v3.Client
|
||||
}
|
||||
|
||||
// Error Constants
|
||||
|
@ -124,12 +128,6 @@ func (d *memcachedDiscoveryClient) ServerResourcesForGroupVersion(groupVersion s
|
|||
return cachedVal.resourceList, cachedVal.err
|
||||
}
|
||||
|
||||
// ServerResources returns the supported resources for all groups and versions.
|
||||
// Deprecated: use ServerGroupsAndResources instead.
|
||||
func (d *memcachedDiscoveryClient) ServerResources() ([]*metav1.APIResourceList, error) {
|
||||
return discovery.ServerResources(d)
|
||||
}
|
||||
|
||||
// ServerGroupsAndResources returns the groups and supported resources for all groups and versions.
|
||||
func (d *memcachedDiscoveryClient) ServerGroupsAndResources() ([]*metav1.APIGroup, []*metav1.APIResourceList, error) {
|
||||
return discovery.ServerGroupsAndResources(d)
|
||||
|
@ -163,7 +161,18 @@ func (d *memcachedDiscoveryClient) ServerVersion() (*version.Info, error) {
|
|||
}
|
||||
|
||||
func (d *memcachedDiscoveryClient) OpenAPISchema() (*openapi_v2.Document, error) {
|
||||
return d.delegate.OpenAPISchema()
|
||||
d.lock.Lock()
|
||||
defer d.lock.Unlock()
|
||||
|
||||
if d.openAPISchema == nil {
|
||||
schema, err := d.delegate.OpenAPISchema()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
d.openAPISchema = schema
|
||||
}
|
||||
|
||||
return d.openAPISchema, nil
|
||||
}
|
||||
|
||||
func (d *memcachedDiscoveryClient) Fresh() bool {
|
||||
|
@ -183,6 +192,28 @@ func (d *memcachedDiscoveryClient) Invalidate() {
|
|||
d.cacheValid = false
|
||||
d.groupToServerResources = nil
|
||||
d.groupList = nil
|
||||
d.openAPISchema = nil
|
||||
}
|
||||
|
||||
// OpenAPIV3 retrieves and parses the OpenAPIV3 specs exposed by the server
|
||||
func (d *memcachedDiscoveryClient) OpenAPIV3() openapi_v3.Client {
|
||||
d.lock.Lock()
|
||||
defer d.lock.Unlock()
|
||||
|
||||
if d.openapiV3Client == nil {
|
||||
// Delegate is discovery client created with special HTTP client which
|
||||
// respects E-Tag cache responses to serve cache from disk.
|
||||
d.openapiV3Client = cachedopenapi_v3.NewClient(d.delegate.OpenAPIV3())
|
||||
}
|
||||
|
||||
return d.openapiV3Client
|
||||
}
|
||||
|
||||
// taken from: https://github.com/kubernetes/client-go/commit/3ac73ea2c834b1268732024766f1e55a5d0327d2#diff-46edd694bf30a54d9f6e202e010134bedfce438de77f57830155b0762eda7bf6R280-R285
|
||||
// WithLegacy returns current cached discovery client;
|
||||
// current client does not support legacy-only discovery.
|
||||
func (d *memcachedDiscoveryClient) WithLegacy() discovery.DiscoveryInterface {
|
||||
return d
|
||||
}
|
||||
|
||||
// refreshLocked refreshes the state of cache. The caller must hold d.lock for
|
||||
|
|
|
@ -22,7 +22,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
openapi_v2 "github.com/googleapis/gnostic/openapiv2"
|
||||
openapi_v2 "github.com/google/gnostic/openapiv2"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
utilerrors "k8s.io/apimachinery/pkg/util/errors"
|
||||
|
|
|
@ -21,7 +21,7 @@ import (
|
|||
"sort"
|
||||
"testing"
|
||||
|
||||
openapi_v2 "github.com/googleapis/gnostic/openapiv2"
|
||||
openapi_v2 "github.com/google/gnostic/openapiv2"
|
||||
log "github.com/sirupsen/logrus"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
//go:build tools
|
||||
|
||||
// +tools
|
||||
package tools
|
||||
|
||||
import (
|
||||
_ "k8s.io/kubernetes/cmd/kubectl"
|
||||
)
|
|
@ -1,7 +1,7 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "arista-proxy_lib",
|
||||
srcs = [
|
||||
"main.go",
|
||||
"service.go",
|
||||
|
@ -9,17 +9,17 @@ go_library(
|
|||
importpath = "code.hackerspace.pl/hscloud/dc/arista-proxy",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = [
|
||||
"//dc/arista-proxy/proto:go_default_library",
|
||||
"//go/mirko:go_default_library",
|
||||
"@com_github_golang_glog//:go_default_library",
|
||||
"@com_github_q3k_cursedjsonrpc//:go_default_library",
|
||||
"@org_golang_google_grpc//codes:go_default_library",
|
||||
"@org_golang_google_grpc//status:go_default_library",
|
||||
"//dc/arista-proxy/proto",
|
||||
"//go/mirko",
|
||||
"@com_github_golang_glog//:glog",
|
||||
"@com_github_q3k_cursedjsonrpc//:cursedjsonrpc",
|
||||
"@org_golang_google_grpc//codes",
|
||||
"@org_golang_google_grpc//status",
|
||||
],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "arista-proxy",
|
||||
embed = [":go_default_library"],
|
||||
embed = [":arista-proxy_lib"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
|
||||
"code.hackerspace.pl/hscloud/go/mirko"
|
||||
"github.com/golang/glog"
|
||||
"github.com/q3k/cursedjsonrpc"
|
||||
cursedjsonrpc "github.com/q3k/cursedjsonrpc"
|
||||
|
||||
pb "code.hackerspace.pl/hscloud/dc/arista-proxy/proto"
|
||||
)
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
load("@rules_proto//proto:defs.bzl", "proto_library")
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
|
||||
|
||||
|
@ -16,7 +17,7 @@ go_proto_library(
|
|||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "proto",
|
||||
embed = [":proto_go_proto"],
|
||||
importpath = "code.hackerspace.pl/hscloud/dc/arista-proxy/proto",
|
||||
visibility = ["//visibility:public"],
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "cmc-proxy_lib",
|
||||
srcs = [
|
||||
"client.go",
|
||||
"main.go",
|
||||
|
@ -9,17 +9,17 @@ go_library(
|
|||
importpath = "code.hackerspace.pl/hscloud/dc/cmc-proxy",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = [
|
||||
"//dc/cmc-proxy/proto:go_default_library",
|
||||
"//go/mirko:go_default_library",
|
||||
"@com_github_cenkalti_backoff//:go_default_library",
|
||||
"@com_github_golang_glog//:go_default_library",
|
||||
"@org_golang_google_grpc//codes:go_default_library",
|
||||
"@org_golang_google_grpc//status:go_default_library",
|
||||
"//dc/cmc-proxy/proto",
|
||||
"//go/mirko",
|
||||
"@com_github_cenkalti_backoff//:backoff",
|
||||
"@com_github_golang_glog//:glog",
|
||||
"@org_golang_google_grpc//codes",
|
||||
"@org_golang_google_grpc//status",
|
||||
],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "cmc-proxy",
|
||||
embed = [":go_default_library"],
|
||||
embed = [":cmc-proxy_lib"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
load("@rules_proto//proto:defs.bzl", "proto_library")
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
|
||||
|
||||
|
@ -16,7 +17,7 @@ go_proto_library(
|
|||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "proto",
|
||||
embed = [":proto_go_proto"],
|
||||
importpath = "code.hackerspace.pl/hscloud/dc/cmc-proxy/proto",
|
||||
visibility = ["//visibility:public"],
|
||||
|
|
|
@ -1,27 +1,24 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"cli.go",
|
||||
"main.go",
|
||||
],
|
||||
name = "m6220-proxy_lib",
|
||||
srcs = ["main.go"],
|
||||
importpath = "code.hackerspace.pl/hscloud/dc/m6220-proxy",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = [
|
||||
"//dc/m6220-proxy/proto:go_default_library",
|
||||
"//dc/proto:go_default_library",
|
||||
"//go/mirko:go_default_library",
|
||||
"@com_github_golang_glog//:go_default_library",
|
||||
"@com_github_ziutek_telnet//:go_default_library",
|
||||
"@org_golang_google_grpc//codes:go_default_library",
|
||||
"@org_golang_google_grpc//status:go_default_library",
|
||||
"@org_golang_x_net//trace:go_default_library",
|
||||
"//dc/m6220-proxy/cli",
|
||||
"//dc/m6220-proxy/proto",
|
||||
"//dc/proto",
|
||||
"//go/mirko",
|
||||
"@com_github_golang_glog//:glog",
|
||||
"@com_github_ziutek_telnet//:telnet",
|
||||
"@org_golang_google_grpc//codes",
|
||||
"@org_golang_google_grpc//status",
|
||||
],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "m6220-proxy",
|
||||
embed = [":go_default_library"],
|
||||
embed = [":m6220-proxy_lib"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
|
|
@ -6,8 +6,7 @@ go_library(
|
|||
importpath = "code.hackerspace.pl/hscloud/dc/m6220-proxy/cli",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"@com_github_golang_glog//:go_default_library",
|
||||
"@com_github_ziutek_telnet//:go_default_library",
|
||||
"@org_golang_x_net//trace:go_default_library",
|
||||
"@com_github_ziutek_telnet//:telnet",
|
||||
"@org_golang_x_net//trace",
|
||||
],
|
||||
)
|
||||
|
|
|
@ -8,14 +8,15 @@ import (
|
|||
"strconv"
|
||||
"strings"
|
||||
|
||||
"code.hackerspace.pl/hscloud/go/mirko"
|
||||
"github.com/golang/glog"
|
||||
"github.com/ziutek/telnet"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
|
||||
"code.hackerspace.pl/hscloud/dc/m6220-proxy/cli"
|
||||
pb "code.hackerspace.pl/hscloud/dc/m6220-proxy/proto"
|
||||
dpb "code.hackerspace.pl/hscloud/dc/proto"
|
||||
"code.hackerspace.pl/hscloud/go/mirko"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -32,7 +33,7 @@ type service struct {
|
|||
connectionSemaphore chan int
|
||||
}
|
||||
|
||||
func (s *service) connect() (*cliClient, error) {
|
||||
func (s *service) connect() (*cli.Client, error) {
|
||||
s.connectionSemaphore <- 1
|
||||
conn, err := telnet.Dial("tcp", flagSwitchAddress)
|
||||
if err != nil {
|
||||
|
@ -40,7 +41,7 @@ func (s *service) connect() (*cliClient, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
cli := newCliClient(conn, flagSwitchUsername, flagSwitchPassword)
|
||||
cli := cli.NewClient(conn, flagSwitchUsername, flagSwitchPassword)
|
||||
return cli, nil
|
||||
}
|
||||
|
||||
|
@ -59,7 +60,7 @@ func (s *service) RunCommand(ctx context.Context, req *pb.RunCommandRequest) (*p
|
|||
}
|
||||
defer s.disconnect()
|
||||
|
||||
lines, effective, err := cli.runCommand(ctx, req.Command)
|
||||
lines, effective, err := cli.RunCommand(ctx, req.Command)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -227,7 +228,7 @@ func (s *service) GetPorts(ctx context.Context, req *dpb.GetPortsRequest) (*dpb.
|
|||
defer s.disconnect()
|
||||
res := &dpb.GetPortsResponse{}
|
||||
|
||||
statusLines, _, err := cli.runCommand(ctx, "show interface status")
|
||||
statusLines, _, err := cli.RunCommand(ctx, "show interface status")
|
||||
if err != nil {
|
||||
return nil, status.Error(codes.Unavailable, "could not get interface status from switch")
|
||||
}
|
||||
|
@ -238,7 +239,7 @@ func (s *service) GetPorts(ctx context.Context, req *dpb.GetPortsRequest) (*dpb.
|
|||
}
|
||||
|
||||
for _, port := range res.Ports {
|
||||
configLines, _, err := cli.runCommand(ctx, "show run interface "+port.Name)
|
||||
configLines, _, err := cli.RunCommand(ctx, "show run interface "+port.Name)
|
||||
if err != nil {
|
||||
return nil, status.Error(codes.Unavailable, "could not get interface config from switch")
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
load("@rules_proto//proto:defs.bzl", "proto_library")
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
|
||||
|
||||
|
@ -16,7 +17,7 @@ go_proto_library(
|
|||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "proto",
|
||||
embed = [":proto_go_proto"],
|
||||
importpath = "code.hackerspace.pl/hscloud/dc/m6220-proxy/proto",
|
||||
visibility = ["//visibility:public"],
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
load("@rules_proto//proto:defs.bzl", "proto_library")
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
|
||||
|
||||
|
@ -16,7 +17,7 @@ go_proto_library(
|
|||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "proto",
|
||||
embed = [":proto_go_proto"],
|
||||
importpath = "code.hackerspace.pl/hscloud/dc/proto",
|
||||
visibility = ["//visibility:public"],
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "topo_lib",
|
||||
srcs = [
|
||||
"main.go",
|
||||
"service.go",
|
||||
|
@ -9,23 +9,23 @@ go_library(
|
|||
importpath = "code.hackerspace.pl/hscloud/dc/topo",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = [
|
||||
"//dc/proto:go_default_library",
|
||||
"//dc/topo/assets:go_default_library",
|
||||
"//dc/topo/graph:go_default_library",
|
||||
"//dc/topo/proto:go_default_library",
|
||||
"//dc/topo/state:go_default_library",
|
||||
"//go/mirko:go_default_library",
|
||||
"//go/statusz:go_default_library",
|
||||
"@com_github_digitalocean_go_netbox//netbox:go_default_library",
|
||||
"@com_github_digitalocean_go_netbox//netbox/client:go_default_library",
|
||||
"@com_github_golang_glog//:go_default_library",
|
||||
"//dc/proto",
|
||||
"//dc/topo/assets",
|
||||
"//dc/topo/graph",
|
||||
"//dc/topo/proto",
|
||||
"//dc/topo/state",
|
||||
"//go/mirko",
|
||||
"//go/statusz",
|
||||
"@com_github_digitalocean_go_netbox//netbox",
|
||||
"@com_github_digitalocean_go_netbox//netbox/client",
|
||||
"@com_github_fvbommel_sortorder//:sortorder",
|
||||
"@com_github_golang_glog//:glog",
|
||||
"@com_github_golang_protobuf//proto:go_default_library",
|
||||
"@ml_vbom_util//sortorder:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "topo",
|
||||
embed = [":go_default_library"],
|
||||
embed = [":topo_lib"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
|
|
@ -2,16 +2,16 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
|||
load("@io_bazel_rules_go//extras:embed_data.bzl", "go_embed_data")
|
||||
|
||||
go_embed_data(
|
||||
name = "assets",
|
||||
name = "assets_embed",
|
||||
srcs = glob(["*.js"]),
|
||||
package = "assets",
|
||||
flatten = True,
|
||||
package = "assets",
|
||||
)
|
||||
|
||||
# keep
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [":assets"],
|
||||
name = "assets",
|
||||
srcs = [":assets_embed"],
|
||||
importpath = "code.hackerspace.pl/hscloud/dc/topo/assets",
|
||||
visibility = ["//dc/topo:__pkg__"],
|
||||
)
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "graph",
|
||||
srcs = ["graph.go"],
|
||||
importpath = "code.hackerspace.pl/hscloud/dc/topo/graph",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//dc/topo/proto:go_default_library",
|
||||
"@com_github_digitalocean_go_netbox//netbox/client:go_default_library",
|
||||
"@com_github_digitalocean_go_netbox//netbox/client/dcim:go_default_library",
|
||||
"@com_github_digitalocean_go_netbox//netbox/models:go_default_library",
|
||||
"@com_github_golang_glog//:go_default_library",
|
||||
"//dc/topo/proto",
|
||||
"@com_github_digitalocean_go_netbox//netbox/client",
|
||||
"@com_github_digitalocean_go_netbox//netbox/client/dcim",
|
||||
"@com_github_digitalocean_go_netbox//netbox/models",
|
||||
"@com_github_golang_glog//:glog",
|
||||
],
|
||||
)
|
||||
|
|
|
@ -142,7 +142,7 @@ func (g *Graph) LoadConfig(conf *pb.Config) error {
|
|||
|
||||
}
|
||||
|
||||
func (g *Graph) FeedFromNetbox(ctx context.Context, nb *client.NetBox) error {
|
||||
func (g *Graph) FeedFromNetbox(ctx context.Context, nb *client.NetBoxAPI) error {
|
||||
// Clear all connections first, because it's easier that way.
|
||||
for _, machine := range g.Machines {
|
||||
for _, port := range machine.Ports {
|
||||
|
@ -169,18 +169,18 @@ func (g *Graph) FeedFromNetbox(ctx context.Context, nb *client.NetBox) error {
|
|||
return fmt.Errorf("while querying information about %q: %v", machine.Name, err)
|
||||
}
|
||||
for _, connection := range res.Payload.Results {
|
||||
ia := connection.InterfaceA
|
||||
ib := connection.InterfaceB
|
||||
ia := connection.Interfacea
|
||||
ib := connection.Interfaceb
|
||||
if ia == nil || ib == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
// Find which way this thing actually connects.
|
||||
var thisSide, otherSide *models.PeerInterface
|
||||
if ia.Device.Name == machine.Name {
|
||||
var thisSide, otherSide *models.NestedInterface
|
||||
if ia.Device.Name != nil && *ia.Device.Name == machine.Name {
|
||||
thisSide = ia
|
||||
otherSide = ib
|
||||
} else if ib.Device.Name == machine.Name {
|
||||
} else if ib.Device.Name != nil && *ib.Device.Name == machine.Name {
|
||||
thisSide = ib
|
||||
otherSide = ia
|
||||
} else {
|
||||
|
@ -192,9 +192,9 @@ func (g *Graph) FeedFromNetbox(ctx context.Context, nb *client.NetBox) error {
|
|||
if !ok {
|
||||
continue
|
||||
}
|
||||
sw, ok := g.Switches[otherSide.Device.Name]
|
||||
sw, ok := g.Switches[*otherSide.Device.Name]
|
||||
if !ok {
|
||||
glog.Warningf("Machine %q port %q is managed but connected to unknown device %q", machine.Name, thisPort.Name, otherSide.Device.Name)
|
||||
glog.Warningf("Machine %q port %q is managed but connected to unknown device %q", machine.Name, thisPort.Name, *otherSide.Device.Name)
|
||||
continue
|
||||
}
|
||||
otherPort, ok := sw.Ports[*otherSide.Name]
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
load("@rules_proto//proto:defs.bzl", "proto_library")
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
|
||||
|
||||
|
@ -15,7 +16,7 @@ go_proto_library(
|
|||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "proto",
|
||||
embed = [":proto_go_proto"],
|
||||
importpath = "code.hackerspace.pl/hscloud/dc/topo/proto",
|
||||
visibility = ["//visibility:public"],
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"sort"
|
||||
"strings"
|
||||
|
||||
"vbom.ml/util/sortorder"
|
||||
"github.com/fvbommel/sortorder"
|
||||
|
||||
"code.hackerspace.pl/hscloud/go/mirko"
|
||||
"code.hackerspace.pl/hscloud/go/statusz"
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "state",
|
||||
srcs = ["state.go"],
|
||||
importpath = "code.hackerspace.pl/hscloud/dc/topo/state",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//dc/proto:go_default_library",
|
||||
"//dc/topo/proto:go_default_library",
|
||||
"//go/pki:go_default_library",
|
||||
"//dc/proto",
|
||||
"//dc/topo/proto",
|
||||
"//go/pki",
|
||||
"@org_golang_google_grpc//:go_default_library",
|
||||
],
|
||||
)
|
||||
|
|
|
@ -7,11 +7,11 @@ let
|
|||
|
||||
readTree = import ./nix/readtree {};
|
||||
|
||||
# Tracking nixos-unstable as of 2021-08-11.
|
||||
nixpkgsCommit = "42aae6fa748a41ced37373fc6d914de512658178";
|
||||
# Tracking nixos-unstable as of 2023-07-24.
|
||||
nixpkgsCommit = "e6b1f2f22b28851d5515eb53d8d5e905aabdad46";
|
||||
nixpkgsSrc = fetchTarball {
|
||||
url = "https://github.com/NixOS/nixpkgs/archive/${nixpkgsCommit}.tar.gz";
|
||||
sha256 = "I7oAGC1Ldm5kcryUQxLubMmMCj5o0n+JSLVGRCL0wm8=";
|
||||
sha256 = "sha256:0jwwndkdfrv8cfcv47ir1k05gqqxhpi3jkv3dsyflv0wy3pl98g2";
|
||||
};
|
||||
nixpkgs = import nixpkgsSrc {
|
||||
config.allowUnfree = true;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "remote-cache_lib",
|
||||
srcs = [
|
||||
"main.go",
|
||||
"service.go",
|
||||
|
@ -9,15 +9,15 @@ go_library(
|
|||
importpath = "code.hackerspace.pl/hscloud/devtools/ci/remote-cache",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = [
|
||||
"//go/mirko:go_default_library",
|
||||
"@com_github_golang_glog//:go_default_library",
|
||||
"@com_github_minio_minio_go_v7//:go_default_library",
|
||||
"@com_github_minio_minio_go_v7//pkg/credentials:go_default_library",
|
||||
"//go/mirko",
|
||||
"@com_github_golang_glog//:glog",
|
||||
"@com_github_minio_minio_go_v7//:minio-go",
|
||||
"@com_github_minio_minio_go_v7//pkg/credentials",
|
||||
],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "remote-cache",
|
||||
embed = [":go_default_library"],
|
||||
embed = [":remote-cache_lib"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
|
|
@ -2,30 +2,30 @@ load("@io_bazel_rules_docker//container:container.bzl", "container_image", "cont
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "depotview_lib",
|
||||
srcs = ["main.go"],
|
||||
importpath = "code.hackerspace.pl/hscloud/devtools/depotview",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = [
|
||||
"//devtools/depotview/proto:go_default_library",
|
||||
"//devtools/depotview/service:go_default_library",
|
||||
"//go/mirko:go_default_library",
|
||||
"@com_github_golang_glog//:go_default_library",
|
||||
"//devtools/depotview/proto",
|
||||
"//devtools/depotview/service",
|
||||
"//go/mirko",
|
||||
"@com_github_golang_glog//:glog",
|
||||
],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "depotview",
|
||||
embed = [":go_default_library"],
|
||||
embed = [":depotview_lib"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
container_layer(
|
||||
name = "layer_bin",
|
||||
directory = "/devtools/",
|
||||
files = [
|
||||
":depotview",
|
||||
],
|
||||
directory = "/devtools/",
|
||||
)
|
||||
|
||||
container_image(
|
||||
|
@ -38,8 +38,8 @@ container_image(
|
|||
|
||||
container_push(
|
||||
name = "push",
|
||||
image = ":runtime",
|
||||
format = "Docker",
|
||||
image = ":runtime",
|
||||
registry = "registry.k0.hswaw.net",
|
||||
repository = "q3k/depotview",
|
||||
tag = "{BUILD_TIMESTAMP}-{STABLE_GIT_COMMIT}",
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
load("@rules_proto//proto:defs.bzl", "proto_library")
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
|
||||
|
||||
|
@ -16,7 +17,7 @@ go_proto_library(
|
|||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "proto",
|
||||
embed = [":proto_go_proto"],
|
||||
importpath = "code.hackerspace.pl/hscloud/devtools/depotview/proto",
|
||||
visibility = ["//visibility:public"],
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "service",
|
||||
srcs = [
|
||||
"gerrit.go",
|
||||
"service.go",
|
||||
|
@ -9,23 +9,23 @@ go_library(
|
|||
importpath = "code.hackerspace.pl/hscloud/devtools/depotview/service",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//devtools/depotview/proto:go_default_library",
|
||||
"@com_github_go_git_go_git_v5//:go_default_library",
|
||||
"@com_github_go_git_go_git_v5//config:go_default_library",
|
||||
"@com_github_go_git_go_git_v5//plumbing:go_default_library",
|
||||
"@com_github_go_git_go_git_v5//plumbing/filemode:go_default_library",
|
||||
"@com_github_go_git_go_git_v5//plumbing/object:go_default_library",
|
||||
"@com_github_go_git_go_git_v5//storage:go_default_library",
|
||||
"@com_github_go_git_go_git_v5//storage/memory:go_default_library",
|
||||
"@com_github_golang_glog//:go_default_library",
|
||||
"@org_golang_google_grpc//codes:go_default_library",
|
||||
"@org_golang_google_grpc//status:go_default_library",
|
||||
"//devtools/depotview/proto",
|
||||
"@com_github_go_git_go_git_v5//:go-git",
|
||||
"@com_github_go_git_go_git_v5//config",
|
||||
"@com_github_go_git_go_git_v5//plumbing",
|
||||
"@com_github_go_git_go_git_v5//plumbing/filemode",
|
||||
"@com_github_go_git_go_git_v5//plumbing/object",
|
||||
"@com_github_go_git_go_git_v5//storage",
|
||||
"@com_github_go_git_go_git_v5//storage/memory",
|
||||
"@com_github_golang_glog//:glog",
|
||||
"@org_golang_google_grpc//codes",
|
||||
"@org_golang_google_grpc//status",
|
||||
],
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
name = "service_test",
|
||||
srcs = ["service_test.go"],
|
||||
embed = [":go_default_library"],
|
||||
deps = ["//devtools/depotview/proto:go_default_library"],
|
||||
embed = [":service"],
|
||||
deps = ["//devtools/depotview/proto"],
|
||||
)
|
||||
|
|
|
@ -3,24 +3,24 @@ load("@io_bazel_rules_docker//container:container.bzl", "container_image", "cont
|
|||
container_image(
|
||||
name = "with_plugins",
|
||||
base = "@gerrit-3.3.2//image",
|
||||
files = [
|
||||
"//devtools/gerrit/gerrit-oauth-provider:gerrit-oauth-provider",
|
||||
"@com_googlesource_gerrit_plugin_owners//owners:owners.jar",
|
||||
],
|
||||
# we cannot drop it directly in /var/gerrit/plugins as that changes the
|
||||
# directory owner to 0:0 and then breaks the gerrit installer that wants
|
||||
# to overwrite plugins.
|
||||
directory = "/var/gerrit-plugins",
|
||||
files = [
|
||||
"//devtools/gerrit/gerrit-oauth-provider",
|
||||
"@com_googlesource_gerrit_plugin_owners//owners:owners.jar",
|
||||
],
|
||||
)
|
||||
|
||||
container_image(
|
||||
name = "with_theme",
|
||||
base = ":with_plugins",
|
||||
directory = "/var/gerrit-theme",
|
||||
files = [
|
||||
"theme/etc/GerritSite.css",
|
||||
"theme/static/pepper-icon.png",
|
||||
],
|
||||
directory = "/var/gerrit-theme",
|
||||
)
|
||||
|
||||
# Add gerrit 3.3.2 with backported fix. See org_q3k_gerrit_3_3_2_backport in
|
||||
|
@ -29,24 +29,24 @@ container_image(
|
|||
container_image(
|
||||
name = "with_gerrit_override",
|
||||
base = "with_theme",
|
||||
directory = "/var/gerrit/bin/",
|
||||
files = [
|
||||
"@org_q3k_gerrit_3_3_2_backport//file:gerrit.war",
|
||||
],
|
||||
directory = "/var/gerrit/bin/",
|
||||
)
|
||||
|
||||
container_image(
|
||||
name = "3.3.2-r4",
|
||||
base = ":with_gerrit_override",
|
||||
files = [":entrypoint.sh"],
|
||||
directory = "/",
|
||||
entrypoint = ["/entrypoint.sh"],
|
||||
files = [":entrypoint.sh"],
|
||||
)
|
||||
|
||||
container_push(
|
||||
name = "push",
|
||||
image = ":3.3.2-r4",
|
||||
format = "Docker",
|
||||
image = ":3.3.2-r4",
|
||||
registry = "registry.k0.hswaw.net",
|
||||
repository = "q3k/gerrit",
|
||||
tag = "3.3.2-r4",
|
||||
|
|
|
@ -25,15 +25,15 @@ gerrit_plugin(
|
|||
],
|
||||
)
|
||||
|
||||
junit_tests(
|
||||
name = "gerrit-oauth-provider_tests",
|
||||
srcs = glob(["src/test/java/**/*.java"]),
|
||||
tags = ["oauth"],
|
||||
deps = [
|
||||
":gerrit-oauth-provider__plugin_test_deps",
|
||||
"@scribejava-core//jar",
|
||||
],
|
||||
)
|
||||
#junit_tests(
|
||||
# name = "gerrit-oauth-provider_tests",
|
||||
# srcs = glob(["src/test/java/**/*.java"]),
|
||||
# tags = ["oauth"],
|
||||
# deps = [
|
||||
# ":gerrit-oauth-provider__plugin_test_deps",
|
||||
# "@scribejava-core//jar",
|
||||
# ],
|
||||
#)
|
||||
|
||||
java_library(
|
||||
name = "gerrit-oauth-provider__plugin_test_deps",
|
||||
|
|
|
@ -2,7 +2,7 @@ load("@io_bazel_rules_docker//container:container.bzl", "container_image", "cont
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "hackdoc_lib",
|
||||
srcs = [
|
||||
"helpers.go",
|
||||
"main.go",
|
||||
|
@ -11,30 +11,30 @@ go_library(
|
|||
importpath = "code.hackerspace.pl/hscloud/devtools/hackdoc",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = [
|
||||
"//devtools/depotview/proto:go_default_library",
|
||||
"//devtools/hackdoc/config:go_default_library",
|
||||
"//devtools/hackdoc/source:go_default_library",
|
||||
"//go/mirko:go_default_library",
|
||||
"//go/pki:go_default_library",
|
||||
"@com_github_gabriel_vasile_mimetype//:go_default_library",
|
||||
"@com_github_golang_glog//:go_default_library",
|
||||
"@in_gopkg_russross_blackfriday_v2//:go_default_library",
|
||||
"//devtools/depotview/proto",
|
||||
"//devtools/hackdoc/config",
|
||||
"//devtools/hackdoc/source",
|
||||
"//go/mirko",
|
||||
"//go/pki",
|
||||
"@com_github_gabriel_vasile_mimetype//:mimetype",
|
||||
"@com_github_golang_glog//:glog",
|
||||
"@com_github_russross_blackfriday_v2//:blackfriday",
|
||||
"@org_golang_google_grpc//:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "hackdoc",
|
||||
embed = [":go_default_library"],
|
||||
embed = [":hackdoc_lib"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
container_layer(
|
||||
name = "layer_bin",
|
||||
directory = "/devtools/",
|
||||
files = [
|
||||
":hackdoc",
|
||||
],
|
||||
directory = "/devtools/",
|
||||
)
|
||||
|
||||
container_image(
|
||||
|
@ -47,8 +47,8 @@ container_image(
|
|||
|
||||
container_push(
|
||||
name = "push",
|
||||
image = ":runtime",
|
||||
format = "Docker",
|
||||
image = ":runtime",
|
||||
registry = "registry.k0.hswaw.net",
|
||||
repository = "q3k/hackdoc",
|
||||
tag = "{BUILD_TIMESTAMP}-{STABLE_GIT_COMMIT}",
|
||||
|
|
|
@ -16,7 +16,7 @@ You can pass a `?ref=foo` URL parameter to a hackdoc URL to get it to render a p
|
|||
Special Markdown
|
||||
----------------
|
||||
|
||||
We should be accepting a Somewhat Standard Subset Of Markdown. For reference, we're using the [blackfriday](https://godoc.org/gopkg.in/russross/blackfriday.v2) library with [CommonExtensions](https://godoc.org/gopkg.in/russross/blackfriday.v2#CommonExtensions) enabled.
|
||||
We should be accepting a Somewhat Standard Subset Of Markdown. For reference, we're using the [blackfriday](https://godoc.org/github.com/russross/blackfriday/v2) library with [CommonExtensions](https://godoc.org/github.com/russross/blackfriday/v2#CommonExtensions) enabled.
|
||||
|
||||
In addition, we also support Table of Contents autorendering, just place the following anywhere in your document to render a TOC:
|
||||
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "config",
|
||||
srcs = ["config.go"],
|
||||
importpath = "code.hackerspace.pl/hscloud/devtools/hackdoc/config",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//devtools/hackdoc/source:go_default_library",
|
||||
"@com_github_burntsushi_toml//:go_default_library",
|
||||
"//devtools/hackdoc/source",
|
||||
"@com_github_burntsushi_toml//:toml",
|
||||
],
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
name = "config_test",
|
||||
srcs = ["config_test.go"],
|
||||
embed = [":go_default_library"],
|
||||
deps = ["@com_github_go_test_deep//:go_default_library"],
|
||||
embed = [":config"],
|
||||
deps = ["@com_github_go_test_deep//:deep"],
|
||||
)
|
||||
|
|
|
@ -10,7 +10,7 @@ import (
|
|||
|
||||
"github.com/gabriel-vasile/mimetype"
|
||||
"github.com/golang/glog"
|
||||
"gopkg.in/russross/blackfriday.v2"
|
||||
"github.com/russross/blackfriday/v2"
|
||||
)
|
||||
|
||||
// renderMarkdown renders markdown to HTML, replacing all relative (intra-hackdoc) links with version that have ref set.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "source",
|
||||
srcs = [
|
||||
"source.go",
|
||||
"source_depotview.go",
|
||||
|
@ -9,5 +9,5 @@ go_library(
|
|||
],
|
||||
importpath = "code.hackerspace.pl/hscloud/devtools/hackdoc/source",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = ["//devtools/depotview/proto:go_default_library"],
|
||||
deps = ["//devtools/depotview/proto"],
|
||||
)
|
||||
|
|
|
@ -2,25 +2,25 @@ load("@io_bazel_rules_docker//container:container.bzl", "container_image", "cont
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "b_lib",
|
||||
srcs = ["main.go"],
|
||||
importpath = "code.hackerspace.pl/hscloud/devtools/issues/b",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = ["@com_github_golang_glog//:go_default_library"],
|
||||
deps = ["@com_github_golang_glog//:glog"],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "b",
|
||||
embed = [":go_default_library"],
|
||||
embed = [":b_lib"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
container_layer(
|
||||
name = "layer_bin",
|
||||
directory = "/devtools/issues/",
|
||||
files = [
|
||||
":b",
|
||||
],
|
||||
directory = "/devtools/issues/",
|
||||
)
|
||||
|
||||
container_image(
|
||||
|
@ -33,10 +33,9 @@ container_image(
|
|||
|
||||
container_push(
|
||||
name = "push",
|
||||
image = ":runtime",
|
||||
format = "Docker",
|
||||
image = ":runtime",
|
||||
registry = "registry.k0.hswaw.net",
|
||||
repository = "q3k/b",
|
||||
tag = "{BUILD_TIMESTAMP}-{STABLE_GIT_COMMIT}",
|
||||
)
|
||||
|
||||
|
|
|
@ -2,33 +2,33 @@ load("@io_bazel_rules_docker//container:container.bzl", "container_image", "cont
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "modproxy_lib",
|
||||
srcs = ["main.go"],
|
||||
importpath = "code.hackerspace.pl/hscloud/games/factorio/modproxy",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = [
|
||||
"//games/factorio/modproxy/modportal:go_default_library",
|
||||
"//games/factorio/modproxy/proto:go_default_library",
|
||||
"//go/mirko:go_default_library",
|
||||
"@com_github_golang_glog//:go_default_library",
|
||||
"@org_golang_google_grpc//codes:go_default_library",
|
||||
"@org_golang_google_grpc//status:go_default_library",
|
||||
"//games/factorio/modproxy/modportal",
|
||||
"//games/factorio/modproxy/proto",
|
||||
"//go/mirko",
|
||||
"@com_github_golang_glog//:glog",
|
||||
"@org_golang_google_grpc//codes",
|
||||
"@org_golang_google_grpc//status",
|
||||
],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "modproxy",
|
||||
embed = [":go_default_library"],
|
||||
embed = [":modproxy_lib"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
container_layer(
|
||||
name = "layer_bin",
|
||||
directory = "/games/factorio/modproxy/",
|
||||
files = [
|
||||
":modproxy",
|
||||
"//games/factorio/modproxy/client:client",
|
||||
"//games/factorio/modproxy/client",
|
||||
],
|
||||
directory = "/games/factorio/modproxy/",
|
||||
)
|
||||
|
||||
container_image(
|
||||
|
@ -41,8 +41,8 @@ container_image(
|
|||
|
||||
container_push(
|
||||
name = "push",
|
||||
image = ":runtime",
|
||||
format = "Docker",
|
||||
image = ":runtime",
|
||||
registry = "registry.k0.hswaw.net",
|
||||
repository = "games/factorio/modproxy",
|
||||
tag = "{BUILD_TIMESTAMP}-{STABLE_GIT_COMMIT}",
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "client_lib",
|
||||
srcs = ["client.go"],
|
||||
importpath = "code.hackerspace.pl/hscloud/games/factorio/modproxy/client",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = [
|
||||
"//games/factorio/modproxy/modportal:go_default_library",
|
||||
"//games/factorio/modproxy/proto:go_default_library",
|
||||
"//go/pki:go_default_library",
|
||||
"@com_github_gogo_protobuf//proto:go_default_library",
|
||||
"@com_github_golang_glog//:go_default_library",
|
||||
"//games/factorio/modproxy/modportal",
|
||||
"//games/factorio/modproxy/proto",
|
||||
"//go/pki",
|
||||
"@com_github_gogo_protobuf//proto",
|
||||
"@com_github_golang_glog//:glog",
|
||||
"@org_golang_google_grpc//:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "client",
|
||||
embed = [":go_default_library"],
|
||||
embed = [":client_lib"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "modportal",
|
||||
srcs = ["modportal.go"],
|
||||
importpath = "code.hackerspace.pl/hscloud/games/factorio/modproxy/modportal",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"@org_golang_google_grpc//codes:go_default_library",
|
||||
"@org_golang_google_grpc//status:go_default_library",
|
||||
"@org_golang_google_grpc//codes",
|
||||
"@org_golang_google_grpc//status",
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
load("@rules_proto//proto:defs.bzl", "proto_library")
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
|
||||
|
||||
|
@ -16,7 +17,7 @@ go_proto_library(
|
|||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "proto",
|
||||
embed = [":proto_go_proto"],
|
||||
importpath = "code.hackerspace.pl/hscloud/games/factorio/modproxy/proto",
|
||||
visibility = ["//visibility:public"],
|
||||
|
|
|
@ -0,0 +1,270 @@
|
|||
module code.hackerspace.pl/hscloud
|
||||
|
||||
go 1.19
|
||||
|
||||
// Kubernetes is not fully consumable as a module, fix that
|
||||
replace (
|
||||
k8s.io/api => k8s.io/api v0.24.2
|
||||
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.24.2
|
||||
k8s.io/apimachinery => k8s.io/apimachinery v0.24.2
|
||||
k8s.io/apiserver => k8s.io/apiserver v0.24.2
|
||||
k8s.io/cli-runtime => k8s.io/cli-runtime v0.24.2
|
||||
k8s.io/client-go => k8s.io/client-go v0.24.2
|
||||
k8s.io/cloud-provider => k8s.io/cloud-provider v0.24.2
|
||||
k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.24.2
|
||||
k8s.io/code-generator => k8s.io/code-generator v0.24.2
|
||||
k8s.io/component-base => k8s.io/component-base v0.24.2
|
||||
k8s.io/component-helpers => k8s.io/component-helpers v0.24.2
|
||||
k8s.io/controller-manager => k8s.io/controller-manager v0.24.2
|
||||
k8s.io/cri-api => k8s.io/cri-api v0.24.2
|
||||
k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.24.2
|
||||
k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.24.0-beta.0
|
||||
k8s.io/kms => k8s.io/kms v0.24.0-beta.0
|
||||
k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.24.2
|
||||
k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.24.2
|
||||
k8s.io/kube-proxy => k8s.io/kube-proxy v0.24.2
|
||||
k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.24.2
|
||||
k8s.io/kubectl => k8s.io/kubectl v0.24.2
|
||||
k8s.io/kubelet => k8s.io/kubelet v0.24.2
|
||||
k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.24.2
|
||||
k8s.io/metrics => k8s.io/metrics v0.24.2
|
||||
k8s.io/mount-utils => k8s.io/mount-utils v0.24.2
|
||||
k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.24.2
|
||||
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.24.2
|
||||
)
|
||||
|
||||
// Pin down gettext-go (broke at 1.0.0)
|
||||
replace github.com/chai2010/gettext-go => github.com/chai2010/gettext-go v0.1.0
|
||||
|
||||
// Pin down go-jsonnet (need to upgrade kargongips against new API)
|
||||
replace github.com/google/go-jsonnet => github.com/google/go-jsonnet v0.12.1
|
||||
|
||||
// Gets vendored in 1.5.10.
|
||||
replace github.com/cloudflare/cfrpki => github.com/cloudflare/cfrpki v1.2.1
|
||||
|
||||
require (
|
||||
github.com/BurntSushi/toml v1.3.2
|
||||
github.com/SebastiaanKlippert/go-wkhtmltopdf v1.9.0
|
||||
github.com/arran4/golang-ical v0.0.0-20230425234049-f69e132f2b0c
|
||||
github.com/boltdb/bolt v1.3.1
|
||||
github.com/cenkalti/backoff v2.2.1+incompatible
|
||||
github.com/cloudflare/cfrpki v0.0.0-00010101000000-000000000000
|
||||
github.com/cloudflare/cfssl v1.6.4
|
||||
github.com/coreos/go-oidc v2.2.1+incompatible
|
||||
github.com/dgraph-io/ristretto v0.1.1
|
||||
github.com/digitalocean/go-netbox v0.0.2
|
||||
github.com/dustin/go-humanize v1.0.1
|
||||
github.com/elazarl/go-bindata-assetfs v1.0.1
|
||||
github.com/evanphx/json-patch v4.12.0+incompatible
|
||||
github.com/fvbommel/sortorder v1.1.0
|
||||
github.com/gabriel-vasile/mimetype v1.4.2
|
||||
github.com/gchaincl/sqlhooks v1.3.0
|
||||
github.com/genuinetools/reg v0.16.1
|
||||
github.com/ghodss/yaml v1.0.0
|
||||
github.com/go-git/go-git/v5 v5.8.0
|
||||
github.com/go-ldap/ldap/v3 v3.4.5
|
||||
github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible
|
||||
github.com/go-test/deep v1.1.0
|
||||
github.com/gogo/protobuf v1.3.2
|
||||
github.com/golang-collections/go-datastructures v0.0.0-20150211160725-59788d5eb259
|
||||
github.com/golang-migrate/migrate/v4 v4.16.2
|
||||
github.com/golang/glog v1.1.1
|
||||
github.com/golang/protobuf v1.5.3
|
||||
github.com/google/gnostic v0.5.7-v3refs
|
||||
github.com/google/go-cmp v0.5.9
|
||||
github.com/google/go-jsonnet v0.20.0
|
||||
github.com/gorilla/sessions v1.2.1
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0
|
||||
github.com/itchyny/gojq v0.12.13
|
||||
github.com/jmoiron/sqlx v1.3.5
|
||||
github.com/kevinburke/go-bindata v3.23.0+incompatible
|
||||
github.com/lib/pq v1.10.9
|
||||
github.com/mattn/go-isatty v0.0.19
|
||||
github.com/mattn/go-sqlite3 v1.14.17
|
||||
github.com/minio/minio-go/v7 v7.0.61
|
||||
github.com/piranha/gostatic v0.0.0-20230302053144-bf366bcf14fd
|
||||
github.com/q3k/cursedjsonrpc v2.1.2+incompatible
|
||||
github.com/russross/blackfriday/v2 v2.1.0
|
||||
github.com/sergi/go-diff v1.3.1
|
||||
github.com/sethvargo/go-password v0.2.0
|
||||
github.com/shirou/gopsutil v3.21.11+incompatible
|
||||
github.com/sirupsen/logrus v1.9.3
|
||||
github.com/spf13/cobra v1.7.0
|
||||
github.com/spf13/pflag v1.0.5
|
||||
github.com/stretchr/testify v1.8.4
|
||||
github.com/ulule/limiter/v3 v3.11.2
|
||||
github.com/ziutek/telnet v0.0.0-20180329124119-c3b780dc415b
|
||||
golang.org/x/crypto v0.11.0
|
||||
golang.org/x/image v0.9.0
|
||||
golang.org/x/net v0.12.0
|
||||
golang.org/x/oauth2 v0.10.0
|
||||
google.golang.org/grpc v1.56.2
|
||||
google.golang.org/protobuf v1.31.0
|
||||
gopkg.in/irc.v3 v3.1.4
|
||||
gopkg.in/yaml.v2 v2.4.0
|
||||
k8s.io/api v0.24.2
|
||||
k8s.io/apiextensions-apiserver v0.0.0
|
||||
k8s.io/apimachinery v0.24.2
|
||||
k8s.io/client-go v0.24.2
|
||||
k8s.io/klog v1.0.0
|
||||
k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42
|
||||
k8s.io/kubectl v0.0.0
|
||||
k8s.io/kubernetes v1.25.0-alpha.0
|
||||
)
|
||||
|
||||
require (
|
||||
cloud.google.com/go/compute v1.20.1 // indirect
|
||||
cloud.google.com/go/compute/metadata v0.2.3 // indirect
|
||||
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
|
||||
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
|
||||
github.com/Azure/go-autorest/autorest v0.11.27 // indirect
|
||||
github.com/Azure/go-autorest/autorest/adal v0.9.20 // indirect
|
||||
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
|
||||
github.com/Azure/go-autorest/logger v0.2.1 // indirect
|
||||
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
|
||||
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect
|
||||
github.com/MakeNowJust/heredoc v1.0.0 // indirect
|
||||
github.com/Microsoft/go-winio v0.6.1 // indirect
|
||||
github.com/ProtonMail/go-crypto v0.0.0-20230518184743-7afd39499903 // indirect
|
||||
github.com/acomagu/bufpipe v1.0.4 // indirect
|
||||
github.com/alecthomas/chroma/v2 v2.5.0 // indirect
|
||||
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/bmatcuk/doublestar/v4 v4.6.0 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
||||
github.com/chai2010/gettext-go v1.0.2 // indirect
|
||||
github.com/cloudflare/circl v1.3.3 // indirect
|
||||
github.com/cloudflare/gortr v0.9.5 // indirect
|
||||
github.com/cockroachdb/cockroach-go/v2 v2.1.1 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/daviddengcn/go-colortext v1.0.0 // indirect
|
||||
github.com/dlclark/regexp2 v1.8.1 // indirect
|
||||
github.com/docker/cli v0.0.0-20190913211141-95327f4e6241 // indirect
|
||||
github.com/docker/distribution v2.8.2+incompatible // indirect
|
||||
github.com/docker/docker v20.10.24+incompatible // indirect
|
||||
github.com/docker/docker-credential-helpers v0.6.3 // indirect
|
||||
github.com/docker/go-connections v0.4.0 // indirect
|
||||
github.com/docker/go-units v0.5.0 // indirect
|
||||
github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 // indirect
|
||||
github.com/emicklei/go-restful v2.9.5+incompatible // indirect
|
||||
github.com/emirpasic/gods v1.18.1 // indirect
|
||||
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
|
||||
github.com/fatih/camelcase v1.0.0 // indirect
|
||||
github.com/fsnotify/fsnotify v1.6.0 // indirect
|
||||
github.com/getsentry/sentry-go v0.11.0 // indirect
|
||||
github.com/go-asn1-ber/asn1-ber v1.5.4 // indirect
|
||||
github.com/go-errors/errors v1.4.2 // indirect
|
||||
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
|
||||
github.com/go-git/go-billy/v5 v5.4.1 // indirect
|
||||
github.com/go-logr/logr v1.2.3 // indirect
|
||||
github.com/go-ole/go-ole v1.2.6 // indirect
|
||||
github.com/go-openapi/analysis v0.20.1 // indirect
|
||||
github.com/go-openapi/errors v0.20.1 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.19.6 // indirect
|
||||
github.com/go-openapi/jsonreference v0.20.1 // indirect
|
||||
github.com/go-openapi/loads v0.20.3 // indirect
|
||||
github.com/go-openapi/runtime v0.20.0 // indirect
|
||||
github.com/go-openapi/spec v0.20.4 // indirect
|
||||
github.com/go-openapi/strfmt v0.20.3 // indirect
|
||||
github.com/go-openapi/swag v0.22.3 // indirect
|
||||
github.com/go-openapi/validate v0.20.3 // indirect
|
||||
github.com/go-stack/stack v1.8.1 // indirect
|
||||
github.com/golang-jwt/jwt/v4 v4.4.2 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/google/btree v1.1.2 // indirect
|
||||
github.com/google/certificate-transparency-go v1.1.4 // indirect
|
||||
github.com/google/gofuzz v1.1.0 // indirect
|
||||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
|
||||
github.com/google/uuid v1.3.0 // indirect
|
||||
github.com/gorilla/securecookie v1.1.1 // indirect
|
||||
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/imdario/mergo v0.3.15 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||
github.com/itchyny/timefmt-go v0.1.5 // indirect
|
||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
|
||||
github.com/jessevdk/go-flags v1.5.0 // indirect
|
||||
github.com/jonboulle/clockwork v0.3.0 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/kevinburke/ssh_config v1.2.0 // indirect
|
||||
github.com/klauspost/compress v1.16.7 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
|
||||
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
|
||||
github.com/lithammer/dedent v1.1.0 // indirect
|
||||
github.com/mailru/easyjson v0.7.7 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.14 // indirect
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
|
||||
github.com/minio/md5-simd v1.1.2 // indirect
|
||||
github.com/minio/sha256-simd v1.0.1 // indirect
|
||||
github.com/mitchellh/go-wordwrap v1.0.0 // indirect
|
||||
github.com/mitchellh/mapstructure v1.4.2 // indirect
|
||||
github.com/moby/spdystream v0.2.0 // indirect
|
||||
github.com/moby/term v0.5.0 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
|
||||
github.com/oklog/ulid v1.3.1 // indirect
|
||||
github.com/opencontainers/go-digest v1.0.0 // indirect
|
||||
github.com/opencontainers/image-spec v1.0.2 // indirect
|
||||
github.com/opentracing/opentracing-go v1.2.0 // indirect
|
||||
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
|
||||
github.com/peterhellberg/link v1.0.0 // indirect
|
||||
github.com/pjbgf/sha1cd v0.3.0 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/pquerna/cachecontrol v0.1.0 // indirect
|
||||
github.com/prometheus/client_golang v1.13.0 // indirect
|
||||
github.com/prometheus/client_model v0.2.0 // indirect
|
||||
github.com/prometheus/common v0.37.0 // indirect
|
||||
github.com/prometheus/procfs v0.8.0 // indirect
|
||||
github.com/rivo/uniseg v0.4.4 // indirect
|
||||
github.com/rs/cors v1.8.2 // indirect
|
||||
github.com/rs/xid v1.5.0 // indirect
|
||||
github.com/russross/blackfriday v1.5.2 // indirect
|
||||
github.com/skeema/knownhosts v1.1.1 // indirect
|
||||
github.com/technoweenie/multipartstreamer v1.0.1 // indirect
|
||||
github.com/uber/jaeger-client-go v2.23.1+incompatible // indirect
|
||||
github.com/uber/jaeger-lib v2.2.0+incompatible // indirect
|
||||
github.com/weppos/publicsuffix-go v0.15.1-0.20210511084619-b1f36a2d6c0b // indirect
|
||||
github.com/xanzy/ssh-agent v0.3.3 // indirect
|
||||
github.com/xlab/treeprint v1.1.0 // indirect
|
||||
github.com/yuin/goldmark v1.5.4 // indirect
|
||||
github.com/yuin/goldmark-highlighting/v2 v2.0.0-20220924101305-151362477c87 // indirect
|
||||
github.com/yusufpapurcu/wmi v1.2.3 // indirect
|
||||
github.com/zmap/zcrypto v0.0.0-20210511125630-18f1e0152cfc // indirect
|
||||
github.com/zmap/zlint/v3 v3.1.0 // indirect
|
||||
go.mongodb.org/mongo-driver v1.7.5 // indirect
|
||||
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
|
||||
go.uber.org/atomic v1.10.0 // indirect
|
||||
golang.org/x/mod v0.10.0 // indirect
|
||||
golang.org/x/sys v0.10.0 // indirect
|
||||
golang.org/x/term v0.10.0 // indirect
|
||||
golang.org/x/text v0.11.0 // indirect
|
||||
golang.org/x/time v0.0.0-20220411224347-583f2d630306 // indirect
|
||||
golang.org/x/tools v0.9.1 // indirect
|
||||
google.golang.org/appengine v1.6.7 // indirect
|
||||
google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
|
||||
gopkg.in/warnings.v0 v0.1.2 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
k8s.io/cli-runtime v0.24.2 // indirect
|
||||
k8s.io/component-base v0.24.2 // indirect
|
||||
k8s.io/component-helpers v0.24.2 // indirect
|
||||
k8s.io/klog/v2 v2.90.1 // indirect
|
||||
k8s.io/metrics v0.24.2 // indirect
|
||||
k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
|
||||
sigs.k8s.io/kustomize/api v0.11.4 // indirect
|
||||
sigs.k8s.io/kustomize/kustomize/v4 v4.5.4 // indirect
|
||||
sigs.k8s.io/kustomize/kyaml v0.13.6 // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
|
||||
sigs.k8s.io/yaml v1.3.0 // indirect
|
||||
)
|
|
@ -1,7 +1,7 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "mirko",
|
||||
srcs = [
|
||||
"kubernetes.go",
|
||||
"mirko.go",
|
||||
|
@ -13,22 +13,22 @@ go_library(
|
|||
importpath = "code.hackerspace.pl/hscloud/go/mirko",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//go/pki:go_default_library",
|
||||
"//go/statusz:go_default_library",
|
||||
"@com_github_gchaincl_sqlhooks//:go_default_library",
|
||||
"@com_github_golang_glog//:go_default_library",
|
||||
"@com_github_golang_migrate_migrate_v4//source:go_default_library",
|
||||
"@io_k8s_client_go//kubernetes:go_default_library",
|
||||
"@io_k8s_client_go//rest:go_default_library",
|
||||
"//go/pki",
|
||||
"//go/statusz",
|
||||
"@com_github_gchaincl_sqlhooks//:sqlhooks",
|
||||
"@com_github_golang_glog//:glog",
|
||||
"@com_github_golang_migrate_migrate_v4//source",
|
||||
"@io_k8s_client_go//kubernetes",
|
||||
"@io_k8s_client_go//rest",
|
||||
"@org_golang_google_grpc//:go_default_library",
|
||||
"@org_golang_google_grpc//reflection:go_default_library",
|
||||
"@org_golang_x_net//trace:go_default_library",
|
||||
"@org_golang_google_grpc//reflection",
|
||||
"@org_golang_x_net//trace",
|
||||
],
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
name = "mirko_test",
|
||||
srcs = ["revproxy_test.go"],
|
||||
embed = [":go_default_library"],
|
||||
deps = ["@io_k8s_client_go//kubernetes:go_default_library"],
|
||||
embed = [":mirko"],
|
||||
deps = ["@io_k8s_client_go//kubernetes"],
|
||||
)
|
||||
|
|
|
@ -4,7 +4,16 @@ go_test(
|
|||
name = "go_default_test",
|
||||
srcs = ["sql_test.go"],
|
||||
deps = [
|
||||
"//go/mirko/tests/sql/migrations:go_default_library",
|
||||
"@com_github_golang_migrate_migrate_v4//database/sqlite3:go_default_library",
|
||||
"//go/mirko/tests/sql/migrations",
|
||||
"@com_github_golang_migrate_migrate_v4//database/sqlite3",
|
||||
],
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "sql_test",
|
||||
srcs = ["sql_test.go"],
|
||||
deps = [
|
||||
"//go/mirko/tests/sql/migrations",
|
||||
"@com_github_golang_migrate_migrate_v4//database/sqlite3",
|
||||
],
|
||||
)
|
||||
|
|
|
@ -4,12 +4,12 @@ load("@io_bazel_rules_go//extras:embed_data.bzl", "go_embed_data")
|
|||
go_embed_data(
|
||||
name = "migrations_data",
|
||||
srcs = glob(["*.sql"]),
|
||||
package = "migrations",
|
||||
flatten = True,
|
||||
package = "migrations",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "migrations",
|
||||
srcs = [
|
||||
"migrations.go",
|
||||
":migrations_data", # keep
|
||||
|
@ -17,7 +17,7 @@ go_library(
|
|||
importpath = "code.hackerspace.pl/hscloud/go/mirko/tests/sql/migrations",
|
||||
visibility = ["//go/mirko/tests/sql:__subpackages__"],
|
||||
deps = [
|
||||
"//go/mirko:go_default_library",
|
||||
"@com_github_golang_migrate_migrate_v4//:go_default_library",
|
||||
"//go/mirko",
|
||||
"@com_github_golang_migrate_migrate_v4//:migrate",
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
name = "pki",
|
||||
srcs = [
|
||||
"grpc.go",
|
||||
"locate.go",
|
||||
|
@ -9,19 +9,19 @@ go_library(
|
|||
importpath = "code.hackerspace.pl/hscloud/go/pki",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"@com_github_golang_glog//:go_default_library",
|
||||
"@com_github_golang_glog//:glog",
|
||||
"@org_golang_google_grpc//:go_default_library",
|
||||
"@org_golang_google_grpc//codes:go_default_library",
|
||||
"@org_golang_google_grpc//credentials:go_default_library",
|
||||
"@org_golang_google_grpc//peer:go_default_library",
|
||||
"@org_golang_google_grpc//status:go_default_library",
|
||||
"@org_golang_x_net//trace:go_default_library",
|
||||
"@org_golang_google_grpc//codes",
|
||||
"@org_golang_google_grpc//credentials",
|
||||
"@org_golang_google_grpc//peer",
|
||||
"@org_golang_google_grpc//status",
|
||||
"@org_golang_x_net//trace",
|
||||
],
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
name = "pki_test",
|
||||
srcs = ["grpc_test.go"],
|
||||
embed = [":go_default_library"],
|
||||
deps = ["@com_github_go_test_deep//:go_default_library"],
|
||||
embed = [":pki"],
|
||||
deps = ["@com_github_go_test_deep//:deep"],
|
||||
)
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue