Skip to content

Commit

Permalink
cli: fix buildfiles
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz Sanft <[email protected]>
  • Loading branch information
msanft committed Nov 21, 2023
1 parent e19929a commit fa02ef3
Show file tree
Hide file tree
Showing 24 changed files with 79 additions and 72 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Link Checker
uses: lycheeverse/lychee-action@ec3ed119d4f44ad2673a7232460dc7dff59d2421 # v1.8.0
with:
args: "--verbose --no-progress --max-concurrency 5 --exclude-path './cli/internal/helm/charts/cilium' './**/*.md' './**/*.html'"
args: "--verbose --no-progress --max-concurrency 5 --exclude-path './internal/helm/charts/cilium' './**/*.md' './**/*.html'"
fail: true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
2 changes: 1 addition & 1 deletion .github/workflows/test-unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
- ".github/workflows/test-unittest.yml"
pull_request:
paths:
- "cli/internal/helm/**"
- "internal/helm/**"
- "**.go"
- "**/go.mod"
- "**/go.sum"
Expand Down
18 changes: 9 additions & 9 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
/bazel/container @katexochen
/bazel/sh @katexochen
/bootstrapper @3u13r
/cli/internal/cloudcmd @daniel-weisse
/cli/internal/cmd/upgrade* @derpsteb
/cli/internal/featureset @malt3
/cli/internal/helm @derpsteb
/cli/internal/kubecmd @daniel-weisse
/cli/internal/libvirt @daniel-weisse
/cli/internal/terraform @elchead
/cli/internal/upgrade @elchead
/cli/internal/state @elchead
/internal/cloudcmd @daniel-weisse
/internal/cmd/upgrade* @derpsteb
/internal/featureset @malt3
/internal/helm @derpsteb
/internal/kubecmd @daniel-weisse
/internal/libvirt @daniel-weisse
/internal/terraform @elchead
/internal/upgrade @elchead
/internal/state @elchead
/csi @daniel-weisse
/debugd @malt3
/disk-mapper @daniel-weisse
Expand Down
2 changes: 1 addition & 1 deletion bazel/ci/shfmt.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ readarray -t <<< "${scriptsStr}"
scripts=("${MAPFILE[@]}")

