From ea1b3c336727f6f7af89afb903afaeaab0511244 Mon Sep 17 00:00:00 2001 From: Tedi Mitiku Date: Mon, 7 Oct 2024 21:07:50 +0900 Subject: [PATCH 01/13] finish override --- kontrol-service/api/server.go | 14 +++++++++-- kontrol-service/engine/docker.go | 31 ++++++++++++++++++++++++- kontrol-service/go.mod | 2 ++ kontrol-service/go.sum | 2 -- kontrol-service/types/flow_spec/spec.go | 6 +++-- 5 files changed, 48 insertions(+), 7 deletions(-) diff --git a/kontrol-service/api/server.go b/kontrol-service/api/server.go index 3783e6f..9de868e 100644 --- a/kontrol-service/api/server.go +++ b/kontrol-service/api/server.go @@ -189,9 +189,19 @@ func (sv *Server) PostTenantUuidFlowCreate(_ context.Context, request api.PostTe patches := []flow_spec.ServicePatchSpec{} for _, serviceUpdate := range serviceUpdates { + envVarOverrides := map[string]string{} + if serviceUpdate.EnvVarOverrides != nil { + envVarOverrides = *serviceUpdate.EnvVarOverrides + } + secretEnvVarOverrides := map[string]string{} + if serviceUpdate.SecretEnvVarOverrides != nil { + secretEnvVarOverrides = *serviceUpdate.SecretEnvVarOverrides + } patch := flow_spec.ServicePatchSpec{ - Service: serviceUpdate.ServiceName, - Image: serviceUpdate.ImageLocator, + Service: serviceUpdate.ServiceName, + Image: serviceUpdate.ImageLocator, + SecretEnvVarOverrides: envVarOverrides, + EnvVarOverrides: secretEnvVarOverrides, } logrus.Infof("starting new dev flow for service %v on image %v", patch.Service, patch.Image) patches = append(patches, patch) diff --git a/kontrol-service/engine/docker.go b/kontrol-service/engine/docker.go index d35ae61..c84cca6 100644 --- a/kontrol-service/engine/docker.go +++ b/kontrol-service/engine/docker.go @@ -6,7 +6,6 @@ import ( "github.com/kurtosis-tech/stacktrace" "github.com/sirupsen/logrus" "gopkg.in/yaml.v2" - corev1 "k8s.io/api/core/v1" net "k8s.io/api/networking/v1" gateway "sigs.k8s.io/gateway-api/apis/v1" @@ -51,6 +50,36 @@ func GenerateProdDevCluster(baseClusterTopologyMaybeWithTemplateOverrides *resol // TODO: find a better way to update deploymentSpec, this assumes there is only container in the pod deploymentSpec.Template.Spec.Containers[0].Image = item.Image + // merge environment variables and env var overrides + envVarOverrides := map[string]corev1.EnvVar{} + for k, v := range item.EnvVarOverrides { + envVarOverrides[k] = corev1.EnvVar{ + Name: k, + Value: v, + ValueFrom: nil, + } + } + for k, v := range item.SecretEnvVarOverrides { + envVarOverrides[k] = corev1.EnvVar{ + Name: k, + ValueFrom: &corev1.EnvVarSource{ + SecretKeyRef: &corev1.SecretKeySelector{ + LocalObjectReference: corev1.LocalObjectReference{Name: v}, // assume v is the secret name + Key: k, + Optional: nil, + }, + }, + } + } + envVars := []corev1.EnvVar{} + for _, envVar := range deploymentSpec.Template.Spec.Containers[0].Env { + if override, ok := envVarOverrides[envVar.Name]; ok { + envVars = append(envVars, override) + } else { + envVars = append(envVars, envVar) + } + } + patches = append(patches, flow_spec.ServicePatch{ Service: devServiceName, DeploymentSpec: deploymentSpec, diff --git a/kontrol-service/go.mod b/kontrol-service/go.mod index 2053b88..5306bce 100644 --- a/kontrol-service/go.mod +++ b/kontrol-service/go.mod @@ -4,6 +4,8 @@ go 1.22.0 toolchain go1.22.3 +replace github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api => ../../kardinal/libs/cli-kontrol-api + require ( github.com/DATA-DOG/go-sqlmock v1.5.2 github.com/dominikbraun/graph v0.23.0 diff --git a/kontrol-service/go.sum b/kontrol-service/go.sum index 7070f7d..92b7aa3 100644 --- a/kontrol-service/go.sum +++ b/kontrol-service/go.sum @@ -77,8 +77,6 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api v0.0.0-20240930151959-22270454aa6b h1:pJlgnXZCdSVl1ts0gDagES1TRWXzA/WOrKjl0SCSES0= -github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api v0.0.0-20240930151959-22270454aa6b/go.mod h1:dQ+ZYcpSrex3FlfyYAvGuhIFHim+oJuJvslNp8rwuFo= github.com/kurtosis-tech/kardinal/libs/manager-kontrol-api v0.0.0-20240926004715-b5a991623aeb h1:rMT8EvgX+dFL0Aq2Ea1lBeIFxCPHPDSF59FktBnKhRs= github.com/kurtosis-tech/kardinal/libs/manager-kontrol-api v0.0.0-20240926004715-b5a991623aeb/go.mod h1:uUIEjxgSYw58hJgD1AwGOBE3LGPwLDiYtNmLGmnO8vI= github.com/kurtosis-tech/stacktrace v0.0.0-20211028211901-1c67a77b5409 h1:YQTATifMUwZEtZYb0LVA7DK2pj8s71iY8rzweuUQ5+g= diff --git a/kontrol-service/types/flow_spec/spec.go b/kontrol-service/types/flow_spec/spec.go index ef7ebb8..ec98657 100644 --- a/kontrol-service/types/flow_spec/spec.go +++ b/kontrol-service/types/flow_spec/spec.go @@ -6,6 +6,8 @@ type FlowPatchSpec struct { } type ServicePatchSpec struct { - Service string - Image string + Service string + Image string + EnvVarOverrides map[string]string + SecretEnvVarOverrides map[string]string } From cd23c4615171877b780fecdcd21f0d79b311ad4c Mon Sep 17 00:00:00 2001 From: Tedi Mitiku Date: Tue, 8 Oct 2024 01:04:27 +0900 Subject: [PATCH 02/13] refactor apply env var overrides --- kontrol-service/api/server.go | 6 ++- kontrol-service/engine/docker.go | 76 +++++++++++++++++++------------- kontrol-service/main.go | 36 ++++++++------- 3 files changed, 69 insertions(+), 49 deletions(-) diff --git a/kontrol-service/api/server.go b/kontrol-service/api/server.go index 9de868e..dc81796 100644 --- a/kontrol-service/api/server.go +++ b/kontrol-service/api/server.go @@ -192,16 +192,18 @@ func (sv *Server) PostTenantUuidFlowCreate(_ context.Context, request api.PostTe envVarOverrides := map[string]string{} if serviceUpdate.EnvVarOverrides != nil { envVarOverrides = *serviceUpdate.EnvVarOverrides + logrus.Infof("ENV VAR OVERRIDES: %v", envVarOverrides) } secretEnvVarOverrides := map[string]string{} if serviceUpdate.SecretEnvVarOverrides != nil { secretEnvVarOverrides = *serviceUpdate.SecretEnvVarOverrides + logrus.Infof("SECRET ENV VAR OVERRIDES: %v", secretEnvVarOverrides) } patch := flow_spec.ServicePatchSpec{ Service: serviceUpdate.ServiceName, Image: serviceUpdate.ImageLocator, - SecretEnvVarOverrides: envVarOverrides, - EnvVarOverrides: secretEnvVarOverrides, + EnvVarOverrides: envVarOverrides, + SecretEnvVarOverrides: secretEnvVarOverrides, } logrus.Infof("starting new dev flow for service %v on image %v", patch.Service, patch.Image) patches = append(patches, patch) diff --git a/kontrol-service/engine/docker.go b/kontrol-service/engine/docker.go index c84cca6..052faf5 100644 --- a/kontrol-service/engine/docker.go +++ b/kontrol-service/engine/docker.go @@ -36,6 +36,7 @@ func GenerateProdOnlyCluster( func GenerateProdDevCluster(baseClusterTopologyMaybeWithTemplateOverrides *resolved.ClusterTopology, baseTopology *resolved.ClusterTopology, pluginRunner *plugins.PluginRunner, flowSpec flow_spec.FlowPatchSpec) (*resolved.ClusterTopology, error) { patches := []flow_spec.ServicePatch{} for _, item := range flowSpec.ServicePatches { + logrus.Infof("ITEM: %v", item) devServiceName := item.Service devService, err := baseClusterTopologyMaybeWithTemplateOverrides.GetService(devServiceName) if err != nil { @@ -49,36 +50,7 @@ func GenerateProdDevCluster(baseClusterTopologyMaybeWithTemplateOverrides *resol // TODO: find a better way to update deploymentSpec, this assumes there is only container in the pod deploymentSpec.Template.Spec.Containers[0].Image = item.Image - - // merge environment variables and env var overrides - envVarOverrides := map[string]corev1.EnvVar{} - for k, v := range item.EnvVarOverrides { - envVarOverrides[k] = corev1.EnvVar{ - Name: k, - Value: v, - ValueFrom: nil, - } - } - for k, v := range item.SecretEnvVarOverrides { - envVarOverrides[k] = corev1.EnvVar{ - Name: k, - ValueFrom: &corev1.EnvVarSource{ - SecretKeyRef: &corev1.SecretKeySelector{ - LocalObjectReference: corev1.LocalObjectReference{Name: v}, // assume v is the secret name - Key: k, - Optional: nil, - }, - }, - } - } - envVars := []corev1.EnvVar{} - for _, envVar := range deploymentSpec.Template.Spec.Containers[0].Env { - if override, ok := envVarOverrides[envVar.Name]; ok { - envVars = append(envVars, override) - } else { - envVars = append(envVars, envVar) - } - } + deploymentSpec.Template.Spec.Containers[0].Env = applyEnvVarOverrides(item.EnvVarOverrides, item.SecretEnvVarOverrides, deploymentSpec.Template.Spec.Containers[0].Env) patches = append(patches, flow_spec.ServicePatch{ Service: devServiceName, @@ -99,6 +71,50 @@ func GenerateProdDevCluster(baseClusterTopologyMaybeWithTemplateOverrides *resol return clusterTopology, nil } +func applyEnvVarOverrides( + envVarOverrides map[string]string, + secretEnvVarOverrides map[string]string, + envVars []corev1.EnvVar) []corev1.EnvVar { + // merge environment variables and env var overrides + translatedOverrides := map[string]corev1.EnvVar{} + for k, v := range envVarOverrides { + translatedOverrides[k] = corev1.EnvVar{ + Name: k, + Value: v, + ValueFrom: nil, + } + } + + for k, v := range secretEnvVarOverrides { + translatedOverrides[k] = corev1.EnvVar{ + Name: k, + ValueFrom: &corev1.EnvVarSource{ + SecretKeyRef: &corev1.SecretKeySelector{ + LocalObjectReference: corev1.LocalObjectReference{Name: v}, // assume v is the secret name + Key: k, + Optional: nil, + }, + }, + } + } + + newEnvVars := []corev1.EnvVar{} + for _, envVar := range envVars { + if override, ok := translatedOverrides[envVar.Name]; ok { + newEnvVars = append(newEnvVars, override) + delete(translatedOverrides, envVar.Name) + } else { + newEnvVars = append(newEnvVars, envVar) + } + } + + for _, envVar := range translatedOverrides { + newEnvVars = append(newEnvVars, envVar) + } + + return newEnvVars +} + func generateClusterTopology( serviceConfigs []apitypes.ServiceConfig, ingressConfigs []apitypes.IngressConfig, diff --git a/kontrol-service/main.go b/kontrol-service/main.go index 87f11df..77eb80c 100644 --- a/kontrol-service/main.go +++ b/kontrol-service/main.go @@ -2,17 +2,15 @@ package main import ( "flag" - "net/http" - "os" - "runtime/debug" - "strconv" - cli_api "github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api/api/golang/server" "github.com/labstack/echo/v4" "github.com/labstack/echo/v4/middleware" "github.com/sirupsen/logrus" "kardinal.kontrol-service/api" "kardinal.kontrol-service/database" + "net/http" + "os" + "runtime/debug" ) func main() { @@ -36,23 +34,27 @@ func main() { } func startServer(isDevMode bool) { - dbHostname := os.Getenv("DB_HOSTNAME") - dbUsername := os.Getenv("DB_USERNAME") - dbPassword := os.Getenv("DB_PASSWORD") - dbName := os.Getenv("DB_NAME") - if dbHostname == "" || dbUsername == "" || dbPassword == "" || dbName == "" { - logrus.Fatal("One of the following environment variables is not set: DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_NAME") - } - dbPort, err := strconv.Atoi(os.Getenv("DB_PORT")) - if err != nil { - logrus.Fatal("An error occurred parsing the DB port number", err) - } + //dbHostname := os.Getenv("DB_HOSTNAME") + dbHostname := "localhost" + //dbUsername := os.Getenv("DB_USERNAME") + dbUsername := "postgres" + //dbPassword := os.Getenv("DB_PASSWORD") + dbPassword := "MyPassword1!" + //dbName := os.Getenv("DB_NAME") + //if dbHostname == "" || dbUsername == "" || dbPassword == "" || dbName == "" { + // logrus.Fatal("One of the following environment variables is not set: DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_NAME") + //} + dbName := "postgres" + //dbPort, err := strconv.Atoi(os.Getenv("DB_PORT")) + //if err != nil { + // logrus.Fatal("An error occurred parsing the DB port number", err) + //} dbConnectionInfo, err := database.NewDatabaseConnectionInfo( dbUsername, dbPassword, dbHostname, - uint16(dbPort), + uint16(51940), dbName, ) if err != nil { From b63cbcd1242a6527e3fd718dfc96a70c69f0a23c Mon Sep 17 00:00:00 2001 From: Tedi Mitiku Date: Tue, 8 Oct 2024 01:11:15 +0900 Subject: [PATCH 03/13] remove logs --- kontrol-service/engine/docker.go | 1 - 1 file changed, 1 deletion(-) diff --git a/kontrol-service/engine/docker.go b/kontrol-service/engine/docker.go index 052faf5..e92a97e 100644 --- a/kontrol-service/engine/docker.go +++ b/kontrol-service/engine/docker.go @@ -36,7 +36,6 @@ func GenerateProdOnlyCluster( func GenerateProdDevCluster(baseClusterTopologyMaybeWithTemplateOverrides *resolved.ClusterTopology, baseTopology *resolved.ClusterTopology, pluginRunner *plugins.PluginRunner, flowSpec flow_spec.FlowPatchSpec) (*resolved.ClusterTopology, error) { patches := []flow_spec.ServicePatch{} for _, item := range flowSpec.ServicePatches { - logrus.Infof("ITEM: %v", item) devServiceName := item.Service devService, err := baseClusterTopologyMaybeWithTemplateOverrides.GetService(devServiceName) if err != nil { From 36de2173e83f3a098df09816166782f6c303bfc4 Mon Sep 17 00:00:00 2001 From: Tedi Mitiku Date: Tue, 8 Oct 2024 23:12:57 +0900 Subject: [PATCH 04/13] revert main --- kontrol-service/main.go | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/kontrol-service/main.go b/kontrol-service/main.go index 77eb80c..78ecfc0 100644 --- a/kontrol-service/main.go +++ b/kontrol-service/main.go @@ -11,6 +11,7 @@ import ( "net/http" "os" "runtime/debug" + "strconv" ) func main() { @@ -34,27 +35,23 @@ func main() { } func startServer(isDevMode bool) { - //dbHostname := os.Getenv("DB_HOSTNAME") - dbHostname := "localhost" - //dbUsername := os.Getenv("DB_USERNAME") - dbUsername := "postgres" - //dbPassword := os.Getenv("DB_PASSWORD") - dbPassword := "MyPassword1!" - //dbName := os.Getenv("DB_NAME") - //if dbHostname == "" || dbUsername == "" || dbPassword == "" || dbName == "" { - // logrus.Fatal("One of the following environment variables is not set: DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_NAME") - //} - dbName := "postgres" - //dbPort, err := strconv.Atoi(os.Getenv("DB_PORT")) - //if err != nil { - // logrus.Fatal("An error occurred parsing the DB port number", err) - //} + dbHostname := os.Getenv("DB_HOSTNAME") + dbUsername := os.Getenv("DB_USERNAME") + dbPassword := os.Getenv("DB_PASSWORD") + dbName := os.Getenv("DB_NAME") + if dbHostname == "" || dbUsername == "" || dbPassword == "" || dbName == "" { + logrus.Fatal("One of the following environment variables is not set: DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_NAME") + } + dbPort, err := strconv.Atoi(os.Getenv("DB_PORT")) + if err != nil { + logrus.Fatal("An error occurred parsing the DB port number", err) + } dbConnectionInfo, err := database.NewDatabaseConnectionInfo( dbUsername, dbPassword, dbHostname, - uint16(51940), + uint16(dbPort), dbName, ) if err != nil { From 90b4b4fe4933b466c4f2f43c452d7f05c19679c8 Mon Sep 17 00:00:00 2001 From: Tedi Mitiku Date: Tue, 8 Oct 2024 23:13:38 +0900 Subject: [PATCH 05/13] remove logs --- kontrol-service/api/server.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/kontrol-service/api/server.go b/kontrol-service/api/server.go index dc81796..9f1eb5a 100644 --- a/kontrol-service/api/server.go +++ b/kontrol-service/api/server.go @@ -192,12 +192,10 @@ func (sv *Server) PostTenantUuidFlowCreate(_ context.Context, request api.PostTe envVarOverrides := map[string]string{} if serviceUpdate.EnvVarOverrides != nil { envVarOverrides = *serviceUpdate.EnvVarOverrides - logrus.Infof("ENV VAR OVERRIDES: %v", envVarOverrides) } secretEnvVarOverrides := map[string]string{} if serviceUpdate.SecretEnvVarOverrides != nil { secretEnvVarOverrides = *serviceUpdate.SecretEnvVarOverrides - logrus.Infof("SECRET ENV VAR OVERRIDES: %v", secretEnvVarOverrides) } patch := flow_spec.ServicePatchSpec{ Service: serviceUpdate.ServiceName, From a6e4918eb8124a9c6f90364d0a1d810e8514fe3c Mon Sep 17 00:00:00 2001 From: Tedi Mitiku Date: Mon, 14 Oct 2024 23:36:30 +0900 Subject: [PATCH 06/13] improve env var names --- kontrol-service/engine/docker.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/kontrol-service/engine/docker.go b/kontrol-service/engine/docker.go index ee6b7a4..7d75b41 100644 --- a/kontrol-service/engine/docker.go +++ b/kontrol-service/engine/docker.go @@ -81,21 +81,21 @@ func applyEnvVarOverrides( envVars []corev1.EnvVar) []corev1.EnvVar { // merge environment variables and env var overrides translatedOverrides := map[string]corev1.EnvVar{} - for k, v := range envVarOverrides { - translatedOverrides[k] = corev1.EnvVar{ - Name: k, - Value: v, + for envVarName, envVarVal := range envVarOverrides { + translatedOverrides[envVarName] = corev1.EnvVar{ + Name: envVarName, + Value: envVarVal, ValueFrom: nil, } } - for k, v := range secretEnvVarOverrides { - translatedOverrides[k] = corev1.EnvVar{ - Name: k, + for envVarName, envVarValue := range secretEnvVarOverrides { + translatedOverrides[envVarName] = corev1.EnvVar{ + Name: envVarName, ValueFrom: &corev1.EnvVarSource{ SecretKeyRef: &corev1.SecretKeySelector{ - LocalObjectReference: corev1.LocalObjectReference{Name: v}, // assume v is the secret name - Key: k, + LocalObjectReference: corev1.LocalObjectReference{Name: envVarValue}, // assume v is the secret name + Key: envVarName, Optional: nil, }, }, From 740cdd136c4832efc3470779c0da49d51adfd943 Mon Sep 17 00:00:00 2001 From: Tedi Mitiku Date: Mon, 14 Oct 2024 23:40:35 +0900 Subject: [PATCH 07/13] nix flake update --- flake.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/flake.lock b/flake.lock index ba0e62b..815f3aa 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", "type": "github" }, "original": { @@ -46,11 +46,11 @@ ] }, "locked": { - "lastModified": 1725515722, - "narHash": "sha256-+gljgHaflZhQXtr3WjJrGn8NXv7MruVPAORSufuCFnw=", + "lastModified": 1728509152, + "narHash": "sha256-tQo1rg3TlwgyI8eHnLvZSlQx9d/o2Rb4oF16TfaTOw0=", "owner": "nix-community", "repo": "gomod2nix", - "rev": "1c6fd4e862bf2f249c9114ad625c64c6c29a8a08", + "rev": "d5547e530464c562324f171006fc8f639aa01c9f", "type": "github" }, "original": { @@ -107,11 +107,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1723556749, - "narHash": "sha256-+CHVZnTnIYRLYsARInHYoWkujzcRkLY/gXm3s5bE52o=", + "lastModified": 1726320982, + "narHash": "sha256-RuVXUwcYwaUeks6h3OLrEmg14z9aFXdWppTWPMTwdQw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4a92571f9207810b559c9eac203d1f4d79830073", + "rev": "8f7492cce28977fbf8bd12c72af08b1f6c7c3e49", "type": "github" }, "original": { @@ -123,11 +123,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1725930920, - "narHash": "sha256-RVhD9hnlTT2nJzPHlAqrWqCkA7T6CYrP41IoVRkciZM=", + "lastModified": 1728740863, + "narHash": "sha256-u+rxA79a0lyhG+u+oPBRtTDtzz8kvkc9a6SWSt9ekVc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "44a71ff39c182edaf25a7ace5c9454e7cba2c658", + "rev": "a3f9ad65a0bf298ed5847629a57808b97e6e8077", "type": "github" }, "original": { From 159195810fb1e8886c40af43bc925b220db17b03 Mon Sep 17 00:00:00 2001 From: Tedi Mitiku Date: Fri, 18 Oct 2024 22:42:24 +0900 Subject: [PATCH 08/13] update go mod 2 nix --- kontrol-service/gomod2nix.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/kontrol-service/gomod2nix.toml b/kontrol-service/gomod2nix.toml index 2629785..261a7c9 100644 --- a/kontrol-service/gomod2nix.toml +++ b/kontrol-service/gomod2nix.toml @@ -277,9 +277,6 @@ schema = 3 [mod."github.com/kr/text"] version = "v0.2.0" hash = "sha256-fadcWxZOORv44oak3jTxm6YcITcFxdGt4bpn869HxUE=" - [mod."github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api"] - version = "v0.0.0-20241003172041-a1632d5aecd8" - hash = "sha256-UhlNzM0NsEB3YStUvT6KNWMKsw7bQvvhFSdxiVryG+s=" [mod."github.com/kurtosis-tech/kardinal/libs/manager-kontrol-api"] version = "v0.0.0-20241003172041-a1632d5aecd8" hash = "sha256-jJPe/rGOg0G1D64rOWk303FF3+uYS5vHfs3lOXhR4tQ=" From aca9a865ce581394fed233cdea8579075d5a18e4 Mon Sep 17 00:00:00 2001 From: Tedi Mitiku Date: Fri, 18 Oct 2024 22:45:07 +0900 Subject: [PATCH 09/13] remove replace --- go.work.sum | 2 ++ kontrol-service/go.mod | 6 +----- kontrol-service/go.sum | 2 ++ 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/go.work.sum b/go.work.sum index a613c81..c5633e0 100644 --- a/go.work.sum +++ b/go.work.sum @@ -152,6 +152,8 @@ github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api v0.0.0-20240814135254-a07 github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api v0.0.0-20240814135254-a0724da5a551/go.mod h1:Zlbpg7q5pTUaddoMN9zaraCNvvuD4KJNPPC8WyUF8DI= github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api v0.0.0-20240814140453-975ebac24b93 h1:hijv6grblylZS82qnFei4L3t/60MD0cPVV0XDrHUL9I= github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api v0.0.0-20240814140453-975ebac24b93/go.mod h1:Zlbpg7q5pTUaddoMN9zaraCNvvuD4KJNPPC8WyUF8DI= +github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api v0.0.0-20241003172041-a1632d5aecd8 h1:I/XvDVzAUvSAo586Qy/ioFfnyk8lXIsYGwmyeoE08W0= +github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api v0.0.0-20241003172041-a1632d5aecd8/go.mod h1:dQ+ZYcpSrex3FlfyYAvGuhIFHim+oJuJvslNp8rwuFo= github.com/kurtosis-tech/kardinal/libs/manager-kontrol-api v0.0.0-20240814135254-a0724da5a551 h1:D+ct39Xc/rE4nvgyueIZyc44dFm+Gyp3C9daAjlxjIw= github.com/kurtosis-tech/kardinal/libs/manager-kontrol-api v0.0.0-20240814135254-a0724da5a551/go.mod h1:lj6oLhpXgnc9ZaulV7jysgRaeZUDPK6XiM2TxpcGRqM= github.com/kurtosis-tech/kardinal/libs/manager-kontrol-api v0.0.0-20240814140453-975ebac24b93 h1:s5cXvxg52er5nMCy+9v9wR+4nv+CxHOzXwIf2q2vRA0= diff --git a/kontrol-service/go.mod b/kontrol-service/go.mod index a90d2ad..4e2cc90 100644 --- a/kontrol-service/go.mod +++ b/kontrol-service/go.mod @@ -1,10 +1,6 @@ module kardinal.kontrol-service -go 1.22.0 - -toolchain go1.22.3 - -replace github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api => ../../kardinal/libs/cli-kontrol-api +go 1.22.3 require ( github.com/DATA-DOG/go-sqlmock v1.5.2 diff --git a/kontrol-service/go.sum b/kontrol-service/go.sum index 8ea1bb9..8473ae3 100644 --- a/kontrol-service/go.sum +++ b/kontrol-service/go.sum @@ -77,6 +77,8 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api v0.0.0-20241003172041-a1632d5aecd8 h1:I/XvDVzAUvSAo586Qy/ioFfnyk8lXIsYGwmyeoE08W0= +github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api v0.0.0-20241003172041-a1632d5aecd8/go.mod h1:dQ+ZYcpSrex3FlfyYAvGuhIFHim+oJuJvslNp8rwuFo= github.com/kurtosis-tech/kardinal/libs/manager-kontrol-api v0.0.0-20241003172041-a1632d5aecd8 h1:+7d/CazuTvkgdY+ppb+vEjvvq0Un0qbUYfnlt3atAKo= github.com/kurtosis-tech/kardinal/libs/manager-kontrol-api v0.0.0-20241003172041-a1632d5aecd8/go.mod h1:uUIEjxgSYw58hJgD1AwGOBE3LGPwLDiYtNmLGmnO8vI= github.com/kurtosis-tech/stacktrace v0.0.0-20211028211901-1c67a77b5409 h1:YQTATifMUwZEtZYb0LVA7DK2pj8s71iY8rzweuUQ5+g= From 5fbf13a2ffa80b29f9ffa0ec0adbf268c8136be1 Mon Sep 17 00:00:00 2001 From: Tedi Mitiku Date: Fri, 18 Oct 2024 22:45:19 +0900 Subject: [PATCH 10/13] update go mod 2 nix --- kontrol-service/gomod2nix.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kontrol-service/gomod2nix.toml b/kontrol-service/gomod2nix.toml index 261a7c9..2629785 100644 --- a/kontrol-service/gomod2nix.toml +++ b/kontrol-service/gomod2nix.toml @@ -277,6 +277,9 @@ schema = 3 [mod."github.com/kr/text"] version = "v0.2.0" hash = "sha256-fadcWxZOORv44oak3jTxm6YcITcFxdGt4bpn869HxUE=" + [mod."github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api"] + version = "v0.0.0-20241003172041-a1632d5aecd8" + hash = "sha256-UhlNzM0NsEB3YStUvT6KNWMKsw7bQvvhFSdxiVryG+s=" [mod."github.com/kurtosis-tech/kardinal/libs/manager-kontrol-api"] version = "v0.0.0-20241003172041-a1632d5aecd8" hash = "sha256-jJPe/rGOg0G1D64rOWk303FF3+uYS5vHfs3lOXhR4tQ=" From bc72e25a716aac75b593322bf105dfc4cc4b9027 Mon Sep 17 00:00:00 2001 From: Tedi Mitiku Date: Fri, 18 Oct 2024 22:50:33 +0900 Subject: [PATCH 11/13] update go libraries --- kontrol-service/go.mod | 2 +- kontrol-service/go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/kontrol-service/go.mod b/kontrol-service/go.mod index 4e2cc90..aa2d092 100644 --- a/kontrol-service/go.mod +++ b/kontrol-service/go.mod @@ -5,7 +5,7 @@ go 1.22.3 require ( github.com/DATA-DOG/go-sqlmock v1.5.2 github.com/dominikbraun/graph v0.23.0 - github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api v0.0.0-20241003172041-a1632d5aecd8 + github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api v0.0.0-20241018134849-aa8bf8962ca6 github.com/kurtosis-tech/kardinal/libs/manager-kontrol-api v0.0.0-20241003172041-a1632d5aecd8 github.com/kurtosis-tech/stacktrace v0.0.0-20211028211901-1c67a77b5409 github.com/labstack/echo/v4 v4.12.0 diff --git a/kontrol-service/go.sum b/kontrol-service/go.sum index 8473ae3..a4079cc 100644 --- a/kontrol-service/go.sum +++ b/kontrol-service/go.sum @@ -79,6 +79,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api v0.0.0-20241003172041-a1632d5aecd8 h1:I/XvDVzAUvSAo586Qy/ioFfnyk8lXIsYGwmyeoE08W0= github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api v0.0.0-20241003172041-a1632d5aecd8/go.mod h1:dQ+ZYcpSrex3FlfyYAvGuhIFHim+oJuJvslNp8rwuFo= +github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api v0.0.0-20241018134849-aa8bf8962ca6 h1:YH3jRXRwwO77oqRJWT341Mr10CCk09H6Crobz/mgeTo= +github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api v0.0.0-20241018134849-aa8bf8962ca6/go.mod h1:dQ+ZYcpSrex3FlfyYAvGuhIFHim+oJuJvslNp8rwuFo= github.com/kurtosis-tech/kardinal/libs/manager-kontrol-api v0.0.0-20241003172041-a1632d5aecd8 h1:+7d/CazuTvkgdY+ppb+vEjvvq0Un0qbUYfnlt3atAKo= github.com/kurtosis-tech/kardinal/libs/manager-kontrol-api v0.0.0-20241003172041-a1632d5aecd8/go.mod h1:uUIEjxgSYw58hJgD1AwGOBE3LGPwLDiYtNmLGmnO8vI= github.com/kurtosis-tech/stacktrace v0.0.0-20211028211901-1c67a77b5409 h1:YQTATifMUwZEtZYb0LVA7DK2pj8s71iY8rzweuUQ5+g= From 8ba1c4faf0b3b15bb58a1e2209bd3d6a07601fe1 Mon Sep 17 00:00:00 2001 From: Tedi Mitiku Date: Fri, 18 Oct 2024 23:17:13 +0900 Subject: [PATCH 12/13] update go libraries --- kontrol-service/go.mod | 2 +- kontrol-service/go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/kontrol-service/go.mod b/kontrol-service/go.mod index aa2d092..ebf89b4 100644 --- a/kontrol-service/go.mod +++ b/kontrol-service/go.mod @@ -5,7 +5,7 @@ go 1.22.3 require ( github.com/DATA-DOG/go-sqlmock v1.5.2 github.com/dominikbraun/graph v0.23.0 - github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api v0.0.0-20241018134849-aa8bf8962ca6 + github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api v0.0.0-20241018141142-4fcbab801cec github.com/kurtosis-tech/kardinal/libs/manager-kontrol-api v0.0.0-20241003172041-a1632d5aecd8 github.com/kurtosis-tech/stacktrace v0.0.0-20211028211901-1c67a77b5409 github.com/labstack/echo/v4 v4.12.0 diff --git a/kontrol-service/go.sum b/kontrol-service/go.sum index a4079cc..c6a50a3 100644 --- a/kontrol-service/go.sum +++ b/kontrol-service/go.sum @@ -81,6 +81,8 @@ github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api v0.0.0-20241003172041-a16 github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api v0.0.0-20241003172041-a1632d5aecd8/go.mod h1:dQ+ZYcpSrex3FlfyYAvGuhIFHim+oJuJvslNp8rwuFo= github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api v0.0.0-20241018134849-aa8bf8962ca6 h1:YH3jRXRwwO77oqRJWT341Mr10CCk09H6Crobz/mgeTo= github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api v0.0.0-20241018134849-aa8bf8962ca6/go.mod h1:dQ+ZYcpSrex3FlfyYAvGuhIFHim+oJuJvslNp8rwuFo= +github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api v0.0.0-20241018141142-4fcbab801cec h1:YoOp+25EgKbVrM+CVro9PoGqRidB+BY7Xo6rqGTguZ0= +github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api v0.0.0-20241018141142-4fcbab801cec/go.mod h1:dQ+ZYcpSrex3FlfyYAvGuhIFHim+oJuJvslNp8rwuFo= github.com/kurtosis-tech/kardinal/libs/manager-kontrol-api v0.0.0-20241003172041-a1632d5aecd8 h1:+7d/CazuTvkgdY+ppb+vEjvvq0Un0qbUYfnlt3atAKo= github.com/kurtosis-tech/kardinal/libs/manager-kontrol-api v0.0.0-20241003172041-a1632d5aecd8/go.mod h1:uUIEjxgSYw58hJgD1AwGOBE3LGPwLDiYtNmLGmnO8vI= github.com/kurtosis-tech/stacktrace v0.0.0-20211028211901-1c67a77b5409 h1:YQTATifMUwZEtZYb0LVA7DK2pj8s71iY8rzweuUQ5+g= From d32c1244461916e2da4bd367c52bfc97aca73cd5 Mon Sep 17 00:00:00 2001 From: Tedi Mitiku Date: Fri, 18 Oct 2024 23:19:29 +0900 Subject: [PATCH 13/13] gomod2nix --- kontrol-service/go.sum | 4 ---- kontrol-service/gomod2nix.toml | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/kontrol-service/go.sum b/kontrol-service/go.sum index c6a50a3..09cde54 100644 --- a/kontrol-service/go.sum +++ b/kontrol-service/go.sum @@ -77,10 +77,6 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api v0.0.0-20241003172041-a1632d5aecd8 h1:I/XvDVzAUvSAo586Qy/ioFfnyk8lXIsYGwmyeoE08W0= -github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api v0.0.0-20241003172041-a1632d5aecd8/go.mod h1:dQ+ZYcpSrex3FlfyYAvGuhIFHim+oJuJvslNp8rwuFo= -github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api v0.0.0-20241018134849-aa8bf8962ca6 h1:YH3jRXRwwO77oqRJWT341Mr10CCk09H6Crobz/mgeTo= -github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api v0.0.0-20241018134849-aa8bf8962ca6/go.mod h1:dQ+ZYcpSrex3FlfyYAvGuhIFHim+oJuJvslNp8rwuFo= github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api v0.0.0-20241018141142-4fcbab801cec h1:YoOp+25EgKbVrM+CVro9PoGqRidB+BY7Xo6rqGTguZ0= github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api v0.0.0-20241018141142-4fcbab801cec/go.mod h1:dQ+ZYcpSrex3FlfyYAvGuhIFHim+oJuJvslNp8rwuFo= github.com/kurtosis-tech/kardinal/libs/manager-kontrol-api v0.0.0-20241003172041-a1632d5aecd8 h1:+7d/CazuTvkgdY+ppb+vEjvvq0Un0qbUYfnlt3atAKo= diff --git a/kontrol-service/gomod2nix.toml b/kontrol-service/gomod2nix.toml index 2629785..f7d26c3 100644 --- a/kontrol-service/gomod2nix.toml +++ b/kontrol-service/gomod2nix.toml @@ -278,8 +278,8 @@ schema = 3 version = "v0.2.0" hash = "sha256-fadcWxZOORv44oak3jTxm6YcITcFxdGt4bpn869HxUE=" [mod."github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api"] - version = "v0.0.0-20241003172041-a1632d5aecd8" - hash = "sha256-UhlNzM0NsEB3YStUvT6KNWMKsw7bQvvhFSdxiVryG+s=" + version = "v0.0.0-20241018141142-4fcbab801cec" + hash = "sha256-xTRlIXQhn2n0pmWfjg34Fhb3Fo5cRGUolkiaARa6f14=" [mod."github.com/kurtosis-tech/kardinal/libs/manager-kontrol-api"] version = "v0.0.0-20241003172041-a1632d5aecd8" hash = "sha256-jJPe/rGOg0G1D64rOWk303FF3+uYS5vHfs3lOXhR4tQ="