feat: support targetPort option in goctl kube (#2378)
This commit is contained in:
@@ -36,6 +36,7 @@ type Deployment struct {
|
||||
Replicas int
|
||||
Revisions int
|
||||
Port int
|
||||
TargetPort int
|
||||
NodePort int
|
||||
UseNodePort bool
|
||||
RequestCpu int
|
||||
@@ -81,6 +82,10 @@ func deploymentCommand(_ *cobra.Command, _ []string) error {
|
||||
}
|
||||
defer out.Close()
|
||||
|
||||
if varIntTargetPort == 0 {
|
||||
varIntTargetPort = varIntPort
|
||||
}
|
||||
|
||||
t := template.Must(template.New("deploymentTemplate").Parse(text))
|
||||
err = t.Execute(out, Deployment{
|
||||
Name: varStringName,
|
||||
@@ -90,6 +95,7 @@ func deploymentCommand(_ *cobra.Command, _ []string) error {
|
||||
Replicas: varIntReplicas,
|
||||
Revisions: varIntRevisions,
|
||||
Port: varIntPort,
|
||||
TargetPort: varIntTargetPort,
|
||||
NodePort: nodePort,
|
||||
UseNodePort: nodePort > 0,
|
||||
RequestCpu: varIntRequestCpu,
|
||||
|
||||
Reference in New Issue
Block a user