Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test/ and soak/ builds #4

Merged
merged 3 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/scripts/build-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e

oldPWD="$(pwd)"

dirs=("./scripts/soak" "./test")
dirs=("./scripts/soak" "./test" "./cmd/dartboard")

for dir in "${dirs[@]}"; do
echo "Building $dir"
Expand Down
14 changes: 7 additions & 7 deletions cmd/dartboard/subcommands/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func Deploy(cli *cli.Context) error {
}

func chartInstall(kubeConf string, chart chart, jsonVals string) error {
var vals map[string]interface{} = nil
var vals map[string]interface{}
var err error

name := chart.name
Expand Down Expand Up @@ -516,7 +516,7 @@ func importDownstreamClusterDo(r *dart.Dart, rancherImageTag string, tf *tofu.To
defer os.Remove(yamlFile.Name())
defer yamlFile.Close()

clusterId, err := importClustersDownstreamGetYAML(clusters, clusterName, yamlFile)
clusterID, err := importClustersDownstreamGetYAML(clusters, clusterName, yamlFile)
if err != nil {
errCh <- fmt.Errorf("%s import failed: %w", clusterName, err)
return
Expand All @@ -542,7 +542,7 @@ func importDownstreamClusterDo(r *dart.Dart, rancherImageTag string, tf *tofu.To
}

if err := kubectl.WaitForReadyCondition(clusters["upstream"].Kubeconfig,
"clusters.management.cattle.io", clusterId, "", 10); err != nil {
"clusters.management.cattle.io", clusterID, "", 10); err != nil {
errCh <- fmt.Errorf("%s import failed: %w", clusterName, err)
return
}
Expand Down Expand Up @@ -594,7 +594,7 @@ func importDownstreamClustersRancherSetup(r *dart.Dart, clusters map[string]tofu
return nil
}

func importClustersDownstreamGetYAML(clusters map[string]tofu.Cluster, name string, yamlFile *os.File) (clusterId string, err error) {
func importClustersDownstreamGetYAML(clusters map[string]tofu.Cluster, name string, yamlFile *os.File) (clusterID string, err error) {
var status map[string]interface{}

upstream := clusters["upstream"]
Expand All @@ -612,14 +612,14 @@ func importClustersDownstreamGetYAML(clusters map[string]tofu.Cluster, name stri
if status, err = cliUpstream.GetStatus("provisioning.cattle.io", "v1", resource, name, namespace); err != nil {
return
}
clusterId, ok := status["clusterName"].(string)
clusterID, ok := status["clusterName"].(string)
if !ok {
err = fmt.Errorf("error accessing %s/%s %s: no valid 'clusterName' in 'Status'", namespace, name, resource)
return
}

name = "default-token"
namespace = clusterId
namespace = clusterID
resource = "clusterregistrationtokens"
if status, err = cliUpstream.GetStatus("management.cattle.io", "v3", resource, name, namespace); err != nil {
return
Expand All @@ -630,7 +630,7 @@ func importClustersDownstreamGetYAML(clusters map[string]tofu.Cluster, name stri
return
}

url := fmt.Sprintf("%s/v3/import/%s_%s.yaml", upstreamAdd.Local.HTTPSURL, token, clusterId)
url := fmt.Sprintf("%s/v3/import/%s_%s.yaml", upstreamAdd.Local.HTTPSURL, token, clusterID)
tr := &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true}}
client := &http.Client{Transport: tr}
resp, err := client.Get(url)
Expand Down
20 changes: 14 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,22 @@ toolchain go1.22.5
// replace shepherd with experimental version
replace github.com/rancher/shepherd => github.com/git-ival/shepherd v0.0.0-20240412200641-444750a22637

// replace Kubernetes and core libraries to align with shepherd's
// replace grafana-api-golang-client with experimental version
replace github.com/grafana/grafana-api-golang-client => github.com/git-ival/grafana-api-golang-client v0.26.1-0.20231204163350-5dfef652c1e1

// replace Kubernetes and other core libraries to align with shepherd's
replace (
github.com/containerd/containerd => github.com/containerd/containerd v1.6.27 // for docker 20.10.x compatibility
github.com/docker/docker => github.com/docker/docker v20.10.27+incompatible
github.com/google/cel-go => github.com/google/cel-go v0.12.7
k8s.io/api => k8s.io/api v0.27.9
k8s.io/apimachinery => k8s.io/apimachinery v0.27.9
k8s.io/apiserver => k8s.io/apiserver v0.27.9
k8s.io/cli-runtime => k8s.io/cli-runtime v0.27.9
k8s.io/client-go => github.com/rancher/client-go v1.27.4-rancher1
k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f
k8s.io/kubectl => k8s.io/kubectl v0.27.9
oras.land/oras-go => oras.land/oras-go v1.2.2 // for docker 20.10.x compatibility
sigs.k8s.io/kustomize/api => sigs.k8s.io/kustomize/api v0.13.4
sigs.k8s.io/kustomize/kyaml => sigs.k8s.io/kustomize/kyaml v0.14.2
)
Expand Down Expand Up @@ -60,7 +67,6 @@ require (

// indirect requires
require (
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/BurntSushi/toml v1.3.2 // indirect
github.com/MakeNowJust/heredoc v1.0.0 // indirect
Expand Down Expand Up @@ -161,9 +167,7 @@ require (
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/moby/locker v1.0.1 // indirect
github.com/moby/patternmatcher v0.6.0 // indirect
github.com/moby/spdystream v0.2.0 // indirect
github.com/moby/sys/sequential v0.5.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
Expand Down Expand Up @@ -255,23 +259,27 @@ require (

require (
github.com/NYTimes/gziphandler v1.1.1 // indirect
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df // indirect
github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/containerd/cgroups v1.1.0 // indirect
github.com/go-json-experiment/json v0.0.0-20231102232822-2e55bd4e08b0 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/google/cel-go v0.17.7 // indirect
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/moby/sys/mount v0.2.0 // indirect
github.com/moby/sys/mountinfo v0.6.2 // indirect
github.com/onsi/ginkgo/v2 v2.11.0 // indirect
github.com/onsi/gomega v1.27.10 // indirect
github.com/stoewer/go-strcase v1.2.0 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.45.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0 // indirect
go.opentelemetry.io/otel/sdk v1.19.0 // indirect
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
golang.org/x/exp v0.0.0-20220827204233-334a2380cb91 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
k8s.io/cloud-provider v0.27.9 // indirect
k8s.io/component-helpers v0.27.9 // indirect
Expand Down
Loading