diff --git a/app/nexus.go b/app/nexus.go index 5837bcb..8dccdbc 100644 --- a/app/nexus.go +++ b/app/nexus.go @@ -298,6 +298,12 @@ func NewNexusCommand(getNexusClientFn GetNexusClientFn) (CommandOut, error) { Usage: "Namespace that is allowed to call this endpoint", Required: true, } + allowNamespaceFlagOptional := &cli.StringSliceFlag{ + Name: allowNamespaceFlag.Name, + Aliases: allowNamespaceFlag.Aliases, + Usage: allowNamespaceFlag.Usage + " (optional)", + Required: false, + } namespaceFlag := &cli.StringSliceFlag{ Name: "namespace", Aliases: []string{"ns"}, @@ -386,7 +392,7 @@ func NewNexusCommand(getNexusClientFn GetNexusClientFn) (CommandOut, error) { endpointDescriptionFileOptionalFlag, targetNamespaceFlag, targetTaskQueueFlag, - allowNamespaceFlag, + allowNamespaceFlagOptional, RequestIDFlag, }, Action: func(ctx *cli.Context) error { @@ -400,7 +406,7 @@ func NewNexusCommand(getNexusClientFn GetNexusClientFn) (CommandOut, error) { endpointDescription, ctx.String(targetNamespaceFlag.Name), ctx.String(targetTaskQueueFlag.Name), - ctx.StringSlice(allowNamespaceFlag.Name), + ctx.StringSlice(allowNamespaceFlagOptional.Name), ctx.String(RequestIDFlag.Name), ) if err != nil { @@ -422,7 +428,7 @@ func NewNexusCommand(getNexusClientFn GetNexusClientFn) (CommandOut, error) { endpointDescriptionOptionalFlag, endpointDescriptionFileOptionalFlag, unsetEndpointDescriptionOptionalFlag, - targetNamespaceFlagOptional, + // targetNamespaceFlagOptional, TODO: Uncomment when we support updating target namespace targetTaskQueueFlagOptional, ResourceVersionFlag, RequestIDFlag, diff --git a/app/nexus_test.go b/app/nexus_test.go index 4921ebb..8858e4b 100644 --- a/app/nexus_test.go +++ b/app/nexus_test.go @@ -230,8 +230,8 @@ func (s *NexusTestSuite) TestEndpointUpdate() { "--request-id", exampleEndpoint.AsyncOperationId, )) - // update target-namespace success - s.mockCloudService.EXPECT().GetNexusEndpoints(gomock.Any(), gomock.Any()).Return(&cloudservice.GetNexusEndpointsResponse{Endpoints: []*nexus.Endpoint{getExampleNexusEndpoint()}}, nil).Times(1) + // update target-namespace success TODO: Uncomment when we support updating target namespace + /*s.mockCloudService.EXPECT().GetNexusEndpoints(gomock.Any(), gomock.Any()).Return(&cloudservice.GetNexusEndpointsResponse{Endpoints: []*nexus.Endpoint{getExampleNexusEndpoint()}}, nil).Times(1) s.mockCloudService.EXPECT().UpdateNexusEndpoint(gomock.Any(), gomock.Any()).Return(&cloudservice.UpdateNexusEndpointResponse{ AsyncOperation: &operation.AsyncOperation{ Id: exampleEndpoint.AsyncOperationId, @@ -241,7 +241,7 @@ func (s *NexusTestSuite) TestEndpointUpdate() { "--name", exampleEndpoint.Spec.Name, "--target-namespace", exampleEndpoint.Spec.TargetSpec.WorkerTargetSpec.NamespaceId+"-updated", "--request-id", exampleEndpoint.AsyncOperationId, - )) + ))*/ // update description file success path := "nexus_endpoint_description_test.md" @@ -295,7 +295,7 @@ func (s *NexusTestSuite) TestEndpointUpdate() { s.NoError(s.RunCmd("nexus", "endpoint", "update", "--name", exampleEndpoint.Spec.Name, "--description", exampleEndpoint.Spec.Description+"-updated", - "--target-namespace", exampleEndpoint.Spec.TargetSpec.WorkerTargetSpec.NamespaceId+"-updated", + // "--target-namespace", exampleEndpoint.Spec.TargetSpec.WorkerTargetSpec.NamespaceId+"-updated", "--target-task-queue", exampleEndpoint.Spec.TargetSpec.WorkerTargetSpec.TaskQueue+"-updated", "--request-id", exampleEndpoint.AsyncOperationId, ))