Skip to content

Commit 7b9b66a

Browse files
authored
resources taken from eventing (#659)
Signed-off-by: David Fridrich <[email protected]>
1 parent 57dda4c commit 7b9b66a

File tree

5 files changed

+54
-6
lines changed

5 files changed

+54
-6
lines changed
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
/*
22
Copyright 2020 The Knative Authors
3-
43
Licensed under the Apache License, Version 2.0 (the "License");
54
you may not use this file except in compliance with the License.
65
You may obtain a copy of the License at
7-
86
http://www.apache.org/licenses/LICENSE-2.0
9-
107
Unless required by applicable law or agreed to in writing, software
118
distributed under the License is distributed on an "AS IS" BASIS,
129
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
Copyright 2020 The Knative Authors
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, software
8+
distributed under the License is distributed on an "AS IS" BASIS,
9+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
See the License for the specific language governing permissions and
11+
limitations under the License.
12+
*/
13+
14+
package resources
15+
16+
import (
17+
"testing"
18+
19+
"github.com/google/go-cmp/cmp"
20+
corev1 "k8s.io/api/core/v1"
21+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22+
"knative.dev/pkg/kmeta"
23+
24+
sourcesv1 "knative.dev/eventing/pkg/apis/sources/v1"
25+
)
26+
27+
func TestNewServiceAccount(t *testing.T) {
28+
testNS := "test-ns"
29+
testName := "test-name"
30+
obj := &sourcesv1.PingSource{
31+
ObjectMeta: metav1.ObjectMeta{
32+
Name: testName,
33+
Namespace: testNS,
34+
},
35+
}
36+
37+
want := &corev1.ServiceAccount{
38+
ObjectMeta: metav1.ObjectMeta{
39+
Namespace: testNS,
40+
Name: testName,
41+
OwnerReferences: []metav1.OwnerReference{
42+
*kmeta.NewControllerRef(obj),
43+
},
44+
},
45+
}
46+
47+
got := MakeServiceAccount(obj, testName)
48+
49+
if diff := cmp.Diff(want, got); diff != "" {
50+
t.Error("unexpected condition (-want, +got) =", diff)
51+
}
52+
}

pkg/sink/reconciler/streamsink/streamsink.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
"knative.dev/pkg/logging"
2828
pkgreconciler "knative.dev/pkg/reconciler"
2929

30-
eventingresources "knative.dev/eventing/pkg/reconciler/resources"
30+
eventingresources "knative.dev/eventing-redis/pkg/reconciler/resources"
3131
reconcilersource "knative.dev/eventing/pkg/reconciler/source"
3232

3333
"knative.dev/eventing-redis/pkg/reconciler"

pkg/source/reconciler/streamsource/streamsource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929
pkgreconciler "knative.dev/pkg/reconciler"
3030
"knative.dev/pkg/resolver"
3131

32-
eventingresources "knative.dev/eventing/pkg/reconciler/resources"
32+
eventingresources "knative.dev/eventing-redis/pkg/reconciler/resources"
3333
reconcilersource "knative.dev/eventing/pkg/reconciler/source"
3434

3535
sourcesv1alpha1 "knative.dev/eventing-redis/pkg/source/apis/sources/v1alpha1"

vendor/modules.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,6 @@ knative.dev/eventing/pkg/metrics
11011101
knative.dev/eventing/pkg/metrics/source
11021102
knative.dev/eventing/pkg/observability
11031103
knative.dev/eventing/pkg/observability/client
1104-
knative.dev/eventing/pkg/reconciler/resources
11051104
knative.dev/eventing/pkg/reconciler/source
11061105
# knative.dev/hack v0.0.0-20250331013814-c577ed9f7775
11071106
## explicit; go 1.21

0 commit comments

Comments
 (0)