Removed unused variables

Added missing variables to the env output
Added other missing variable constants for templates
This commit is contained in:
gberl002
2022-02-17 11:41:31 -05:00
parent 4f46091672
commit 7eea806448
6 changed files with 7 additions and 23 deletions
@@ -6,6 +6,8 @@
{{ if eq .OS "windows" }}SET{{ else }}export{{ end }} {{ .ZitiCtrlPortVarName }}={{ .Controller.Port }}
{{ if eq .OS "windows" }}Rem {{ else }}# {{ end }}{{ .ZitiEdgeRouterRawNameVarDescription }}
{{ if eq .OS "windows" }}SET{{ else }}export{{ end }} {{ .ZitiEdgeRouterRawNameVarName }}={{ .Router.Edge.Hostname }}
{{ if eq .OS "windows" }}Rem {{ else }}# {{ end }}{{ .ZitiEdgeRouterPortVarDescription }}
{{ if eq .OS "windows" }}SET{{ else }}export{{ end }} {{ .ZitiEdgeRouterPortVarName }}={{ .Router.Edge.Port }}
{{ if eq .OS "windows" }}Rem {{ else }}# {{ end }}{{ .ZitiCtrlListenerAddressVarDescription }}
{{ if eq .OS "windows" }}SET{{ else }}export{{ end }} {{ .ZitiCtrlListenerAddressVarName }}={{ .Controller.ListenerAddress }}
{{ if eq .OS "windows" }}Rem {{ else }}# {{ end }}{{ .ZitiCtrlAdvertisedAddressVarDescription }}
@@ -38,9 +40,7 @@
{{ if eq .OS "windows" }}SET{{ else }}export{{ end }} {{ .ZitiSigningCertVarName }}={{ .Controller.Edge.ZitiSigningCert }}
{{ if eq .OS "windows" }}Rem {{ else }}# {{ end }}{{ .ZitiSigningKeyVarDescription }}
{{ if eq .OS "windows" }}SET{{ else }}export{{ end }} {{ .ZitiSigningKeyVarName }}={{ .Controller.Edge.ZitiSigningKey }}
{{ if eq .OS "windows" }}Rem {{ else }}# {{ end }}{{ .ZitiCtrlMgmtListenerHostPortVarDescription }}
{{ if eq .OS "windows" }}SET{{ else }}export{{ end }} {{ .ZitiCtrlMgmtListenerHostPortVarName }}={{ .Controller.MgmtListenerHostPort }}
{{ if eq .OS "windows" }}Rem {{ else }}# {{ end }}{{ .ZitiEdgeCtrlListenerHostPortVarDescription }}
{{ if eq .OS "windows" }}SET{{ else }}export{{ end }} {{ .ZitiEdgeCtrlListenerHostPortVarName }}={{ .Controller.Edge.ListenerHostPort }}
{{ if eq .OS "windows" }}Rem {{ else }}# {{ end }}{{ .ZitiCtrlAdvertisedAddressVarDescription }}
{{ if eq .OS "windows" }}SET{{ else }}export{{ end }} {{ .ZitiCtrlAdvertisedAddress }}={{ .Controller.AdvertisedAddress }}
{{ if eq .OS "windows" }}Rem {{ else }}# {{ end }}{{ .ZitiEdgeCtrlAdvertisedHostPortVarDescription }}
{{ if eq .OS "windows" }}SET{{ else }}export{{ end }} {{ .ZitiEdgeCtrlAdvertisedHostPortVarName }}={{ .Controller.Edge.AdvertisedHostPort }}
@@ -20,10 +20,10 @@ link:
- binding: transport
{{ if .Router.IsPrivate }}#{{ end }} listeners:
{{ if .Router.IsPrivate }}#{{ end }} - binding: transport
{{ if .Router.IsPrivate }}#{{ end }} bind: tls:0.0.0.0:10080
{{ if .Router.IsPrivate }}#{{ end }} advertise: tls:{{ .Router.Edge.Hostname }}:10080
{{ if .Router.IsPrivate }}#{{ end }} bind: tls:0.0.0.0:{{ .Router.Listener.BindPort }}
{{ if .Router.IsPrivate }}#{{ end }} advertise: tls:{{ .Router.Edge.Hostname }}:{{ .Router.Listener.BindPort }}
{{ if .Router.IsPrivate }}#{{ end }} options:
{{ if .Router.IsPrivate }}#{{ end }} outQueueSize: 16
{{ if .Router.IsPrivate }}#{{ end }} outQueueSize: {{ .Router.Listener.OutQueueSize }}
{{ if or .Router.IsFabric .Router.IsPrivate }}#{{ end }}listeners:
# bindings of edge and tunnel requires an "edge" section below
-6
View File
@@ -55,7 +55,6 @@ type ControllerTemplateValues struct {
Port string
AdvertisedAddress string
ListenerAddress string
MgmtListenerHostPort string
IdentityCert string
IdentityServerCert string
IdentityKey string
@@ -214,10 +213,6 @@ func (data *ConfigTemplateValues) populateEnvVars() {
zitiCtrlPort, err := cmdhelper.GetZitiCtrlPort()
handleVariableError(err, constants.ZitiCtrlPortVarName)
// Get Ziti Controller Management Host and Port
zitiCtrlMgmtListenerHostPort, err := cmdhelper.GetZitiCtrlMgmtListenerHostPort()
handleVariableError(err, constants.ZitiCtrlMgmtListenerHostPortVarName)
// Get Ziti Edge Controller Listener Host and Port
zitiEdgeCtrlListenerHostPort, err := cmdhelper.GetZitiEdgeCtrlListenerHostPort()
handleVariableError(err, constants.ZitiEdgeCtrlListenerHostPortVarName)
@@ -232,7 +227,6 @@ func (data *ConfigTemplateValues) populateEnvVars() {
data.Controller.ListenerAddress = zitiCtrlListenerAddress
data.Controller.AdvertisedAddress = zitiCtrlAdvertisedAddress
data.Controller.Port = zitiCtrlPort
data.Controller.MgmtListenerHostPort = zitiCtrlMgmtListenerHostPort
data.Controller.Edge.ListenerHostPort = zitiEdgeCtrlListenerHostPort
data.Controller.Edge.AdvertisedHostPort = zitiEdgeCtrlAdvertisedHostPort
data.Router.Edge.Port = zitiEdgeRouterPort
@@ -157,8 +157,6 @@ func NewCmdCreateConfigEnvironment(data *ConfigTemplateValues) *cobra.Command {
ZitiCtrlListenerAddressVarDescription: constants.ZitiCtrlListenerAddressVarDescription,
ZitiCtrlAdvertisedAddressVarName: constants.ZitiCtrlAdvertisedAddressVarName,
ZitiCtrlAdvertisedAddressVarDescription: constants.ZitiCtrlAdvertisedAddressVarDescription,
ZitiCtrlMgmtListenerHostPortVarName: constants.ZitiCtrlMgmtListenerHostPortVarName,
ZitiCtrlMgmtListenerHostPortVarDescription: constants.ZitiCtrlMgmtListenerHostPortVarDescription,
ZitiEdgeCtrlListenerHostPortVarName: constants.ZitiEdgeCtrlListenerHostPortVarName,
ZitiEdgeCtrlListenerHostPortVarDescription: constants.ZitiEdgeCtrlListenerHostPortVarDescription,
ZitiEdgeCtrlAdvertisedHostPortVarName: constants.ZitiEdgeCtrlAdvertisedHostPortVarName,
@@ -223,11 +221,9 @@ func NewCmdCreateConfigEnvironment(data *ConfigTemplateValues) *cobra.Command {
"%-36s %-50s %s\n"+
"%-36s %-50s %s\n"+
"%-36s %-50s %s\n"+
"%-36s %-50s %s\n"+
"%-36s %-50s %s",
constants.ZitiHomeVarName, constants.ZitiHomeVarDescription, data.ZitiHome,
constants.ZitiCtrlPortVarName, constants.ZitiCtrlPortVarDescription, data.Controller.Port,
constants.ZitiCtrlMgmtListenerHostPortVarName, constants.ZitiCtrlMgmtListenerHostPortVarDescription, data.Controller.MgmtListenerHostPort,
constants.ZitiCtrlNameVarName, constants.ZitiCtrlNameVarDescription, data.Controller.Name,
constants.ZitiCtrlAdvertisedAddressVarName, constants.ZitiCtrlAdvertisedAddressVarDescription, data.Controller.AdvertisedAddress,
constants.ZitiCtrlListenerAddressVarName, constants.ZitiCtrlListenerAddressVarDescription, data.Controller.ListenerAddress,
-4
View File
@@ -86,10 +86,6 @@ func GetZitiCtrlListenerAddress() (string, error) {
return getValueOrSetAndGetDefault(constants.ZitiCtrlListenerAddressVarName, constants.DefaultZitiControllerListenerAddress, false)
}
func GetZitiCtrlMgmtListenerHostPort() (string, error) {
return getValueOrSetAndGetDefault(constants.ZitiCtrlMgmtListenerHostPortVarName, constants.DefaultZitiMgmtControllerListenerHostPort, false)
}
func GetZitiCtrlName() (string, error) {
return getValueOrSetAndGetDefault(constants.ZitiCtrlNameVarName, constants.DefaultZitiControllerName, false)
}
-2
View File
@@ -124,8 +124,6 @@ const (
ZitiCtrlListenerAddressVarDescription = "The Ziti Controller Listener Address"
ZitiCtrlAdvertisedAddressVarName = "ZITI_CTRL_ADVERTISED_ADDRESS"
ZitiCtrlAdvertisedAddressVarDescription = "The Ziti Controller Advertised Address"
ZitiCtrlMgmtListenerHostPortVarName = "ZITI_CTRL_MGMT_HOST_PORT"
ZitiCtrlMgmtListenerHostPortVarDescription = "Host and port of the Ziti Controller Management Listener"
ZitiEdgeCtrlListenerHostPortVarName = "ZITI_CTRL_EDGE_LISTENER_HOST_PORT"
ZitiEdgeCtrlListenerHostPortVarDescription = "Host and port of the Ziti Edge Controller Listener"
ZitiEdgeCtrlAdvertisedHostPortVarName = "ZITI_EDGE_CTRL_ADVERTISED_HOST_PORT"