Skip to content

Commit f91fb57

Browse files
authored
kn v0.16.0 release prep (#922)
* Update unit test for invalid concurrency target value * Vendor v0.16.0 eventing and serving * Commit the LICENSES generated by hack/update-deps.sh * Spare third_party dir from license check in hack/build.sh * Update eventing and serving version for 'kn version' * Use DeprecatedInjectionAnnotation key for backward compatibility Fixes #918 Use DeprecatedInjectionAnnotation, i.e. "knative-eventing-injection" for reconciling broker via namespace labeling and trigger annotations. From eventing v0.16.0 release, this key is changed to "eventing.knative.dev/injection" however, older eventing installation wont recognize it. So we continue using the deprecated key until the sugar-controller would support reconciling on either keys. * Fix(kn version): Display eventing.knative.dev at v1beta1 version We've been showing 'v1alpha1' in kn version while we actually vendor and refer v1beta1 for eventing.knative.dev * chore(e2e): Run tests against serving/eventing v0.16.0 release * Update test for concurrency-target to expect new error message the new error message for incorrect concurrency-target value contains "should be at least 0.01" * Setup sugar-controller for released eventing version setup - reuse knative_setup util from common lib for latest-release CI setup * Fix typo in YAML URL and add subheader for sugar-controller install
1 parent b04d115 commit f91fb57

File tree

289 files changed

+21770
-458
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

289 files changed

+21770
-458
lines changed

go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ require (
1010
github.com/spf13/viper v1.6.2
1111
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073
1212
gotest.tools v2.2.0+incompatible
13-
k8s.io/api v0.17.6
14-
k8s.io/apimachinery v0.17.6
13+
k8s.io/api v0.18.1
14+
k8s.io/apimachinery v0.18.1
1515
k8s.io/cli-runtime v0.17.6
1616
k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible
1717
k8s.io/code-generator v0.18.0
18-
knative.dev/eventing v0.15.1-0.20200608083719-c024353a712c
19-
knative.dev/pkg v0.0.0-20200606224418-7ed1d4a552bc
20-
knative.dev/serving v0.15.1-0.20200608114919-92e849c1db9c
18+
knative.dev/eventing v0.16.0
19+
knative.dev/pkg v0.0.0-20200702222342-ea4d6e985ba0
20+
knative.dev/serving v0.16.0
2121
sigs.k8s.io/yaml v1.2.0
2222
)
2323

go.sum

Lines changed: 40 additions & 166 deletions
Large diffs are not rendered by default.

hack/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ check_license() {
170170

171171
local check_output=$(mktemp /tmp/kn-client-licence-check.XXXXXX)
172172
for ext in "${extensions_to_check[@]}"; do
173-
find . -name "*.$ext" -a \! -path "./vendor/*" -a \! -path "./.*" -print0 |
173+
find . -name "*.$ext" -a \! -path "./vendor/*" -a \! -path "./.*" -a \! -path "./third_party/*" -print0 |
174174
while IFS= read -r -d '' path; do
175175
for rword in "${required_keywords[@]}"; do
176176
if ! grep -q "$rword" "$path"; then

lib/test/broker.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424

2525
// LabelNamespaceForDefaultBroker adds label 'knative-eventing-injection=enabled' to the configured namespace
2626
func LabelNamespaceForDefaultBroker(r *KnRunResultCollector) error {
27-
cmd := []string{"label", "namespace", r.KnTest().Kn().Namespace(), v1beta1.InjectionAnnotation + "=enabled"}
27+
cmd := []string{"label", "namespace", r.KnTest().Kn().Namespace(), v1beta1.DeprecatedInjectionAnnotation + "=enabled"}
2828
_, err := Kubectl{}.Run(cmd...)
2929

3030
if err != nil {
@@ -43,7 +43,7 @@ func LabelNamespaceForDefaultBroker(r *KnRunResultCollector) error {
4343

4444
// UnlabelNamespaceForDefaultBroker removes label 'knative-eventing-injection=enabled' from the configured namespace
4545
func UnlabelNamespaceForDefaultBroker(r *KnRunResultCollector) {
46-
cmd := []string{"label", "namespace", r.KnTest().Kn().Namespace(), v1beta1.InjectionAnnotation + "-"}
46+
cmd := []string{"label", "namespace", r.KnTest().Kn().Namespace(), v1beta1.DeprecatedInjectionAnnotation + "-"}
4747
_, err := Kubectl{}.Run(cmd...)
4848
if err != nil {
4949
r.T().Fatalf("error executing '%s': %s", strings.Join(cmd, " "), err.Error())

pkg/eventing/v1beta1/client.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,10 @@ func (b *TriggerBuilder) Broker(broker string) *TriggerBuilder {
182182
// InjectBroker to add annotation to setup default broker
183183
func (b *TriggerBuilder) InjectBroker(inject bool) *TriggerBuilder {
184184
if inject {
185-
meta_v1.SetMetaDataAnnotation(&b.trigger.ObjectMeta, v1beta1.InjectionAnnotation, "enabled")
185+
meta_v1.SetMetaDataAnnotation(&b.trigger.ObjectMeta, v1beta1.DeprecatedInjectionAnnotation, "enabled")
186186
} else {
187-
if meta_v1.HasAnnotation(b.trigger.ObjectMeta, v1beta1.InjectionAnnotation) {
188-
delete(b.trigger.ObjectMeta.Annotations, v1beta1.InjectionAnnotation)
187+
if meta_v1.HasAnnotation(b.trigger.ObjectMeta, v1beta1.DeprecatedInjectionAnnotation) {
188+
delete(b.trigger.ObjectMeta.Annotations, v1beta1.DeprecatedInjectionAnnotation)
189189
}
190190
}
191191
return b

pkg/eventing/v1beta1/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ func TestTriggerBuilder(t *testing.T) {
178178
b.InjectBroker(true)
179179
expected := &metav1.ObjectMeta{
180180
Annotations: map[string]string{
181-
v1beta1.InjectionAnnotation: "enabled",
181+
v1beta1.DeprecatedInjectionAnnotation: "enabled",
182182
},
183183
}
184184
assert.DeepEqual(t, expected.Annotations, b.Build().ObjectMeta.Annotations)

pkg/kn/commands/version/version.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ var GitRevision string
3131
// update this var as we add more deps
3232
var apiVersions = map[string][]string{
3333
"serving": {
34-
"serving.knative.dev/v1 (knative-serving v0.15.0)",
34+
"serving.knative.dev/v1 (knative-serving v0.16.0)",
3535
},
3636
"eventing": {
37-
"sources.knative.dev/v1alpha2 (knative-eventing v0.15.0)",
38-
"eventing.knative.dev/v1alpha1 (knative-eventing v0.15.0)",
37+
"sources.knative.dev/v1alpha2 (knative-eventing v0.16.0)",
38+
"eventing.knative.dev/v1beta1 (knative-eventing v0.16.0)",
3939
},
4040
}
4141

pkg/serving/config_changes_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ func TestUpdateConcurrencyTarget(t *testing.T) {
228228
checkAnnotationValueInt(t, template, autoscaling.TargetAnnotationKey, 10)
229229
// Update with invalid value
230230
err = UpdateConcurrencyTarget(template, -1)
231-
assert.ErrorContains(t, err, "invalid")
231+
assert.ErrorContains(t, err, "should be at least 0.01")
232232
}
233233

234234
func TestUpdateConcurrencyLimit(t *testing.T) {

test/common.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,17 @@ function knative_setup() {
3737
if [ "${eventing_version}" = "latest" ]; then
3838
start_latest_knative_eventing
3939

40+
subheader "Installing eventing extension: sugar-controller (${eventing_version})"
4041
# install the sugar controller
4142
kubectl apply --filename https://storage.googleapis.com/knative-nightly/eventing/latest/eventing-sugar-controller.yaml
4243
wait_until_pods_running knative-eventing || return 1
4344

4445
else
4546
start_release_knative_eventing "${eventing_version}"
47+
48+
subheader "Installing eventing extension: sugar-controller (${eventing_version})"
49+
# install the sugar controller
50+
kubectl apply --filename https://storage.googleapis.com/knative-releases/eventing/previous/v${eventing_version}/eventing-sugar-controller.yaml
51+
wait_until_pods_running knative-eventing || return 1
4652
fi
4753
}

test/e2e/service_options_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func TestServiceOptions(t *testing.T) {
5757
t.Log("update concurrency options with invalid values for service")
5858
out := r.KnTest().Kn().Run("service", "update", "svc1", "--concurrency-limit", "-1", "--concurrency-target", "0")
5959
r.AssertError(out)
60-
assert.Check(r.T(), util.ContainsAll(out.Stderr, "invalid"))
60+
assert.Check(r.T(), util.ContainsAll(out.Stderr, "should be at least 0.01"))
6161

6262
t.Log("returns steady concurrency options for service")
6363
validateServiceConcurrencyLimit(r, "svc1", "300")

0 commit comments

Comments
 (0)