From 4618f7ba93129237ff54382f24de05290732eb22 Mon Sep 17 00:00:00 2001 From: James Strachan Date: Thu, 24 Jun 2021 16:07:48 +0100 Subject: [PATCH 1/3] fix: trim * from any ingress URLs --- pkg/promote/promote.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/promote/promote.go b/pkg/promote/promote.go index 88fc2d1..1691db8 100644 --- a/pkg/promote/promote.go +++ b/pkg/promote/promote.go @@ -757,6 +757,8 @@ func (o *Options) ResolveChartRepositoryURL() (string, error) { if err != nil && apierrors.IsNotFound(err) { err = nil } + // lets strip any trailing * + answer = strings.TrimSuffix(answer, "*") if err == nil && answer != "" { return answer, nil } From 4a0f53753a5006a5fd3c19ed604e7e2a554f2daa Mon Sep 17 00:00:00 2001 From: James Strachan Date: Thu, 24 Jun 2021 16:11:53 +0100 Subject: [PATCH 2/3] chore: upgrade deps --- go.mod | 10 +++++----- go.sum | 18 ++++++++++++------ 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 1bd33a0..62b89cd 100644 --- a/go.mod +++ b/go.mod @@ -7,10 +7,10 @@ require ( github.com/cpuguy83/go-md2man v1.0.10 github.com/hashicorp/go-retryablehttp v0.6.6 // indirect github.com/hashicorp/vault/api v1.0.5-0.20190909201928-35325e2c3262 // indirect - github.com/jenkins-x-plugins/jx-gitops v0.2.93 - github.com/jenkins-x/go-scm v1.9.1 + github.com/jenkins-x-plugins/jx-gitops v0.2.104 + github.com/jenkins-x/go-scm v1.9.3 github.com/jenkins-x/jx-api/v4 v4.0.33 - github.com/jenkins-x/jx-helpers/v3 v3.0.116 + github.com/jenkins-x/jx-helpers/v3 v3.0.119 github.com/jenkins-x/jx-logging/v3 v3.0.6 github.com/mitchellh/mapstructure v1.3.1 // indirect github.com/pkg/errors v0.9.1 @@ -21,8 +21,8 @@ require ( github.com/stretchr/testify v1.7.0 gopkg.in/ini.v1 v1.56.0 // indirect helm.sh/helm/v3 v3.5.4 - k8s.io/api v0.20.7 - k8s.io/apimachinery v0.20.7 + k8s.io/api v0.20.8 + k8s.io/apimachinery v0.20.8 k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible sigs.k8s.io/yaml v1.2.0 ) diff --git a/go.sum b/go.sum index 4e05500..32e4141 100644 --- a/go.sum +++ b/go.sum @@ -72,6 +72,8 @@ github.com/Azure/go-autorest/autorest v0.10.2/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUd github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= github.com/Azure/go-autorest/autorest v0.11.18 h1:90Y4srNYrwOtAgVo3ndrQkTYn6kf1Eg/AjTFJ8Is2aM= github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= +github.com/Azure/go-autorest/autorest v0.11.19 h1:7/IqD2fEYVha1EPeaiytVKhzmPV223pfkRIQUGOK2IE= +github.com/Azure/go-autorest/autorest v0.11.19/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= github.com/Azure/go-autorest/autorest/adal v0.1.0/go.mod h1:MeS4XhScH55IST095THyTxElntu7WqB7pNbZo8Q5G3E= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= github.com/Azure/go-autorest/autorest/adal v0.6.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= @@ -83,6 +85,8 @@ github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQW github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= github.com/Azure/go-autorest/autorest/adal v0.9.13 h1:Mp5hbtOePIzM8pJVRa3YLrWWmZtoxRXqUEzCfJt3+/Q= github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= +github.com/Azure/go-autorest/autorest/adal v0.9.14 h1:G8hexQdV5D4khOXrWG2YuLCFKhWYmWD8bHYaXN5ophk= +github.com/Azure/go-autorest/autorest/adal v0.9.14/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= github.com/Azure/go-autorest/autorest/azure/auth v0.1.0/go.mod h1:Gf7/i2FUpyb/sGBLIFxTBzrNzBo7aPXXE3ZVeDRwdpM= github.com/Azure/go-autorest/autorest/azure/auth v0.4.0/go.mod h1:Oo5cRhLvZteXzI2itUm5ziqsoIxRkzrt3t61FeZaS18= github.com/Azure/go-autorest/autorest/azure/auth v0.4.2 h1:iM6UAvjR97ZIeR93qTcwpKNMpV+/FTWjwEbuPD495Tk= @@ -766,25 +770,27 @@ github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 h1:IPJ3dvxmJ4uc github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869/go.mod h1:cJ6Cj7dQo+O6GJNiMx+Pa94qKj+TG8ONdKHgMNIyyag= github.com/jenkins-x-plugins/jx-charter v0.0.26 h1:apWO15+vaDzac8jggrZhgwqR7KrkmMi7ToeMuzha1Jc= github.com/jenkins-x-plugins/jx-charter v0.0.26/go.mod h1:H/NycSuFNZh5J7rD2JdHreOn3ECcBKg68LhElDTwyUM= -github.com/jenkins-x-plugins/jx-gitops v0.2.93 h1:9o7oBBawoukgfnMVKoro2KE2q8Z9t+rK5UIv/7bzlE8= -github.com/jenkins-x-plugins/jx-gitops v0.2.93/go.mod h1:j/u3wTZzs5SFB32Qqnl33ax9RSq2yX1z+PoYBW56QKw= +github.com/jenkins-x-plugins/jx-gitops v0.2.104 h1:AxX8eHPsvx8yC8Fn/xwW+uoRyRWTVKvbRFk57YOtBsc= +github.com/jenkins-x-plugins/jx-gitops v0.2.104/go.mod h1:B2OxqhOVr1DcjtygNRdrpVDhs149fYNps4ymXmw9sUc= github.com/jenkins-x/go-scm v1.5.117/go.mod h1:PCT338UhP/pQ0IeEeMEf/hoLTYKcH7qjGEKd7jPkeYg= github.com/jenkins-x/go-scm v1.8.2 h1:GMEUz6ap0pAeyUkwWP3SQxJoz/qN+tJmCkr9sWvbXs4= github.com/jenkins-x/go-scm v1.8.2/go.mod h1:z7xTO9/VzqW3xEbEMH2z5cpOGrZ8+nOHOWfU1ngFGxs= -github.com/jenkins-x/go-scm v1.9.1 h1:osYCFsUFePZXlMfnOp71+PlZlY+txJbdlTl9EP8T2t0= -github.com/jenkins-x/go-scm v1.9.1/go.mod h1:z7xTO9/VzqW3xEbEMH2z5cpOGrZ8+nOHOWfU1ngFGxs= +github.com/jenkins-x/go-scm v1.9.3 h1:FXsit1wvYZcgR/R7MAYTY/cErmQ0SruLZeasewh7AUs= +github.com/jenkins-x/go-scm v1.9.3/go.mod h1:z7xTO9/VzqW3xEbEMH2z5cpOGrZ8+nOHOWfU1ngFGxs= github.com/jenkins-x/jx-api/v4 v4.0.33 h1:a5yikWzisk79+tNZJ68lvZmEWo1ai9GvCBVAUtqNMeQ= github.com/jenkins-x/jx-api/v4 v4.0.33/go.mod h1:VRrNCBPQu9pP0tDXlRcPiGMuyeI6g8RTfWolNsX01+M= github.com/jenkins-x/jx-helpers/v3 v3.0.116 h1:9Gey9H+u7yFHwFWvfmor4/z0EZr2A6XKwlV93HsyeFE= github.com/jenkins-x/jx-helpers/v3 v3.0.116/go.mod h1:4B+rwR9VCYvYoxVrb9CWiGpUpiT2OBDpnbORXJk+kRo= +github.com/jenkins-x/jx-helpers/v3 v3.0.118/go.mod h1:llBYRiInSAeipDByIRxZVVMhG79b7n4urvhMcf5GluY= +github.com/jenkins-x/jx-helpers/v3 v3.0.119 h1:Gtdl9Hp7/HTTqrqtqTdj81rPYv3o4rqZm/4RZUfzSCs= +github.com/jenkins-x/jx-helpers/v3 v3.0.119/go.mod h1:llBYRiInSAeipDByIRxZVVMhG79b7n4urvhMcf5GluY= github.com/jenkins-x/jx-kube-client/v3 v3.0.2 h1:sJs6FaIwycDYwE4UsA7j9tpdXOxXEta9KNUJp6s45VI= github.com/jenkins-x/jx-kube-client/v3 v3.0.2/go.mod h1:C/mKnCT5wvolX61eLKJVBNev9sqnkGNpi4skTQ1Gr3Q= github.com/jenkins-x/jx-logging/v3 v3.0.3 h1:sVACbwiKuaDFYPfJeVAU10MJI4DA6LcH1RqJKwfNozc= github.com/jenkins-x/jx-logging/v3 v3.0.3/go.mod h1:Vp2ER2SYgGhAgEEHlLwfi2ZB54tz6ya1qExq0A4CKMI= github.com/jenkins-x/jx-logging/v3 v3.0.6 h1:rXiLYK7WuliCtujKkeU77fnSTJRDSIgbIk7PG4fnZGc= github.com/jenkins-x/jx-logging/v3 v3.0.6/go.mod h1:Vp2ER2SYgGhAgEEHlLwfi2ZB54tz6ya1qExq0A4CKMI= -github.com/jenkins-x/lighthouse-client v0.0.146 h1:g0uZHu6S+/VeB4nGNqtMtL4RkZjVYLfdLuuMjCXVqQM= -github.com/jenkins-x/lighthouse-client v0.0.146/go.mod h1:GBH6WI6eNFYZrX3Zk+Hxj0dsU698gh/GdQphRpq5YMk= +github.com/jenkins-x/lighthouse-client v0.0.172/go.mod h1:KK9sL1v6ymrGAueIO6HOy5zNj4y1HqH8IWF8I5YH41s= github.com/jenkins-x/logrus-stackdriver-formatter v0.2.3 h1:NuRWKUPCEX1wKlXA8ZYSG28qGKd41R7BK11YDQkPwqo= github.com/jenkins-x/logrus-stackdriver-formatter v0.2.3/go.mod h1:litPp7VZWDRCl8LvXuqGngy+65kkg/+T23TgFnDmfTk= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= From 1bf036f526a6fd810fbaee53aff51729f7e988c9 Mon Sep 17 00:00:00 2001 From: James Strachan Date: Thu, 24 Jun 2021 16:55:28 +0100 Subject: [PATCH 3/3] chore: fix failing test --- pkg/promote/promote_integration_test.go | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/pkg/promote/promote_integration_test.go b/pkg/promote/promote_integration_test.go index 79aa163..4bd9ee3 100644 --- a/pkg/promote/promote_integration_test.go +++ b/pkg/promote/promote_integration_test.go @@ -12,7 +12,7 @@ import ( "github.com/jenkins-x/jx-helpers/v3/pkg/kube" "github.com/jenkins-x/jx-helpers/v3/pkg/yaml2s" "github.com/roboll/helmfile/pkg/state" - "k8s.io/api/extensions/v1beta1" + nv1 "k8s.io/api/networking/v1" "github.com/jenkins-x-plugins/jx-promote/pkg/jxtesthelpers" "github.com/jenkins-x-plugins/jx-promote/pkg/promote" @@ -26,7 +26,6 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/client-go/kubernetes/fake" "sigs.k8s.io/yaml" @@ -559,24 +558,26 @@ func TestPromoteHelmfileRemoteCluster(t *testing.T) { }, }, }, - &v1beta1.Ingress{ + &nv1.Ingress{ ObjectMeta: metav1.ObjectMeta{ Name: "chartmuseum", Namespace: ns, }, - Spec: v1beta1.IngressSpec{ - Rules: []v1beta1.IngressRule{ + Spec: nv1.IngressSpec{ + Rules: []nv1.IngressRule{ { Host: chartMuseumHost, - IngressRuleValue: v1beta1.IngressRuleValue{ - HTTP: &v1beta1.HTTPIngressRuleValue{ - Paths: []v1beta1.HTTPIngressPath{ + IngressRuleValue: nv1.IngressRuleValue{ + HTTP: &nv1.HTTPIngressRuleValue{ + Paths: []nv1.HTTPIngressPath{ { Path: "", - Backend: v1beta1.IngressBackend{ - ServiceName: kube.ServiceChartMuseum, - ServicePort: intstr.IntOrString{ - IntVal: 80, + Backend: nv1.IngressBackend{ + Service: &nv1.IngressServiceBackend{ + Name: kube.ServiceChartMuseum, + Port: nv1.ServiceBackendPort{ + Number: 80, + }, }, }, },