diff --git a/api/v1/testkube.yaml b/api/v1/testkube.yaml index cdc55d37b34..3ef9953bce0 100644 --- a/api/v1/testkube.yaml +++ b/api/v1/testkube.yaml @@ -4091,6 +4091,10 @@ components: type: string description: cloud env id example: "tkcenv_xxxx" + helmchartVersion: + type: string + description: helm chart version + example: "1.4.14" Repository: description: repository representation for tests in git repositories diff --git a/cmd/api-server/main.go b/cmd/api-server/main.go index 75f8e3f39dc..af3b784e28e 100644 --- a/cmd/api-server/main.go +++ b/cmd/api-server/main.go @@ -396,6 +396,7 @@ func main() { artifactStorage, cfg.CDEventsTarget, cfg.TestkubeDashboardURI, + cfg.TestkubeHelmchartVersion, ) if mode == common.ModeAgent { diff --git a/internal/app/api/v1/handlers.go b/internal/app/api/v1/handlers.go index 94a6b9f2b4b..e2bf99af394 100644 --- a/internal/app/api/v1/handlers.go +++ b/internal/app/api/v1/handlers.go @@ -63,12 +63,13 @@ func (s *TestkubeAPI) InfoHandler() fiber.Handler { } return func(c *fiber.Ctx) error { return c.JSON(testkube.ServerInfo{ - Commit: version.Commit, - Version: version.Version, - Namespace: s.Namespace, - Context: apiContext, - EnvId: os.Getenv(cloudEnvIdEnvName), - OrgId: os.Getenv(cloudOrgIdEnvName), + Commit: version.Commit, + Version: version.Version, + Namespace: s.Namespace, + Context: apiContext, + EnvId: os.Getenv(cloudEnvIdEnvName), + OrgId: os.Getenv(cloudOrgIdEnvName), + HelmchartVersion: s.helmchartVersion, }) } } diff --git a/internal/app/api/v1/server.go b/internal/app/api/v1/server.go index facf754e967..c56cfbf4eed 100644 --- a/internal/app/api/v1/server.go +++ b/internal/app/api/v1/server.go @@ -81,6 +81,7 @@ func NewTestkubeAPI( artifactsStorage storage.ArtifactsStorage, cdeventsTarget string, dashboardURI string, + helmchartVersion string, ) TestkubeAPI { var httpConfig server.Config @@ -120,6 +121,7 @@ func NewTestkubeAPI( Storage: storage, graphqlPort: graphqlPort, artifactsStorage: artifactsStorage, + helmchartVersion: helmchartVersion, } // will be reused in websockets handler @@ -171,6 +173,7 @@ type TestkubeAPI struct { slackLoader *slack.SlackLoader graphqlPort string artifactsStorage storage.ArtifactsStorage + helmchartVersion string } type storageParams struct { diff --git a/internal/config/config.go b/internal/config/config.go index 999649a2a9b..7f5c32fafd4 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -63,6 +63,7 @@ type Config struct { DisableReconciler bool `envconfig:"DISABLE_RECONCILER" default:"false"` TestkubeClusterName string `envconfig:"TESTKUBE_CLUSTER_NAME" default:""` CompressArtifacts bool `envconfig:"COMPRESSARTIFACTS" default:"false"` + TestkubeHelmchartVersion string `envconfig:"TESTKUBE_HELMCHART_VERSION" default:""` } func Get() (*Config, error) { diff --git a/pkg/api/v1/testkube/model_server_info.go b/pkg/api/v1/testkube/model_server_info.go index 072acba118a..a29ce4fb795 100644 --- a/pkg/api/v1/testkube/model_server_info.go +++ b/pkg/api/v1/testkube/model_server_info.go @@ -23,4 +23,6 @@ type ServerInfo struct { OrgId string `json:"orgId,omitempty"` // cloud env id EnvId string `json:"envId,omitempty"` + // helm chart version + HelmchartVersion string `json:"helmchartVersion,omitempty"` }