Skip to content

Commit

Permalink
Remove duplicated resources partial template
Browse files Browse the repository at this point in the history
Signed-off-by: ihcsim <ihcsim@gmail.com>
  • Loading branch information
ihcsim committed Jul 26, 2019
1 parent 824ccf9 commit 430a5d5
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 30 deletions.
4 changes: 2 additions & 2 deletions charts/linkerd/templates/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ spec:
path: /ready
port: 9995
{{- if eq .HighAvailability true -}}
{{- include "linkerd.resources" .PublicAPIResources | nindent 8 }}
{{- include "partials.resources" .PublicAPIResources | nindent 8 }}
{{- end }}
securityContext:
runAsUser: {{.ControllerUID}}
Expand Down Expand Up @@ -136,7 +136,7 @@ spec:
path: /ready
port: 9996
{{- if eq .HighAvailability true -}}
{{- include "linkerd.resources" .DestinationResources | nindent 8 }}
{{- include "partials.resources" .DestinationResources | nindent 8 }}
{{- end }}
securityContext:
runAsUser: {{.ControllerUID}}
Expand Down
2 changes: 1 addition & 1 deletion charts/linkerd/templates/grafana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ spec:
path: /api/health
port: 3000
{{- if eq .HighAvailability true -}}
{{- include "linkerd.resources" .GrafanaResources | nindent 8 }}
{{- include "partials.resources" .GrafanaResources | nindent 8 }}
{{- end }}
securityContext:
runAsUser: 472
Expand Down
2 changes: 1 addition & 1 deletion charts/linkerd/templates/heartbeat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ spec:
- "-controller-namespace={{.Namespace}}"
- "-log-level={{.ControllerLogLevel}}"
{{- if eq .HighAvailability true -}}
{{- include "linkerd.resources" .HeartbeatResources | nindent 12 }}
{{- include "partials.resources" .HeartbeatResources | nindent 12 }}
{{- end -}}
securityContext:
runAsUser: {{.ControllerUID}}
Expand Down
2 changes: 1 addition & 1 deletion charts/partials/templates/_proxy-init.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
image: {{.Image.Name}}:{{.Image.Version}}
imagePullPolicy: {{.Image.PullPolicy}}
name: linkerd-init
{{- include "partials.resource" .ResourceRequirements | nindent 2 }}
{{- include "partials.resources" .ResourceRequirements | nindent 2 }}
securityContext:
allowPrivilegeEscalation: false
capabilities:
Expand Down
2 changes: 1 addition & 1 deletion charts/partials/templates/_proxy.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
port: {{.Port.Admin}}
initialDelaySeconds: 2
{{- if eq .HighAvailability true -}}
{{- include "partials.resource" .ResourceRequirements | nindent 2 -}}
{{- include "partials.resources" .ResourceRequirements | nindent 2 -}}
{{- end }}
securityContext:
allowPrivilegeEscalation: false
Expand Down
21 changes: 0 additions & 21 deletions charts/partials/templates/_resource.tpl

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{{/* Specify resource requests and limits for workloads */}}
{{- define "linkerd.resources" -}}
{{- define "partials.resources" -}}
resources:
{{- if or .CPU.Limit .Memory.Limit }}
limits:
Expand All @@ -19,4 +18,4 @@ resources:
memory: {{.}}
{{- end }}
{{- end }}
{{- end -}}
{{- end }}

0 comments on commit 430a5d5

Please sign in to comment.