Skip to content

Commit

Permalink
Merge pull request #378 from jstrachan/changes40
Browse files Browse the repository at this point in the history
fix: trim * from any ingress URLs
  • Loading branch information
jenkins-x-bot-test authored Jun 24, 2021
2 parents 06a7d9a + 1bf036f commit ecc1e8c
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 23 deletions.
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
)
Expand Down
18 changes: 12 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand All @@ -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=
Expand Down Expand Up @@ -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=
Expand Down
2 changes: 2 additions & 0 deletions pkg/promote/promote.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
25 changes: 13 additions & 12 deletions pkg/promote/promote_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"

Expand Down Expand Up @@ -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,
},
},
},
},
Expand Down

0 comments on commit ecc1e8c

Please sign in to comment.