Skip to content

Commit

Permalink
Update to v0.0.6 SDK. Adds Tag to traffic status
Browse files Browse the repository at this point in the history
  • Loading branch information
tshak committed Jan 23, 2020
1 parent 4015fd9 commit f061abb
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 18 deletions.
2 changes: 1 addition & 1 deletion controllers/knative_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func createStatusFromKnative(kcfg *knserving.Configuration, route *knserving.Rou
status.Traffic[idx] = model.DeploymentTrafficStatus{
RevisionName: traffic.RevisionName,
Percent: traffic.Percent,
Latest: traffic.LatestRevision,
Tag: traffic.Tag,
}
}
return status, nil
Expand Down
11 changes: 6 additions & 5 deletions controllers/knative_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ func Test_createStatusFromKnative(t *testing.T) {
knserving.TrafficTarget{
RevisionName: "rev0",
Percent: util.PtrInt64(90),
Tag: "r0",
},
knserving.TrafficTarget{
RevisionName: "rev1",
LatestRevision: util.PtrBool(true),
Percent: util.PtrInt64(10),
RevisionName: "rev1",
Percent: util.PtrInt64(10),
Tag: "r1",
},
},
},
Expand Down Expand Up @@ -123,8 +124,8 @@ func Test_createStatusFromKnative(t *testing.T) {
require.Len(t, result.Traffic, 2)
assert.Equal(t, "rev0", result.Traffic[0].RevisionName)
assert.Equal(t, int64(90), *result.Traffic[0].Percent)
assert.Nil(t, result.Traffic[0].Latest)
assert.Equal(t, "r0", result.Traffic[0].Tag)
assert.Equal(t, "rev1", result.Traffic[1].RevisionName)
assert.Equal(t, int64(10), *result.Traffic[1].Percent)
assert.True(t, *result.Traffic[1].Latest)
assert.Equal(t, "r1", result.Traffic[1].Tag)
}
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ require (
github.com/joho/godotenv v1.3.0
github.com/kelseyhightower/envconfig v1.4.0
github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a // indirect
github.com/pkg/errors v0.8.1
github.com/riser-platform/riser-server/api/v1/model v0.0.0-20191231160837-2bc69123b600
github.com/riser-platform/riser/sdk v0.0.0-20191231161402-420e3e7c3087
github.com/pkg/errors v0.9.1
github.com/riser-platform/riser-server/api/v1/model v0.0.6
github.com/riser-platform/riser/sdk v0.0.19
github.com/stretchr/testify v1.4.0
golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472 // indirect
k8s.io/api v0.0.0-20190830074751-c43c3e1d5a79
k8s.io/apimachinery v0.17.0
k8s.io/apimachinery v0.17.2
k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible
knative.dev/pkg v0.0.0-20191107185656-884d50f09454 // indirect
knative.dev/serving v0.10.0
Expand Down
22 changes: 14 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbt
github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
github.com/aws/aws-sdk-go v1.15.90/go.mod h1:es1KtYUFs7le0xQ3rOihkuoVD90z7D0fR2Qm4S00/gU=
github.com/aws/aws-sdk-go v1.22.1 h1://WJvJi9iq/i5TWHuK3hIC23xCZYH7Qv7SIN2vZVqxY=
github.com/aws/aws-sdk-go v1.22.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
Expand Down Expand Up @@ -70,8 +68,8 @@ github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nA
github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY=
github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I=
github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-ozzo/ozzo-validation v3.6.0+incompatible h1:msy24VGS42fKO9K1vLz82/GeYW1cILu7Nuuj1N3BBkE=
github.com/go-ozzo/ozzo-validation v3.6.0+incompatible/go.mod h1:gsEKFIVnabGBt6mXmxK0MoFy+cZoTJY6mu5Ll3LVLBU=
github.com/go-ozzo/ozzo-validation/v3 v3.8.1 h1:PcDzf3lgoWlFW8cxEpqD04zmRczXjn1CUN/AFPUJZK8=
github.com/go-ozzo/ozzo-validation/v3 v3.8.1/go.mod h1:Bf9HRAgaSCiSPUJ6ueMChbSdCWKeAH4pyW3jctEGwGU=
github.com/gogo/protobuf v1.0.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
Expand Down Expand Up @@ -108,6 +106,8 @@ github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf h1:+RRA9JqSOZFfKrOeq
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g=
github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
Expand Down Expand Up @@ -209,6 +209,8 @@ github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/9
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
Expand All @@ -227,10 +229,12 @@ github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R
github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a h1:9a8MnZMP0X2nLJdBg+pBmGgkJlSaKC2KaQmTCk1XDtE=
github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M=
github.com/riser-platform/riser-server/api/v1/model v0.0.0-20191231160837-2bc69123b600 h1:xxbwV3+CZghmkeX8FL4E9DplJmbe059IxBAq64pDUxs=
github.com/riser-platform/riser-server/api/v1/model v0.0.0-20191231160837-2bc69123b600/go.mod h1:Q5LMRqsqxdCPygU9c1vGyAdQtzqFbJN1B//ojv0fwrU=
github.com/riser-platform/riser/sdk v0.0.0-20191231161402-420e3e7c3087 h1:0RLDVIAWLRQORhPUqjWI/1fX3RxRkq3AZT4zr4efFnE=
github.com/riser-platform/riser/sdk v0.0.0-20191231161402-420e3e7c3087/go.mod h1:1UGcY09A994tNm6+ro7QiZd0iayaWxXHamMH06//fho=
github.com/riser-platform/riser-server/api/v1/model v0.0.0-20200123100035-47ad73fd5886 h1:nNWNmUtjBGh20bxNHoCgLzt8SS0he0JV7qweAXOET38=
github.com/riser-platform/riser-server/api/v1/model v0.0.0-20200123100035-47ad73fd5886/go.mod h1:wMh5lPcNKyUvXAZHNn/ZyYJHcaynLTLeMSXhhMqCIJM=
github.com/riser-platform/riser-server/api/v1/model v0.0.6 h1:qoAUphmkEM+o8f1Klk6OgnPRRt+rG16W/1HgO5jLYCc=
github.com/riser-platform/riser-server/api/v1/model v0.0.6/go.mod h1:wMh5lPcNKyUvXAZHNn/ZyYJHcaynLTLeMSXhhMqCIJM=
github.com/riser-platform/riser/sdk v0.0.19 h1:pUjFgaihonH6albvacFC8WETGqZC5HkB2lmS4H/maYE=
github.com/riser-platform/riser/sdk v0.0.19/go.mod h1:khXtRJtwgppAqY+cumnbswdTeTUvjMTLeJr2o/d5oj4=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U=
Expand Down Expand Up @@ -402,6 +406,8 @@ google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ij
google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.24.0 h1:vb/1TCsVn3DcJlQ0Gs1yB1pKI6Do2/QNwxdKqmc/b0s=
google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA=
gopkg.in/asaskevich/govalidator.v9 v9.0.0-20180315120708-ccb8e960c48f h1:RVvpqSdNKxt6sENjmw0kdyyv8r18TdpmYTrvUUg2qkc=
gopkg.in/asaskevich/govalidator.v9 v9.0.0-20180315120708-ccb8e960c48f/go.mod h1:+MTrBL6wlsxv1uFXT6b9LWG7PJdrvUJEjl8tXOlk9OU=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down

0 comments on commit f061abb

Please sign in to comment.