Skip to content

Commit

Permalink
feat: helm chart version (#4215)
Browse files Browse the repository at this point in the history
  • Loading branch information
vsukhin authored Jul 27, 2023
1 parent 77a29b1 commit 9192853
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
4 changes: 4 additions & 0 deletions api/v1/testkube.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions cmd/api-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ func main() {
artifactStorage,
cfg.CDEventsTarget,
cfg.TestkubeDashboardURI,
cfg.TestkubeHelmchartVersion,
)

if mode == common.ModeAgent {
Expand Down
13 changes: 7 additions & 6 deletions internal/app/api/v1/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
}
}
Expand Down
3 changes: 3 additions & 0 deletions internal/app/api/v1/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ func NewTestkubeAPI(
artifactsStorage storage.ArtifactsStorage,
cdeventsTarget string,
dashboardURI string,
helmchartVersion string,
) TestkubeAPI {

var httpConfig server.Config
Expand Down Expand Up @@ -120,6 +121,7 @@ func NewTestkubeAPI(
Storage: storage,
graphqlPort: graphqlPort,
artifactsStorage: artifactsStorage,
helmchartVersion: helmchartVersion,
}

// will be reused in websockets handler
Expand Down Expand Up @@ -171,6 +173,7 @@ type TestkubeAPI struct {
slackLoader *slack.SlackLoader
graphqlPort string
artifactsStorage storage.ArtifactsStorage
helmchartVersion string
}

type storageParams struct {
Expand Down
1 change: 1 addition & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/v1/testkube/model_server_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

0 comments on commit 9192853

Please sign in to comment.