Skip to content

Commit fd7c8ba

Browse files
committed
ok
1 parent 6edbdd0 commit fd7c8ba

File tree

2 files changed

+27
-11
lines changed

2 files changed

+27
-11
lines changed

cmd/terraformadmin.go

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,31 +48,42 @@ func (t *TerraformAdmin) NewServer(userConfig legacy.UserConfig, config legacy.C
4848
SslCertFile: userConfig.SSLCertFile,
4949
SslKeyFile: userConfig.SSLKeyFile,
5050
},
51-
// we need the servercfg stuff, see setAtlantisURL
51+
// we need the servercfg stuff, see setAtlantisURL() TODO: is this true?
5252
ServerCfg: neptune.ServerConfig{
5353
URL: parsedURL,
5454
Version: config.AtlantisVersion,
5555
Port: userConfig.Port,
5656
},
57+
// we need the terraformcfg stuff, since we need terraformActivities
5758
TerraformCfg: neptune.TerraformConfig{
5859
DefaultVersion: userConfig.DefaultTFVersion,
5960
DownloadURL: userConfig.TFDownloadURL,
6061
LogFilters: globalCfg.TerraformLogFilter,
6162
},
63+
// also passed to terraform activities, even though we don't need conf test OPA stuff
64+
// TODO: But we have to introduce branching if we remove this...
6265
ValidationConfig: neptune.ValidationConfig{
6366
DefaultVersion: globalCfg.PolicySets.Version,
6467
Policies: globalCfg.PolicySets,
6568
},
66-
DeploymentConfig: globalCfg.PersistenceConfig.Deployments,
67-
DataDir: userConfig.DataDir,
68-
TemporalCfg: globalCfg.Temporal,
69-
GithubCfg: globalCfg.Github,
70-
App: appConfig,
71-
CtxLogger: ctxLogger,
72-
StatsNamespace: userConfig.StatsNamespace,
73-
Metrics: globalCfg.Metrics,
74-
LyftAuditJobsSnsTopicArn: userConfig.LyftAuditJobsSnsTopicArn,
75-
RevisionSetter: globalCfg.RevisionSetter,
69+
70+
// Do not need deployment config
71+
// do need datadir, we will save the archive there
72+
DataDir: userConfig.DataDir,
73+
// do need temporalconfig since we use temporal
74+
TemporalCfg: globalCfg.Temporal,
75+
// do need githubcfg, since we use github to get the archive
76+
GithubCfg: globalCfg.Github,
77+
// same as above
78+
App: appConfig,
79+
// we do need logging
80+
CtxLogger: ctxLogger,
81+
// we do need stats
82+
StatsNamespace: userConfig.StatsNamespace,
83+
// we do need metrics
84+
Metrics: globalCfg.Metrics,
85+
// no SnsTopicArn since we don't use the auditing
86+
// no revision setter
7687
}
7788
return terraformadmin.NewServer(cfg)
7889
}

server/neptune/terraformadmin/server.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@ func (s Server) shutdown() {
246246

247247
// TODO: add deployWorker if we need it
248248

249+
// Note that we will need to do things similar to how gateway does it to get the metadata we need
250+
// specifically the root
251+
249252
func (s Server) buildTerraformWorker() worker.Worker {
250253
// pass the underlying client otherwise this will panic()
251254
terraformWorker := worker.New(s.TemporalClient.Client, s.TerraformTaskQueue, worker.Options{
@@ -264,6 +267,8 @@ func (s Server) buildTerraformWorker() worker.Worker {
264267
return terraformWorker
265268
}
266269

270+
// TODO: eventually we can make it so the pod is ready when the repo is done cloning...
271+
267272
// Healthz returns the health check response. It always returns a 200 currently.
268273
func Healthz(w http.ResponseWriter, _ *http.Request) {
269274
data, err := json.MarshalIndent(&struct {

0 commit comments

Comments
 (0)