Skip to content

Commit

Permalink
ok
Browse files Browse the repository at this point in the history
  • Loading branch information
smonero committed Mar 6, 2024
1 parent 6edbdd0 commit fd7c8ba
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
33 changes: 22 additions & 11 deletions cmd/terraformadmin.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,31 +48,42 @@ func (t *TerraformAdmin) NewServer(userConfig legacy.UserConfig, config legacy.C
SslCertFile: userConfig.SSLCertFile,
SslKeyFile: userConfig.SSLKeyFile,
},
// we need the servercfg stuff, see setAtlantisURL
// we need the servercfg stuff, see setAtlantisURL() TODO: is this true?
ServerCfg: neptune.ServerConfig{
URL: parsedURL,
Version: config.AtlantisVersion,
Port: userConfig.Port,
},
// we need the terraformcfg stuff, since we need terraformActivities
TerraformCfg: neptune.TerraformConfig{
DefaultVersion: userConfig.DefaultTFVersion,
DownloadURL: userConfig.TFDownloadURL,
LogFilters: globalCfg.TerraformLogFilter,
},
// also passed to terraform activities, even though we don't need conf test OPA stuff
// TODO: But we have to introduce branching if we remove this...
ValidationConfig: neptune.ValidationConfig{
DefaultVersion: globalCfg.PolicySets.Version,
Policies: globalCfg.PolicySets,
},
DeploymentConfig: globalCfg.PersistenceConfig.Deployments,
DataDir: userConfig.DataDir,
TemporalCfg: globalCfg.Temporal,
GithubCfg: globalCfg.Github,
App: appConfig,
CtxLogger: ctxLogger,
StatsNamespace: userConfig.StatsNamespace,
Metrics: globalCfg.Metrics,
LyftAuditJobsSnsTopicArn: userConfig.LyftAuditJobsSnsTopicArn,
RevisionSetter: globalCfg.RevisionSetter,

// Do not need deployment config
// do need datadir, we will save the archive there
DataDir: userConfig.DataDir,
// do need temporalconfig since we use temporal
TemporalCfg: globalCfg.Temporal,
// do need githubcfg, since we use github to get the archive
GithubCfg: globalCfg.Github,
// same as above
App: appConfig,
// we do need logging
CtxLogger: ctxLogger,
// we do need stats
StatsNamespace: userConfig.StatsNamespace,
// we do need metrics
Metrics: globalCfg.Metrics,
// no SnsTopicArn since we don't use the auditing
// no revision setter
}
return terraformadmin.NewServer(cfg)
}
5 changes: 5 additions & 0 deletions server/neptune/terraformadmin/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@ func (s Server) shutdown() {

// TODO: add deployWorker if we need it

// Note that we will need to do things similar to how gateway does it to get the metadata we need
// specifically the root

func (s Server) buildTerraformWorker() worker.Worker {
// pass the underlying client otherwise this will panic()
terraformWorker := worker.New(s.TemporalClient.Client, s.TerraformTaskQueue, worker.Options{
Expand All @@ -264,6 +267,8 @@ func (s Server) buildTerraformWorker() worker.Worker {
return terraformWorker
}

// TODO: eventually we can make it so the pod is ready when the repo is done cloning...

// Healthz returns the health check response. It always returns a 200 currently.
func Healthz(w http.ResponseWriter, _ *http.Request) {
data, err := json.MarshalIndent(&struct {
Expand Down

0 comments on commit fd7c8ba

Please sign in to comment.