Skip to content

Commit

Permalink
fix(all): use of tls for datastore
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan-pad committed May 21, 2024
1 parent 523d7d9 commit ab720ac
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 11 deletions.
4 changes: 2 additions & 2 deletions api/v1alpha1/terraformrun_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ type TerraformRunStatus struct {
}

type Attempt struct {
PodName string `json:"podName,omitempty"`
Number int `json:"number,omitempty"`
PodName string `json:"podName"`
Number int `json:"number"`
LogsUploaded bool `json:"logsUploaded,omitempty"`
}

Expand Down
4 changes: 4 additions & 0 deletions deploy/charts/burrito/templates/datastore.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{{ $configChecksum := (include (print $.Template.BasePath "/config.yaml") . | sha256sum) }}

{{- with mergeOverwrite (deepCopy .Values.global) .Values.datastore }}
{{- if .tls.certManager.use }}
{{- $_ := set .deployment.livenessProbe.httpGet "scheme" "HTTPS" }}
{{- $_ := set .deployment.readinessProbe.httpGet "scheme" "HTTPS" }}
{{- end }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down
20 changes: 12 additions & 8 deletions deploy/charts/burrito/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@ hermitcrab:
commonName: burrito-hermitcrab.burrito-system.svc.cluster.local
dnsNames:
- burrito-hermitcrab.burrito-system.svc.cluster.local
- burrito-hermitcrab.burrito-system
- burrito-hermitcrab
issuerRef:
name: burrito-ca-issuer
kind: ClusterIssuer
kind: Issuer

deployment:
image:
Expand Down Expand Up @@ -176,13 +178,13 @@ controllers:
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 15
initialDelaySeconds: 5
periodSeconds: 20
readinessProbe:
httpGet:
path: /readyz
port: 8081
initialDelaySeconds: 15
initialDelaySeconds: 5
periodSeconds: 20
envFrom: []
env: []
Expand All @@ -206,13 +208,13 @@ server:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 15
initialDelaySeconds: 5
periodSeconds: 20
readinessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 15
initialDelaySeconds: 5
periodSeconds: 20
envFrom:
# -- Reference the webhook secret here
Expand Down Expand Up @@ -249,13 +251,13 @@ datastore:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 15
initialDelaySeconds: 5
periodSeconds: 20
readinessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 15
initialDelaySeconds: 5
periodSeconds: 20
envFrom: []
service:
Expand All @@ -275,8 +277,10 @@ datastore:
commonName: burrito-datastore.burrito-system.svc.cluster.local
dnsNames:
- burrito-datastore.burrito-system.svc.cluster.local
- burrito-datastore.burrito-system
- burrito-datastore
issuerRef:
name: burrito-ca-issuer
kind: ClusterIssuer
kind: Issuer

tenants: []
1 change: 1 addition & 0 deletions internal/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ type TerraformExec interface {
func New(c *config.Config) *Runner {
client := datastore.NewDefaultClient()
if c.Datastore.TLS {
log.Info("using TLS for datastore")
client.Scheme = "https"
}
return &Runner{
Expand Down
6 changes: 5 additions & 1 deletion internal/server/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ type API struct {
}

func New(c *config.Config) *API {
client := datastore.NewDefaultClient()
if c.Datastore.TLS {
client.Scheme = "https"
}
return &API{
config: c,
Datastore: datastore.NewDefaultClient(),
Datastore: client,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ spec:
type: integer
podName:
type: string
required:
- number
- podName
type: object
type: array
conditions:
Expand Down
3 changes: 3 additions & 0 deletions manifests/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4240,6 +4240,9 @@ spec:
type: integer
podName:
type: string
required:
- number
- podName
type: object
type: array
conditions:
Expand Down

0 comments on commit ab720ac

Please sign in to comment.