From 0f06bd410a69fee08193f375d8bf4ef861eb522f Mon Sep 17 00:00:00 2001 From: Alexander Matyushentsev Date: Fri, 11 Feb 2022 11:42:30 -0800 Subject: [PATCH 1/2] fix: add workaround to fix 'stream terminated by RST_STREAM with error code: PROTOCOL_ERROR' Signed-off-by: Alexander Matyushentsev --- server/server.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/server.go b/server/server.go index bc9661c5b5..393cc97a08 100644 --- a/server/server.go +++ b/server/server.go @@ -8,6 +8,7 @@ import ( "net" "net/http" "os" + "strings" "time" "github.com/argoproj/pkg/errors" @@ -101,7 +102,11 @@ func (s *ArgoRolloutsServer) newHTTPServer(ctx context.Context, port int) *http. gwMuxOpts := runtime.WithMarshalerOption(runtime.MIMEWildcard, new(json.JSONMarshaler)) gwmux := runtime.NewServeMux(gwMuxOpts, - runtime.WithIncomingHeaderMatcher(func(key string) (string, bool) { return key, true }), + runtime.WithIncomingHeaderMatcher(func(key string) (string, bool) { + // Dropping "Connection" header as a workaround for https://github.com/grpc-ecosystem/grpc-gateway/issues/2447 + // The fix is part of grpc-gateway v2.x but not available in v1.x, so workaround should be removed after upgrading to grpc v2.x + return key, strings.ToLower(key) != "connection" + }), runtime.WithProtoErrorHandler(runtime.DefaultHTTPProtoErrorHandler), ) From bd2a1bd98c0be3a4e2ce4b68dd035ceb758f98b7 Mon Sep 17 00:00:00 2001 From: schakradari Date: Tue, 7 Feb 2023 23:13:20 -0500 Subject: [PATCH 2/2] Analysis info tooltip overlapping over step content Signed-off-by: schakradari --- ui/src/app/components/rollout/rollout.tsx | 94 +++++++++++++++-------- 1 file changed, 62 insertions(+), 32 deletions(-) diff --git a/ui/src/app/components/rollout/rollout.tsx b/ui/src/app/components/rollout/rollout.tsx index 6c3f3a0393..77d6607ac4 100644 --- a/ui/src/app/components/rollout/rollout.tsx +++ b/ui/src/app/components/rollout/rollout.tsx @@ -130,11 +130,11 @@ export const RolloutWidget = (props: {rollout: RolloutRolloutInfo; interactive?: interactive={ interactive ? { - editState: interactive.editState, - setImage: (container, image, tag) => { - interactive.api.rolloutServiceSetRolloutImage({}, interactive.namespace, rollout.objectMeta?.name, container, image, tag); - }, - } + editState: interactive.editState, + setImage: (container, image, tag) => { + interactive.api.rolloutServiceSetRolloutImage({}, interactive.namespace, rollout.objectMeta?.name, container, image, tag); + }, + } : null } /> @@ -314,7 +314,7 @@ const Step = (props: {step: GithubComArgoprojArgoRolloutsPkgApisRolloutsV1alpha1 if (props.step.setMirrorRoute) { content = `Set Mirror: ${props.step.setMirrorRoute.name}`; - if(!props.step.setMirrorRoute.match) { + if (!props.step.setMirrorRoute.match) { content = `Remove Mirror: ${props.step.setMirrorRoute.name}`; } } @@ -328,11 +328,16 @@ const Step = (props: {step: GithubComArgoprojArgoRolloutsPkgApisRolloutsV1alpha1 return ( - +
{icon && } {content} {unit} @@ -346,8 +351,7 @@ const Step = (props: {step: GithubComArgoprojArgoRolloutsPkgApisRolloutsV1alpha1 )} - - {props.step.setHeaderRoute && props.step.setHeaderRoute.match &&( + {props.step.setHeaderRoute && props.step.setHeaderRoute.match && ( setOpenHeader(!openHeader)}> @@ -389,7 +393,11 @@ const Step = (props: {step: GithubComArgoprojArgoRolloutsPkgApisRolloutsV1alpha1 ); }; -const ExperimentWidget = ({template, opened, onToggle}: { +const ExperimentWidget = ({ + template, + opened, + onToggle, +}: { template: GithubComArgoprojArgoRolloutsPkgApisRolloutsV1alpha1RolloutExperimentTemplate; opened: boolean; onToggle: (name: string) => void; @@ -435,32 +443,54 @@ const WidgetItemSetMirror = ({value}: {value: GithubComArgoprojArgoRolloutsPkgAp
{value.percentage}
{Object.values(value.match).map((val, index) => { if (!val) return null; - let stringMatcherValue = "" - let stringMatcherType = "" - let fragments = [] + let stringMatcherValue = ''; + let stringMatcherType = ''; + let fragments = []; if (val.path != null) { - if(val.path.exact != null) {stringMatcherValue = val.path.exact; stringMatcherType="Exact"} - if(val.path.prefix != null) {stringMatcherValue = val.path.prefix; stringMatcherType="Prefix"} - if(val.path.regex != null) {stringMatcherValue = val.path.regex; stringMatcherType="Regex"} + if (val.path.exact != null) { + stringMatcherValue = val.path.exact; + stringMatcherType = 'Exact'; + } + if (val.path.prefix != null) { + stringMatcherValue = val.path.prefix; + stringMatcherType = 'Prefix'; + } + if (val.path.regex != null) { + stringMatcherValue = val.path.regex; + stringMatcherType = 'Regex'; + } fragments.push( -
{index} - Path ({stringMatcherType})
+
+ {index} - Path ({stringMatcherType}) +
{stringMatcherValue}
); } if (val.method != null) { - if(val.method.exact != null) {stringMatcherValue = val.method.exact; stringMatcherType="Exact"} - if(val.method.prefix != null) {stringMatcherValue = val.method.prefix; stringMatcherType="Prefix"} - if(val.method.regex != null) {stringMatcherValue = val.method.regex; stringMatcherType="Regex"} + if (val.method.exact != null) { + stringMatcherValue = val.method.exact; + stringMatcherType = 'Exact'; + } + if (val.method.prefix != null) { + stringMatcherValue = val.method.prefix; + stringMatcherType = 'Prefix'; + } + if (val.method.regex != null) { + stringMatcherValue = val.method.regex; + stringMatcherType = 'Regex'; + } fragments.push( -
{index} - Method ({stringMatcherType})
+
+ {index} - Method ({stringMatcherType}) +
{stringMatcherValue}
); } - return fragments + return fragments; })} @@ -475,19 +505,19 @@ const WidgetItemSetHeader = ({values}: {values: GithubComArgoprojArgoRolloutsPkg if (!record.headerName) return null; if (!record.headerValue) return null; - let headerValue = "" - let headerValueType = "" + let headerValue = ''; + let headerValueType = ''; if (record.headerValue.regex) { - headerValue = record.headerValue.regex - headerValueType = "Regex" + headerValue = record.headerValue.regex; + headerValueType = 'Regex'; } if (record.headerValue.prefix) { - headerValue = record.headerValue.prefix - headerValueType = "Prefix" + headerValue = record.headerValue.prefix; + headerValueType = 'Prefix'; } if (record.headerValue.exact) { - headerValue = record.headerValue.exact - headerValueType = "Exact" + headerValue = record.headerValue.exact; + headerValueType = 'Exact'; } return (