diff --git a/internal/cmd/skupper/connector/nonkube/connector_create.go b/internal/cmd/skupper/connector/nonkube/connector_create.go index d66865e89..2e3d2cabe 100644 --- a/internal/cmd/skupper/connector/nonkube/connector_create.go +++ b/internal/cmd/skupper/connector/nonkube/connector_create.go @@ -114,7 +114,7 @@ func (cmd *CmdConnectorCreate) ValidateInput(args []string) []error { if cmd.Flags.TlsCredentials != "" { ok, err := resourceStringValidator.Evaluate(cmd.Flags.TlsCredentials) if !ok { - validationErrors = append(validationErrors, fmt.Errorf("tlsCredentials is not valid: %s", err)) + validationErrors = append(validationErrors, fmt.Errorf("tlsCredentials value is not valid: %s", err)) } } diff --git a/internal/cmd/skupper/connector/nonkube/connector_create_test.go b/internal/cmd/skupper/connector/nonkube/connector_create_test.go index 48f9f454a..ed977eb08 100644 --- a/internal/cmd/skupper/connector/nonkube/connector_create_test.go +++ b/internal/cmd/skupper/connector/nonkube/connector_create_test.go @@ -82,7 +82,7 @@ func TestNonKubeCmdConnectorCreate_ValidateInput(t *testing.T) { name: "TlsCredentials is not valid", args: []string{"my-connector-tls", "8080"}, flags: &common.CommandConnectorCreateFlags{TlsCredentials: "not-valid$", Host: "1.2.3.4"}, - expectedErrors: []string{"tlsCredentials is not valid: value does not match this regular expression: ^[a-z0-9]([-a-z0-9]*[a-z0-9])*(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])*)*$"}, + expectedErrors: []string{"tlsCredentials value is not valid: value does not match this regular expression: ^[a-z0-9]([-a-z0-9]*[a-z0-9])*(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])*)*$"}, }, { name: "host is not valid", diff --git a/internal/cmd/skupper/connector/nonkube/connector_update.go b/internal/cmd/skupper/connector/nonkube/connector_update.go index 16ceddd75..c291dc040 100644 --- a/internal/cmd/skupper/connector/nonkube/connector_update.go +++ b/internal/cmd/skupper/connector/nonkube/connector_update.go @@ -135,7 +135,7 @@ func (cmd *CmdConnectorUpdate) ValidateInput(args []string) []error { if cmd.Flags.TlsCredentials != "" { ok, err := resourceStringValidator.Evaluate(cmd.Flags.TlsCredentials) if !ok { - validationErrors = append(validationErrors, fmt.Errorf("tlsCredentials is not valid: %s", err)) + validationErrors = append(validationErrors, fmt.Errorf("tlsCredentials value is not valid: %s", err)) } else { cmd.newSettings.tlsCredentials = cmd.Flags.TlsCredentials } diff --git a/internal/cmd/skupper/connector/nonkube/connector_update_test.go b/internal/cmd/skupper/connector/nonkube/connector_update_test.go index dcbaccf98..6d38bc578 100644 --- a/internal/cmd/skupper/connector/nonkube/connector_update_test.go +++ b/internal/cmd/skupper/connector/nonkube/connector_update_test.go @@ -77,7 +77,7 @@ func TestCmdConnectorUpdate_ValidateInput(t *testing.T) { name: "tlsCredentials is not valid", args: []string{"my-connector"}, flags: &common.CommandConnectorUpdateFlags{TlsCredentials: "not-valid$", Host: "1.2.3.4"}, - expectedErrors: []string{"tlsCredentials is not valid: value does not match this regular expression: ^[a-z0-9]([-a-z0-9]*[a-z0-9])*(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])*)*$"}, + expectedErrors: []string{"tlsCredentials value is not valid: value does not match this regular expression: ^[a-z0-9]([-a-z0-9]*[a-z0-9])*(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])*)*$"}, }, { name: "host is not valid", diff --git a/internal/cmd/skupper/listener/nonkube/listener_create.go b/internal/cmd/skupper/listener/nonkube/listener_create.go index 275838a3d..70eec0fc5 100644 --- a/internal/cmd/skupper/listener/nonkube/listener_create.go +++ b/internal/cmd/skupper/listener/nonkube/listener_create.go @@ -110,7 +110,7 @@ func (cmd *CmdListenerCreate) ValidateInput(args []string) []error { if cmd.Flags.TlsCredentials != "" { ok, err := resourceStringValidator.Evaluate(cmd.Flags.TlsCredentials) if !ok { - validationErrors = append(validationErrors, fmt.Errorf("tlsCredentials is not valid: %s", err)) + validationErrors = append(validationErrors, fmt.Errorf("tlsCredentials value is not valid: %s", err)) } } diff --git a/internal/cmd/skupper/listener/nonkube/listener_create_test.go b/internal/cmd/skupper/listener/nonkube/listener_create_test.go index 01754b5d0..3027cdf34 100644 --- a/internal/cmd/skupper/listener/nonkube/listener_create_test.go +++ b/internal/cmd/skupper/listener/nonkube/listener_create_test.go @@ -82,7 +82,7 @@ func TestNonKubeCmdListenerCreate_ValidateInput(t *testing.T) { name: "TlsCredentials key is not valid", args: []string{"my-listener-tls", "8080"}, flags: &common.CommandListenerCreateFlags{TlsCredentials: "not-valid$", Host: "1.2.3.4"}, - expectedErrors: []string{"tlsCredentials is not valid: value does not match this regular expression: ^[a-z0-9]([-a-z0-9]*[a-z0-9])*(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])*)*$"}, + expectedErrors: []string{"tlsCredentials value is not valid: value does not match this regular expression: ^[a-z0-9]([-a-z0-9]*[a-z0-9])*(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])*)*$"}, }, { name: "host is not valid", @@ -164,7 +164,7 @@ func TestNonKubeCmdListenerCreate_InputToOptions(t *testing.T) { testTable := []test{ { name: "test1", - flags: common.CommandListenerCreateFlags{"backend", "", "secret", "tcp", 0, "json"}, + flags: common.CommandListenerCreateFlags{"backend", "", "secret", "tcp", 0, "json", "none"}, expectedTlsCredentials: "secret", expectedHost: "0.0.0.0", expectedRoutingKey: "backend", @@ -175,7 +175,7 @@ func TestNonKubeCmdListenerCreate_InputToOptions(t *testing.T) { { name: "test2", namespace: "test", - flags: common.CommandListenerCreateFlags{"backend", "1.2.3.4", "secret", "tcp", 0, "json"}, + flags: common.CommandListenerCreateFlags{"backend", "1.2.3.4", "secret", "tcp", 0, "json", "configured"}, expectedTlsCredentials: "secret", expectedHost: "1.2.3.4", expectedRoutingKey: "backend", @@ -186,7 +186,7 @@ func TestNonKubeCmdListenerCreate_InputToOptions(t *testing.T) { { name: "test3", namespace: "default", - flags: common.CommandListenerCreateFlags{"", "", "secret", "tcp", 0, "yaml"}, + flags: common.CommandListenerCreateFlags{"", "", "secret", "tcp", 0, "yaml", "ready"}, expectedTlsCredentials: "secret", expectedHost: "0.0.0.0", expectedRoutingKey: "my-listener", diff --git a/internal/cmd/skupper/listener/nonkube/listener_update.go b/internal/cmd/skupper/listener/nonkube/listener_update.go index 0b64479ce..dc75696b6 100644 --- a/internal/cmd/skupper/listener/nonkube/listener_update.go +++ b/internal/cmd/skupper/listener/nonkube/listener_update.go @@ -111,7 +111,7 @@ func (cmd *CmdListenerUpdate) ValidateInput(args []string) []error { if cmd.Flags.TlsCredentials != "" { ok, err := resourceStringValidator.Evaluate(cmd.Flags.TlsCredentials) if !ok { - validationErrors = append(validationErrors, fmt.Errorf("tlsCredentials is not valid: %s", err)) + validationErrors = append(validationErrors, fmt.Errorf("tlsCredentials value is not valid: %s", err)) } else { cmd.newSettings.tlsCredentials = cmd.Flags.TlsCredentials } diff --git a/internal/cmd/skupper/listener/nonkube/listener_update_test.go b/internal/cmd/skupper/listener/nonkube/listener_update_test.go index 4174d45f8..91d08ca2d 100644 --- a/internal/cmd/skupper/listener/nonkube/listener_update_test.go +++ b/internal/cmd/skupper/listener/nonkube/listener_update_test.go @@ -78,7 +78,7 @@ func TestCmdListenerUpdate_ValidateInput(t *testing.T) { name: "TlsCredentials key is not valid", args: []string{"my-listener"}, flags: &common.CommandListenerUpdateFlags{TlsCredentials: "not-valid$", Host: "1.2.3.4"}, - expectedErrors: []string{"tlsCredentials is not valid: value does not match this regular expression: ^[a-z0-9]([-a-z0-9]*[a-z0-9])*(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])*)*$"}, + expectedErrors: []string{"tlsCredentials value is not valid: value does not match this regular expression: ^[a-z0-9]([-a-z0-9]*[a-z0-9])*(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])*)*$"}, }, { name: "port is not valid",