excludeDirs=(
"cli/internal/helm/charts/cilium"
"internal/helm/charts/cilium"
"build"
"docs/node_modules"
)
Expand Down
2 changes: 1 addition & 1 deletion bazel/oci/containers.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def containers():
"identifier": "libvirt",
"image_name": "libvirt",
"name": "libvirt",
"oci": "//cli/internal/libvirt:constellation_libvirt",
"oci": "//internal/libvirt:constellation_libvirt",
"repotag_file": "//bazel/release:libvirt_tag.txt",
"used_by": ["config"],
},
Expand Down
28 changes: 14 additions & 14 deletions cli/internal/cmd/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,7 @@ go_library(
visibility = ["//cli:__subpackages__"],
deps = [
"//bootstrapper/initproto",
"//cli/internal/cloudcmd",
"//cli/internal/cmd/pathprefix",
"//cli/internal/featureset",
"//cli/internal/helm",
"//cli/internal/kubecmd",
"//cli/internal/libvirt",
"//cli/internal/state",
"//cli/internal/terraform",
"//cli/internal/pathprefix",
"//disk-mapper/recoverproto",
"//internal/api/attestationconfigapi",
"//internal/api/fetcher",
Expand All @@ -66,24 +59,31 @@ go_library(
"//internal/attestation/vtpm",
"//internal/cloud/cloudprovider",
"//internal/cloud/gcpshared",
"//internal/cloudcmd",
"//internal/compatibility",
"//internal/config",
"//internal/config/instancetypes",
"//internal/config/migration",
"//internal/constants",
"//internal/crypto",
"//internal/featureset",
"//internal/file",
"//internal/grpc/dialer",
"//internal/grpc/grpclog",
"//internal/grpc/retry",
"//internal/helm",
"//internal/kms/uri",
"//internal/kubecmd",
"//internal/libvirt",
"//internal/license",
"//internal/logger",
"//internal/maa",
"//internal/retry",
"//internal/semver",
"//internal/sigstore",
"//internal/sigstore/keyselect",
"//internal/state",
"//internal/terraform",
"//internal/verify",
"//internal/versions",
"//verify/verifyproto",
Expand Down Expand Up @@ -147,12 +147,7 @@ go_test(
embed = [":cmd"],
deps = [
"//bootstrapper/initproto",
"//cli/internal/cloudcmd",
"//cli/internal/cmd/pathprefix",
"//cli/internal/helm",
"//cli/internal/kubecmd",
"//cli/internal/state",
"//cli/internal/terraform",
"//cli/internal/pathprefix",
"//disk-mapper/recoverproto",
"//internal/api/attestationconfigapi",
"//internal/api/versionsapi",
Expand All @@ -161,6 +156,7 @@ go_test(
"//internal/attestation/variant",
"//internal/cloud/cloudprovider",
"//internal/cloud/gcpshared",
"//internal/cloudcmd",
"//internal/config",
"//internal/constants",
"//internal/crypto",
Expand All @@ -169,11 +165,15 @@ go_test(
"//internal/grpc/atlscredentials",
"//internal/grpc/dialer",
"//internal/grpc/testdialer",
"//internal/helm",
"//internal/kms/uri",
"//internal/kubecmd",
"//internal/license",
"//internal/logger",
"//internal/semver",
"//internal/sigstore",
"//internal/state",
"//internal/terraform",
"//internal/versions",
"//operators/constellation-node-operator/api/v1alpha1",
"//verify/verifyproto",
Expand Down
8 changes: 4 additions & 4 deletions cli/internal/cmd/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ import (
"strings"
"time"

"github.com/edgelesssys/constellation/v2/internal/cloudcmd"
"github.com/edgelesssys/constellation/v2/internal/helm"
"github.com/edgelesssys/constellation/v2/internal/kubecmd"
"github.com/edgelesssys/constellation/v2/internal/state"
"github.com/edgelesssys/constellation/v2/internal/api/attestationconfigapi"
"github.com/edgelesssys/constellation/v2/internal/atls"
"github.com/edgelesssys/constellation/v2/internal/attestation/variant"
"github.com/edgelesssys/constellation/v2/internal/cloud/cloudprovider"
"github.com/edgelesssys/constellation/v2/internal/cloudcmd"
"github.com/edgelesssys/constellation/v2/internal/compatibility"
"github.com/edgelesssys/constellation/v2/internal/config"
"github.com/edgelesssys/constellation/v2/internal/constants"
"github.com/edgelesssys/constellation/v2/internal/file"
"github.com/edgelesssys/constellation/v2/internal/grpc/dialer"
"github.com/edgelesssys/constellation/v2/internal/helm"
"github.com/edgelesssys/constellation/v2/internal/kubecmd"
"github.com/edgelesssys/constellation/v2/internal/license"
"github.com/edgelesssys/constellation/v2/internal/state"
"github.com/edgelesssys/constellation/v2/internal/versions"
"github.com/spf13/afero"
"github.com/spf13/cobra"
Expand Down
4 changes: 2 additions & 2 deletions cli/internal/cmd/applyhelm.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import (
"path/filepath"

"github.com/edgelesssys/constellation/v2/internal/cloudcmd"
"github.com/edgelesssys/constellation/v2/internal/helm"
"github.com/edgelesssys/constellation/v2/internal/state"
"github.com/edgelesssys/constellation/v2/internal/compatibility"
"github.com/edgelesssys/constellation/v2/internal/config"
"github.com/edgelesssys/constellation/v2/internal/constants"
"github.com/edgelesssys/constellation/v2/internal/helm"
"github.com/edgelesssys/constellation/v2/internal/kms/uri"
"github.com/edgelesssys/constellation/v2/internal/state"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cli/internal/cmd/applyinit.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ import (

"github.com/edgelesssys/constellation/v2/bootstrapper/initproto"
"github.com/edgelesssys/constellation/v2/internal/cloudcmd"
"github.com/edgelesssys/constellation/v2/internal/state"
"github.com/edgelesssys/constellation/v2/internal/config"
"github.com/edgelesssys/constellation/v2/internal/constants"
"github.com/edgelesssys/constellation/v2/internal/crypto"
"github.com/edgelesssys/constellation/v2/internal/file"
grpcRetry "github.com/edgelesssys/constellation/v2/internal/grpc/retry"
"github.com/edgelesssys/constellation/v2/internal/kms/uri"
"github.com/edgelesssys/constellation/v2/internal/retry"
"github.com/edgelesssys/constellation/v2/internal/state"
"github.com/edgelesssys/constellation/v2/internal/versions"
"github.com/spf13/afero"
"github.com/spf13/cobra"
Expand Down
4 changes: 2 additions & 2 deletions cli/internal/cmd/applyterraform.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import (
"io"
"path/filepath"

"github.com/edgelesssys/constellation/v2/internal/cloudcmd"
"github.com/edgelesssys/constellation/v2/internal/state"
"github.com/edgelesssys/constellation/v2/internal/cloud/cloudprovider"
"github.com/edgelesssys/constellation/v2/internal/cloudcmd"
"github.com/edgelesssys/constellation/v2/internal/config"
"github.com/edgelesssys/constellation/v2/internal/constants"
"github.com/edgelesssys/constellation/v2/internal/state"
"github.com/spf13/cobra"
)

Expand Down
6 changes: 3 additions & 3 deletions cli/internal/cmd/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ package cmd
import (
"context"

"github.com/edgelesssys/constellation/v2/internal/cloudcmd"
"github.com/edgelesssys/constellation/v2/internal/state"
"github.com/edgelesssys/constellation/v2/internal/terraform"
"github.com/edgelesssys/constellation/v2/internal/cloud/cloudprovider"
"github.com/edgelesssys/constellation/v2/internal/cloud/gcpshared"
"github.com/edgelesssys/constellation/v2/internal/cloudcmd"
"github.com/edgelesssys/constellation/v2/internal/config"
"github.com/edgelesssys/constellation/v2/internal/state"
"github.com/edgelesssys/constellation/v2/internal/terraform"
)

type cloudApplier interface {
Expand Down
2 changes: 1 addition & 1 deletion cli/internal/pathprefix/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "pathprefix",
srcs = ["pathprefix.go"],
importpath = "github.com/edgelesssys/constellation/v2/cli/internal/cmd/pathprefix",
importpath = "github.com/edgelesssys/constellation/v2/cli/internal/pathprefix",
visibility = ["//cli:__subpackages__"],
)
12 changes: 6 additions & 6 deletions internal/cloudcmd/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@ go_library(
"validators.go",
],
importpath = "github.com/edgelesssys/constellation/v2/internal/cloudcmd",
visibility = ["//cli:__subpackages__"],
visibility = ["//:__subpackages__"],
deps = [
"//cli/internal/libvirt",
"//cli/internal/state",
"//cli/internal/terraform",
"//internal/atls",
"//internal/attestation/choose",
"//internal/attestation/measurements",
Expand All @@ -34,8 +31,11 @@ go_library(
"//internal/constants",
"//internal/file",
"//internal/imagefetcher",
"//internal/libvirt",
"//internal/maa",
"//internal/role",
"//internal/state",
"//internal/terraform",
"@com_github_spf13_cobra//:cobra",
],
)
Expand All @@ -54,15 +54,15 @@ go_test(
],
embed = [":cloudcmd"],
deps = [
"//cli/internal/state",
"//cli/internal/terraform",
"//internal/attestation/measurements",
"//internal/attestation/variant",
"//internal/cloud/cloudprovider",
"//internal/cloud/gcpshared",
"//internal/config",
"//internal/constants",
"//internal/file",
"//internal/state",
"//internal/terraform",
"@com_github_spf13_afero//:afero",
"@com_github_stretchr_testify//assert",
"@com_github_stretchr_testify//require",
Expand Down
8 changes: 8 additions & 0 deletions internal/constellation/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "constellation",
srcs = ["constellation.go"],
importpath = "github.com/edgelesssys/constellation/v2/internal/constellation",
visibility = ["//:__subpackages__"],
)
8 changes: 4 additions & 4 deletions internal/helm/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -455,10 +455,8 @@ go_library(
"charts/cilium/templates/spire/server/statefulset.yaml",
],
importpath = "github.com/edgelesssys/constellation/v2/internal/helm",
visibility = ["//cli:__subpackages__"],
visibility = ["//:__subpackages__"],
deps = [
"//cli/internal/helm/imageversion",
"//cli/internal/state",
"//internal/cloud/azureshared",
"//internal/cloud/cloudprovider",
"//internal/cloud/gcpshared",
Expand All @@ -467,10 +465,12 @@ go_library(
"//internal/config",
"//internal/constants",
"//internal/file",
"//internal/helm/imageversion",
"//internal/kms/uri",
"//internal/kubernetes/kubectl",
"//internal/retry",
"//internal/semver",
"//internal/state",
"//internal/versions",
"@com_github_pkg_errors//:errors",
"@io_k8s_client_go//util/retry",
Expand All @@ -495,7 +495,6 @@ go_test(
data = glob(["testdata/**"]),
embed = [":helm"],
deps = [
"//cli/internal/state",
"//internal/attestation/measurements",
"//internal/cloud/azureshared",
"//internal/cloud/cloudprovider",
Expand All @@ -505,6 +504,7 @@ go_test(
"//internal/kms/uri",
"//internal/logger",
"//internal/semver",
"//internal/state",
"@com_github_pkg_errors//:errors",
"@com_github_stretchr_testify//assert",
"@com_github_stretchr_testify//mock",
Expand Down
7 changes: 3 additions & 4 deletions internal/helm/charts/cilium/files/nodeinit/poststart-eni.bash
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ set -o nounset
# dependencies on anything that is part of the startup script
# itself, and can be safely run multiple times per node (e.g. in
# case of a restart).
if [[ "$(iptables-save | grep -c AWS-SNAT-CHAIN)" != "0" ]];
then
echo 'Deleting iptables rules created by the AWS CNI VPC plugin'
iptables-save | grep -v AWS-SNAT-CHAIN | iptables-restore
if [[ "$(iptables-save | grep -c AWS-SNAT-CHAIN)" != "0" ]]; then
echo 'Deleting iptables rules created by the AWS CNI VPC plugin'
iptables-save | grep -v AWS-SNAT-CHAIN | iptables-restore
fi
echo 'Done!'
4 changes: 2 additions & 2 deletions internal/helm/imageversion/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ go_library(
name = "imageversion",
srcs = ["imageversion.go"] + GENERATED_SRCS, # keep
importpath = "github.com/edgelesssys/constellation/v2/internal/helm/imageversion",
visibility = ["//cli:__subpackages__"],
visibility = ["//:__subpackages__"],
deps = ["//internal/containerimage"],
)

Expand All @@ -25,7 +25,7 @@ go_library(
oci = container["oci"],
package = "imageversion",
repotag_file = container["repotag_file"],
visibility = ["//cli:__subpackages__"],
visibility = ["//:__subpackages__"],
)
for container in helm_containers()
]
Expand Down
2 changes: 1 addition & 1 deletion internal/helm/update-aws-load-balancer-chart.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

# updates the Helm charts for the AWS Load Balancer Controller in the CLI.
# script is mostly copied from cli/internal/helm/update-csi-charts.sh
# script is mostly copied from internal/helm/update-csi-charts.sh

set -euo pipefail
set -o errtrace
Expand Down
Loading

0 comments on commit fa02ef3

Please sign in to comment.