Skip to content

Commit

Permalink
Pull request kubernetes-sigs#1: DELIVERY-8202 pull upstream
Browse files Browse the repository at this point in the history
Merge in DEL/aws-load-balancer-controller-fork from DELIVERY-8202_pull_upstream to main

* commit '49805eac72ec533acdbc2580d6f57c68a9cad45c':
  update the default base image (kubernetes-sigs#3075)
  update recommended IAM policy template (kubernetes-sigs#3068)
  update to discovery.k8s.io/v1 (kubernetes-sigs#3072)
  validation ingress condition annotation in validation webhook (kubernetes-sigs#2735)
  Fix conciseLogger's incorrect call to variadic func (kubernetes-sigs#3066)
  Verify CRDs are up to date in merge check (kubernetes-sigs#3022)
  Refactor model builder test (kubernetes-sigs#3024)
  • Loading branch information
guildencrantz committed Mar 1, 2023
2 parents cd94fdc + 49805ea commit 2e1239a
Show file tree
Hide file tree
Showing 20 changed files with 2,107 additions and 3,341 deletions.
2 changes: 1 addition & 1 deletion .ko.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defaultBaseImage: public.ecr.aws/eks-distro-build-tooling/eks-distro-minimal-base-nonroot:2022-07-27-1658910674.2
defaultBaseImage: public.ecr.aws/eks-distro-build-tooling/eks-distro-minimal-base-nonroot:2023-02-22-1677092456.2
builds:
- env:
- CGO_ENABLED=0
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,17 @@ lint:
echo "TODO"

.PHONY: quick-ci
quick-ci: verify-versions verify-generate
quick-ci: verify-versions verify-generate verify-crds
echo "Done!"

.PHONY: verify-generate
verify-generate:
hack/verify-generate.sh

.PHONY: verify-crds
verify-crds:
hack/verify-crds.sh

.PHONY: verify-versions
verify-versions:
hack/verify-versions.sh
Expand Down
2 changes: 1 addition & 1 deletion controllers/elbv2/eventhandlers/endpointslices.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/go-logr/logr"
"github.com/pkg/errors"
discv1 "k8s.io/api/discovery/v1beta1"
discv1 "k8s.io/api/discovery/v1"
"k8s.io/apimachinery/pkg/api/equality"
"k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/util/workqueue"
Expand Down
2 changes: 1 addition & 1 deletion controllers/elbv2/eventhandlers/endpointslices_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/golang/mock/gomock"
"github.com/google/go-cmp/cmp"
"github.com/stretchr/testify/assert"
discv1 "k8s.io/api/discovery/v1beta1"
discv1 "k8s.io/api/discovery/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/util/workqueue"
Expand Down
2 changes: 1 addition & 1 deletion controllers/elbv2/targetgroupbinding_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/pkg/errors"
corev1 "k8s.io/api/core/v1"
discv1 "k8s.io/api/discovery/v1beta1"
discv1 "k8s.io/api/discovery/v1"
"k8s.io/client-go/tools/record"
"k8s.io/client-go/util/workqueue"
"sigs.k8s.io/aws-load-balancer-controller/controllers/elbv2/eventhandlers"
Expand Down
22 changes: 22 additions & 0 deletions docs/install/iam_policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,28 @@
}
}
},
{
"Effect": "Allow",
"Action": [
"elasticloadbalancing:AddTags"
],
"Resource": [
"arn:aws:elasticloadbalancing:*:*:targetgroup/*/*",
"arn:aws:elasticloadbalancing:*:*:loadbalancer/net/*/*",
"arn:aws:elasticloadbalancing:*:*:loadbalancer/app/*/*"
],
"Condition": {
"StringEquals": {
"elasticloadbalancing:CreateAction": [
"CreateTargetGroup",
"CreateLoadBalancer"
]
},
"Null": {
"aws:RequestTag/elbv2.k8s.aws/cluster": "false"
}
}
},
{
"Effect": "Allow",
"Action": [
Expand Down
22 changes: 22 additions & 0 deletions docs/install/iam_policy_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,28 @@
"arn:aws-cn:elasticloadbalancing:*:*:listener-rule/app/*/*/*"
]
},
{
"Effect": "Allow",
"Action": [
"elasticloadbalancing:AddTags"
],
"Resource": [
"arn:aws-cn:elasticloadbalancing:*:*:targetgroup/*/*",
"arn:aws-cn:elasticloadbalancing:*:*:loadbalancer/net/*/*",
"arn:aws-cn:elasticloadbalancing:*:*:loadbalancer/app/*/*"
],
"Condition": {
"StringEquals": {
"elasticloadbalancing:CreateAction": [
"CreateTargetGroup",
"CreateLoadBalancer"
]
},
"Null": {
"aws:RequestTag/elbv2.k8s.aws/cluster": "false"
}
}
},
{
"Effect": "Allow",
"Action": [
Expand Down
22 changes: 22 additions & 0 deletions docs/install/iam_policy_us-gov.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,28 @@
"arn:aws-us-gov:elasticloadbalancing:*:*:listener-rule/app/*/*/*"
]
},
{
"Effect": "Allow",
"Action": [
"elasticloadbalancing:AddTags"
],
"Resource": [
"arn:aws-us-gov:elasticloadbalancing:*:*:targetgroup/*/*",
"arn:aws-us-gov:elasticloadbalancing:*:*:loadbalancer/net/*/*",
"arn:aws-us-gov:elasticloadbalancing:*:*:loadbalancer/app/*/*"
],
"Condition": {
"StringEquals": {
"elasticloadbalancing:CreateAction": [
"CreateTargetGroup",
"CreateLoadBalancer"
]
},
"Null": {
"aws:RequestTag/elbv2.k8s.aws/cluster": "false"
}
}
},
{
"Effect": "Allow",
"Action": [
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ go 1.19

require (
github.com/aws/aws-sdk-go v1.44.184
github.com/evanphx/json-patch v5.6.0+incompatible
github.com/gavv/httpexpect/v2 v2.9.0
github.com/go-logr/logr v1.2.3
github.com/golang/mock v1.6.0
Expand All @@ -23,6 +24,7 @@ require (
k8s.io/cli-runtime v0.26.1
k8s.io/client-go v0.26.1
sigs.k8s.io/controller-runtime v0.14.1
sigs.k8s.io/yaml v1.3.0
)

require (
Expand Down Expand Up @@ -50,7 +52,6 @@ require (
github.com/docker/go-metrics v0.0.1 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
github.com/fatih/color v1.7.0 // indirect
Expand Down Expand Up @@ -160,5 +161,4 @@ require (
sigs.k8s.io/kustomize/api v0.12.1 // indirect
sigs.k8s.io/kustomize/kyaml v0.13.9 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
32 changes: 32 additions & 0 deletions hack/verify-crds.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env bash

# Copyright 2023 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -o errexit
set -o nounset
set -o pipefail

make crds

changed_files=$(git status --porcelain --untracked-files=no || true)
if [ -n "${changed_files}" ]; then
echo "Detected that CRD generation is needed; run 'make crds'"
echo "changed files:"
printf "%s\n" "${changed_files}"
echo "git diff:"
git --no-pager diff
echo "To fix: run 'make crds'"
exit 1
fi
Loading

0 comments on commit 2e1239a

Please sign in to comment.