Skip to content

Commit

Permalink
[0.17] Backport 1044 and 10101 (#1048)
Browse files Browse the repository at this point in the history
* Added back functionality to deprecated max-scale/min-scale (#1010)

* Added back functionality to deprecated max-scale/min-scale

* Updated based on review, removed duplicate code and added an or statement, also updated deprecated message

* fix(e2e): Let the subscription and related resource reconcile (#1044)

sleep for 5 seconds after subscription create and update in e2e

* Update CHANGELOG

Co-authored-by: Mike Petersen <[email protected]>
  • Loading branch information
navidshaikh and Mike Petersen authored Oct 7, 2020
1 parent 47cef20 commit 26eaf7e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@
| https://github.com/knative/client/pull/[#]
////

## v0.17.1 (2020-10-02)
## v0.17.1 (2020-10-07)

[cols="1,10,3", options="header", width="100%"]
|===
| | Description | PR

| 🐛
| Added back functionality to deprecated max-scale/min-scale
| https://github.com/knative/client/pull/1010[#1010]

| 🎁
| Add subscription CRUD
| https://github.com/knative/client/pull/1013[#1013]
Expand Down
6 changes: 6 additions & 0 deletions lib/test/subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ limitations under the License.
package test

import (
"time"

"gotest.tools/assert"

"knative.dev/client/pkg/util"
Expand All @@ -28,6 +30,8 @@ func SubscriptionCreate(r *KnRunResultCollector, sname string, args ...string) {
out := r.KnTest().Kn().Run(cmd...)
r.AssertNoError(out)
assert.Check(r.T(), util.ContainsAllIgnoreCase(out.Stdout, "subscription", sname, "created"))
// let the subscription and related resource reconcile
time.Sleep(time.Second * 5)
}

func SubscriptionList(r *KnRunResultCollector, args ...string) string {
Expand Down Expand Up @@ -58,4 +62,6 @@ func SubscriptionUpdate(r *KnRunResultCollector, sname string, args ...string) {
out := r.KnTest().Kn().Run(cmd...)
r.AssertNoError(out)
assert.Check(r.T(), util.ContainsAllIgnoreCase(out.Stdout, "subscription", sname, "updated"))
// let the subscription and related resource reconcile
time.Sleep(time.Second * 5)
}
6 changes: 4 additions & 2 deletions pkg/kn/commands/service/configuration_edit_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,14 +313,16 @@ func (p *ConfigurationEditFlags) Apply(
}
}

if cmd.Flags().Changed("scale-min") {
// Deprecated "min-scale" in 0.19, updated to "scale-min"
if cmd.Flags().Changed("scale-min") || cmd.Flags().Changed("min-scale") {
err = servinglib.UpdateMinScale(template, p.MinScale)
if err != nil {
return err
}
}

if cmd.Flags().Changed("scale-max") {
// Deprecated "max-scale" in 0.19, updated to "scale-max"
if cmd.Flags().Changed("scale-max") || cmd.Flags().Changed("max-scale") {
err = servinglib.UpdateMaxScale(template, p.MaxScale)
if err != nil {
return err
Expand Down

0 comments on commit 26eaf7e

Please sign in to comment.