Skip to content

Commit

Permalink
upgrade to latest dependencies
Browse files Browse the repository at this point in the history
bumping knative.dev/eventing 1572967...4358574:
  > 4358574 CrossNamespace: Testing Code Style (# 7918)
  > 4951b74 [main] Upgrade to latest dependencies (# 7920)
bumping knative.dev/serving 3789ff9...40088e3:
  > 40088e3 upgrade to latest dependencies (# 15201)
  > ac5e504 Add e2e test for Contour when CORS policy is enabled (# 15188)
bumping knative.dev/caching 7dad151...1a6c1c7:
  > 1a6c1c7 upgrade to latest dependencies (# 864)
bumping knative.dev/networking 8167799...25012a4:
  > 25012a4 upgrade to latest dependencies (# 979)

Signed-off-by: Knative Automation <automation@knative.team>
  • Loading branch information
knative-automation committed May 14, 2024
1 parent 5966e3e commit 5d8698a
Show file tree
Hide file tree
Showing 6 changed files with 146 additions and 38 deletions.
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ require (
k8s.io/client-go v0.29.2
k8s.io/code-generator v0.29.2
k8s.io/utils v0.0.0-20240102154912-e7106e64919e
knative.dev/caching v0.0.0-20240508055410-7dad151e150b
knative.dev/eventing v0.41.1-0.20240510202101-157296784e29
knative.dev/caching v0.0.0-20240513135106-1a6c1c714c18
knative.dev/eventing v0.41.1-0.20240513180348-43585745f326
knative.dev/hack v0.0.0-20240507013718-68e3bfb39d11
knative.dev/pkg v0.0.0-20240513091600-b1fd04d5c458
knative.dev/serving v0.41.1-0.20240509134134-3789ff9cc0f0
knative.dev/serving v0.41.1-0.20240513193715-40088e3e93fa
sigs.k8s.io/yaml v1.4.0
)

Expand Down Expand Up @@ -144,7 +144,7 @@ require (
k8s.io/gengo v0.0.0-20240129211411-f967bbeff4b4 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
knative.dev/networking v0.0.0-20240507054121-81677991de8a // indirect
knative.dev/networking v0.0.0-20240508055612-25012a498278 // indirect
sigs.k8s.io/controller-runtime v0.7.2 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1357,18 +1357,18 @@ k8s.io/utils v0.0.0-20200912215256-4140de9c8800/go.mod h1:jPW/WVKK9YHAvNhRxK0md/
k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ=
k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
knative.dev/caching v0.0.0-20240508055410-7dad151e150b h1:tpm9hgZu24VN8S+MltC+cDIKMXZYA+3GtWlDhKnx05o=
knative.dev/caching v0.0.0-20240508055410-7dad151e150b/go.mod h1:pXNVnFFBrwXwv4ecGzJ7StrkwD1z41NuBagxdb8dRmY=
knative.dev/eventing v0.41.1-0.20240510202101-157296784e29 h1:vRw4IL0C9wFo8IhOxGh+Fc0AnFX+MkCRl0P3k5voCNU=
knative.dev/eventing v0.41.1-0.20240510202101-157296784e29/go.mod h1:Sstqyyuh67wF2tnbIR9gQ+lkTQmQpcLUw6tCNz/24gU=
knative.dev/caching v0.0.0-20240513135106-1a6c1c714c18 h1:heXgTE/8kVJV/YmYRaCm9PXhRvysqWA6XdqWxWiS37Q=
knative.dev/caching v0.0.0-20240513135106-1a6c1c714c18/go.mod h1:RaoremM8tuvy5M73QYWAIwwe8bq/8IFBPgajle9nxzg=
knative.dev/eventing v0.41.1-0.20240513180348-43585745f326 h1:6pNoSUKuC6zkysSZLyaiuqcsMdAIOiBNA1/tSTQmpiI=
knative.dev/eventing v0.41.1-0.20240513180348-43585745f326/go.mod h1:zmGRdj1BJe628YjZ+f1inTd0bxNETU8OVSXTSEJv56A=
knative.dev/hack v0.0.0-20240507013718-68e3bfb39d11 h1:CYoD72R8/R35REjeY2nnWfBak+Q3f+NxXwEfwcID1eU=
knative.dev/hack v0.0.0-20240507013718-68e3bfb39d11/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
knative.dev/networking v0.0.0-20240507054121-81677991de8a h1:7xY09A7bTaRAzs49/BPNwgDioTEEr4f2qd/LUw3IwKo=
knative.dev/networking v0.0.0-20240507054121-81677991de8a/go.mod h1:oGMqt/peE5fmi1JhzfHfM9SJiiHu72K+xgpjPZSKzFs=
knative.dev/networking v0.0.0-20240508055612-25012a498278 h1:uToI/YqBS1oQ0XIgcNXpAJ0qdeghBN/rREPYN/nwtNs=
knative.dev/networking v0.0.0-20240508055612-25012a498278/go.mod h1:ySd8prgXDd7V5wEE80T800yeBOfVncAWp3nFTbZl34I=
knative.dev/pkg v0.0.0-20240513091600-b1fd04d5c458 h1:ESofRToj3xFQfKd5rlwd3EHd7G/CbVpchrUsw1HzI1w=
knative.dev/pkg v0.0.0-20240513091600-b1fd04d5c458/go.mod h1:fkgcK/71v1QSJza7pCOxtuk7zSsWYPQ7eiuX8M2wXxs=
knative.dev/serving v0.41.1-0.20240509134134-3789ff9cc0f0 h1:0CKFqFj8/7LZC4TX/VCbrT3d3J7BJKRIay3jt49D+UE=
knative.dev/serving v0.41.1-0.20240509134134-3789ff9cc0f0/go.mod h1:5E+DXwl+tmCpfKVV6Qmn3n6O9q5FPeTHtY5BP0P5Oes=
knative.dev/serving v0.41.1-0.20240513193715-40088e3e93fa h1:z38GplfYVc2Kk4eH+5SaXxaN9yYjQnrwuAkqRpHskHA=
knative.dev/serving v0.41.1-0.20240513193715-40088e3e93fa/go.mod h1:QEeLyTYCODEC44bFpU/4YroZ6UV2FKqVeZUFSKUT4hk=
nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0=
pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw=
pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,88 @@ limitations under the License.
package testing

import (
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/api/rbac/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

func CreateRoleBinding(namespace, roleName string, sa *corev1.ServiceAccount) *v1.RoleBinding {
return &v1.RoleBinding{
// RoleBindingOption enables further configuration of a RoleBinding.
type RoleBindingOption func(*v1.RoleBinding)
type SubjectOption func(*v1.Subject)
type RoleRefOption func(*v1.RoleRef)

func CreateRoleBinding(roleName, namespace string, o ...RoleBindingOption) *v1.RoleBinding {
rb := &v1.RoleBinding{
ObjectMeta: metav1.ObjectMeta{
Name: roleName + "-binding",
Namespace: namespace,
},
Subjects: []v1.Subject{
{
Kind: "ServiceAccount",
Name: sa.Name,
},
},
RoleRef: v1.RoleRef{
APIGroup: "rbac.authorization.k8s.io",
Kind: "Role",
Name: roleName,
},
Subjects: []v1.Subject{},
RoleRef: v1.RoleRef{},
}
for _, opt := range o {
opt(rb)
}
return rb
}

func WithRoleBindingSubjects(subjects ...*v1.Subject) RoleBindingOption {
s := make([]v1.Subject, 0, len(subjects))
for _, subject := range subjects {
s = append(s, *subject)
}
return func(rb *v1.RoleBinding) {
rb.Subjects = s
}
}

func WithSubjects(o ...SubjectOption) *v1.Subject {
s := &v1.Subject{}
for _, opt := range o {
opt(s)
}
return s
}

func WithSubjectKind(kind string) SubjectOption {
return func(s *v1.Subject) {
s.Kind = kind
}
}

func WithSubjectName(name string) SubjectOption {
return func(s *v1.Subject) {
s.Name = name
}
}

func WithRoleBindingRoleRef(roleRef *v1.RoleRef) RoleBindingOption {
return func(rb *v1.RoleBinding) {
rb.RoleRef = *roleRef
}
}

func WithRoleRef(o ...RoleRefOption) *v1.RoleRef {
rr := &v1.RoleRef{}
for _, opt := range o {
opt(rr)
}
return rr
}

func WithRoleRefAPIGroup(apiGroup string) RoleRefOption {
return func(rr *v1.RoleRef) {
rr.APIGroup = apiGroup
}
}

func WithRoleRefKind(kind string) RoleRefOption {
return func(rr *v1.RoleRef) {
rr.Kind = kind
}
}

func WithRoleRefName(name string) RoleRefOption {
return func(rr *v1.RoleRef) {
rr.Name = name
}
}
56 changes: 48 additions & 8 deletions vendor/knative.dev/eventing/pkg/reconciler/testing/v1/roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,57 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// RoleOption enables further configuration of a Role.
type RoleOption func(*v1.Role)
type PolicyRuleOption func(*v1.PolicyRule)

// createRole creates a Role in the Kubernetes cluster.
func CreateRole(namespace, roleName, verbs, resources, apiGroup string) *v1.Role {
return &v1.Role{
func CreateRole(name, namespace string, o ...RoleOption) *v1.Role {
r := &v1.Role{
ObjectMeta: metav1.ObjectMeta{
Name: roleName,
Name: name,
Namespace: namespace,
},
Rules: []v1.PolicyRule{{
APIGroups: []string{apiGroup},
Resources: []string{resources},
Verbs: []string{verbs},
}},
Rules: []v1.PolicyRule{},
}
for _, opt := range o {
opt(r)
}
return r
}

func WithRoleRules(rules ...*v1.PolicyRule) RoleOption {
roleRules := make([]v1.PolicyRule, 0, len(rules))
for _, rule := range rules {
roleRules = append(roleRules, *rule)
}
return func(r *v1.Role) {
r.Rules = roleRules
}
}

func WithPolicyRule(o ...PolicyRuleOption) *v1.PolicyRule {
pr := &v1.PolicyRule{}
for _, opt := range o {
opt(pr)
}
return pr
}

func WithAPIGroups(apiGroups []string) PolicyRuleOption {
return func(r *v1.PolicyRule) {
r.APIGroups = apiGroups
}
}

func WithResources(resources ...string) PolicyRuleOption {
return func(r *v1.PolicyRule) {
r.Resources = resources
}
}

func WithVerbs(verbs ...string) PolicyRuleOption {
return func(r *v1.PolicyRule) {
r.Verbs = verbs
}
}
7 changes: 7 additions & 0 deletions vendor/knative.dev/serving/test/e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ immediate_gc
go_test_e2e -timeout=2m ./test/e2e/gc ${E2E_TEST_FLAGS} || failed=1
kubectl replace cm "config-gc" -n ${SYSTEM_NAMESPACE} -f "${TMP_DIR}"/config-gc.yaml

# Run tests with CORS policy enabled for Contour
if [[ "${INGRESS_CLASS}" == *"contour"* ]]; then
toggle_feature cors-policy "allowOrigin:\n - '*'\nallowMethods:\n - GET\n - OPTIONS\n" config-contour || fail_test
go_test_e2e -timeout=2m ./test/e2e/corspolicy ${E2E_TEST_FLAGS} || failed=1
toggle_feature cors-policy "" config-contour || fail_test
fi

# Run scale tests.
# Note that we use a very high -parallel because each ksvc is run as its own
# sub-test. If this is not larger than the maximum scale tested then the test
Expand Down
8 changes: 4 additions & 4 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1315,11 +1315,11 @@ k8s.io/utils/pointer
k8s.io/utils/ptr
k8s.io/utils/strings/slices
k8s.io/utils/trace
# knative.dev/caching v0.0.0-20240508055410-7dad151e150b
# knative.dev/caching v0.0.0-20240513135106-1a6c1c714c18
## explicit; go 1.21
knative.dev/caching/pkg/apis/caching
knative.dev/caching/pkg/apis/caching/v1alpha1
# knative.dev/eventing v0.41.1-0.20240510202101-157296784e29
# knative.dev/eventing v0.41.1-0.20240513180348-43585745f326
## explicit; go 1.21
knative.dev/eventing/pkg/apis/config
knative.dev/eventing/pkg/apis/duck
Expand Down Expand Up @@ -1418,7 +1418,7 @@ knative.dev/eventing/test/upgrade/prober/wathola/sender
# knative.dev/hack v0.0.0-20240507013718-68e3bfb39d11
## explicit; go 1.18
knative.dev/hack
# knative.dev/networking v0.0.0-20240507054121-81677991de8a
# knative.dev/networking v0.0.0-20240508055612-25012a498278
## explicit; go 1.21
knative.dev/networking/pkg
knative.dev/networking/pkg/apis/networking
Expand Down Expand Up @@ -1516,7 +1516,7 @@ knative.dev/pkg/webhook
knative.dev/pkg/webhook/certificates
knative.dev/pkg/webhook/certificates/resources
knative.dev/pkg/webhook/resourcesemantics/conversion
# knative.dev/serving v0.41.1-0.20240509134134-3789ff9cc0f0
# knative.dev/serving v0.41.1-0.20240513193715-40088e3e93fa
## explicit; go 1.21
knative.dev/serving/pkg/apis/autoscaling
knative.dev/serving/pkg/apis/autoscaling/v1alpha1
Expand Down

0 comments on commit 5d8698a

Please sign in to comment.