Skip to content

Commit

Permalink
Merge branch 'kubernetes:master' into add-errcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelasp authored Aug 23, 2022
2 parents f02492a + 94e5e61 commit 1e774b0
Show file tree
Hide file tree
Showing 138 changed files with 2,717 additions and 2,584 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ARCH ?= amd64
ALL_ARCH := amd64

# Image to use for building.
BUILD_IMAGE ?= golang:1.16-alpine
BUILD_IMAGE ?= golang:1.18-alpine
# Containers will be named: $(CONTAINER_PREFIX)-$(BINARY)-$(ARCH):$(VERSION).
CONTAINER_PREFIX ?= ingress-gce

Expand Down
2 changes: 1 addition & 1 deletion cmd/e2e-test/draining_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
)

const (
drainingTransitionPollTimeout = 10 * time.Minute
drainingTransitionPollTimeout = 15 * time.Minute
drainingTansitionPollInterval = 30 * time.Second
)

Expand Down
7 changes: 5 additions & 2 deletions cmd/glbc/app/namer.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ func NewStaticNamer(kubeClient kubernetes.Interface, clusterName, fwName string)
// a name from a ConfigMap. The returned value follows this priority:
//
// If the provided 'defaultName' is not empty, that name is used.
// This is effectively a client override via a command line flag.
//
// This is effectively a client override via a command line flag.
//
// else, check cfgVault with 'configMapKey' as a key and if found, use the associated value
// else, return an empty 'name' and pass along an error iff the configmap lookup is erroneous.
func useDefaultOrLookupVault(cfgVault *storage.ConfigMapVault, configMapKey, defaultName string) (string, error) {
Expand Down Expand Up @@ -150,7 +152,8 @@ func getFirewallName(kubeClient kubernetes.Interface, name, clusterUID string) (
// If the user specifies a --cluster-uid param it overwrites everything
// else, check UID config map for a previously recorded uid
// else, check if there are any working Ingresses
// - remember that "" is the cluster uid
// - remember that "" is the cluster uid
//
// else, allocate a new uid
func getClusterUID(kubeClient kubernetes.Interface, name string) (string, error) {
cfgVault := storage.NewConfigMapVault(kubeClient, metav1.NamespaceSystem, uidConfigMapName)
Expand Down
2 changes: 1 addition & 1 deletion cmd/glbc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ func makeLeaderElectionConfig(ctx *ingctx.ControllerContext, client clientset.In
id := fmt.Sprintf("%v_%x", hostname, rand.Intn(1e6))
// TODO(#1590): Migrate to LeasesResourceLock two releases after the
// migration to ConfigMapsLeases were done.
rl, err := resourcelock.New(resourcelock.ConfigMapsLeasesResourceLock,
rl, err := resourcelock.New(resourcelock.LeasesResourceLock,
flags.F.LeaderElection.LockObjectNamespace,
flags.F.LeaderElection.LockObjectName,
client.CoreV1(),
Expand Down
64 changes: 58 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
module k8s.io/ingress-gce

go 1.16
go 1.18

require (
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/GoogleCloudPlatform/k8s-cloud-provider v1.18.1-0.20220218231025-f11817397a1b
github.com/go-openapi/spec v0.19.3
github.com/google/go-cmp v0.5.6
github.com/imdario/mergo v0.3.7 // indirect
github.com/kr/pretty v0.2.0
github.com/prometheus/client_golang v1.7.1
github.com/prometheus/client_model v0.2.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.7.0
golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1
google.golang.org/api v0.60.0
gopkg.in/gcfg.v1 v1.2.3 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
istio.io/api v0.0.0-20190809125725-591cf32c1d0e
k8s.io/api v0.22.2
k8s.io/apiextensions-apiserver v0.20.0
Expand All @@ -29,3 +24,60 @@ require (
k8s.io/legacy-cloud-providers v0.20.0
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9
)

require (
cloud.google.com/go v0.97.0 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/census-instrumentation/opencensus-proto v0.2.1 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403 // indirect
github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful v2.9.5+incompatible // indirect
github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0 // indirect
github.com/envoyproxy/protoc-gen-validate v0.1.0 // indirect
github.com/evanphx/json-patch v4.11.0+incompatible // indirect
github.com/go-logr/logr v1.2.0 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.3 // indirect
github.com/go-openapi/swag v0.19.5 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/googleapis/gax-go/v2 v2.1.1 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/imdario/mergo v0.3.7 // indirect
github.com/json-iterator/go v1.1.11 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mailru/easyjson v0.7.0 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/common v0.10.0 // indirect
github.com/prometheus/procfs v0.2.0 // indirect
go.opencensus.io v0.23.0 // indirect
golang.org/x/net v0.0.0-20210520170846-37e1c6afe023 // indirect
golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359 // indirect
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect
golang.org/x/text v0.3.6 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20211021150943-2b146023228c // indirect
google.golang.org/grpc v1.40.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/gcfg.v1 v1.2.3 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
)
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBp
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20200415212048-7901bc822317/go.mod h1:DF8FZRxMHMGv/vP2lQP6h+dYzzjpuRn24VeRiYn3qjQ=
github.com/GoogleCloudPlatform/k8s-cloud-provider v1.18.0 h1:bmLVE4VV8Zcx5iRDkCVsWhP3DOQHfnkUs8jGp3kOJKc=
github.com/GoogleCloudPlatform/k8s-cloud-provider v1.18.0/go.mod h1:FNj4KYEAAHfYu68kRYolGoxkaJn+6mdEsaM12VTwuI0=
github.com/GoogleCloudPlatform/k8s-cloud-provider v1.18.1-0.20220218231025-f11817397a1b h1:Heo1J/ttaQFgGJSVnCZquy3e5eH5j1nqxBuomztB3P0=
github.com/GoogleCloudPlatform/k8s-cloud-provider v1.18.1-0.20220218231025-f11817397a1b/go.mod h1:FNj4KYEAAHfYu68kRYolGoxkaJn+6mdEsaM12VTwuI0=
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
Expand Down Expand Up @@ -982,8 +980,6 @@ k8s.io/client-go v0.22.2 h1:DaSQgs02aCC1QcwUdkKZWOeaVsQjYvWv8ZazcZ6JcHc=
k8s.io/client-go v0.22.2/go.mod h1:sAlhrkVDf50ZHx6z4K0S40wISNTarf1r800F+RlCF6U=
k8s.io/cloud-provider v0.20.0 h1:CVPQ66iyfNgeGomUq2jE/TWrfzE77bdCpemhFS8955U=
k8s.io/cloud-provider v0.20.0/go.mod h1:Lz/luSVD5BrHDDhtVdjFh0C2qQCRYdf0b9BHQ9L+bXc=
k8s.io/cloud-provider-gcp v0.21.0 h1:dZUWxMltT/PLYmvmA00O5M4ug+8bDFmA054aVa9tna0=
k8s.io/cloud-provider-gcp/providers v0.21.1 h1:eUgGWakdxS7+yNrldf5zcY+3SfFRiVltnV/mBof/fsw=
k8s.io/code-generator v0.20.0/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg=
k8s.io/component-base v0.20.0 h1:BXGL8iitIQD+0NgW49UsM7MraNUUGDU3FBmrfUAtmVQ=
k8s.io/component-base v0.20.0/go.mod h1:wKPj+RHnAr8LW2EIBIK7AxOHPde4gme2lzXwVSoRXeA=
Expand Down
16 changes: 9 additions & 7 deletions pkg/annotations/destination_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@ package annotations

import "encoding/json"

//PortSubsetNegMap is the mapping between subset to NEG name.
// PortSubsetNegMap is the mapping between subset to NEG name.
type PortSubsetNegMap map[string]map[string]string

// DestinationRuleNEGStatus holds the NEGs Zones info.
// NetworkEndpointGroups(PortSubsetNegMap) is the mapping between subset to NEG name.
// Structure:
// {
// "subsetv1": {
// "9080": "somehash-default-reviews-v1-9080",
// }
// "v2": {
// "9080": "somehash-default-reviews-v2-9080",
// }
//
// "subsetv1": {
// "9080": "somehash-default-reviews-v1-9080",
// }
// "v2": {
// "9080": "somehash-default-reviews-v2-9080",
// }
//
// }
type DestinationRuleNEGStatus struct {
NetworkEndpointGroups PortSubsetNegMap `json:"network_endpoint_groups,omitempty"`
Expand Down
23 changes: 15 additions & 8 deletions pkg/apis/backendconfig/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@ type BackendConfig struct {
// BackendConfigSpec is the spec for a BackendConfig resource
// +k8s:openapi-gen=true
type BackendConfigSpec struct {
Iap *IAPConfig `json:"iap,omitempty"`
Cdn *CDNConfig `json:"cdn,omitempty"`
SecurityPolicy *SecurityPolicyConfig `json:"securityPolicy,omitempty"`
TimeoutSec *int64 `json:"timeoutSec,omitempty"`
ConnectionDraining *ConnectionDrainingConfig `json:"connectionDraining,omitempty"`
SessionAffinity *SessionAffinityConfig `json:"sessionAffinity,omitempty"`
CustomRequestHeaders *CustomRequestHeadersConfig `json:"customRequestHeaders,omitempty"`
HealthCheck *HealthCheckConfig `json:"healthCheck,omitempty"`
Iap *IAPConfig `json:"iap,omitempty"`
Cdn *CDNConfig `json:"cdn,omitempty"`
SecurityPolicy *SecurityPolicyConfig `json:"securityPolicy,omitempty"`
TimeoutSec *int64 `json:"timeoutSec,omitempty"`
ConnectionDraining *ConnectionDrainingConfig `json:"connectionDraining,omitempty"`
SessionAffinity *SessionAffinityConfig `json:"sessionAffinity,omitempty"`
CustomRequestHeaders *CustomRequestHeadersConfig `json:"customRequestHeaders,omitempty"`
CustomResponseHeaders *CustomResponseHeadersConfig `json:"customResponseHeaders,omitempty"`
HealthCheck *HealthCheckConfig `json:"healthCheck,omitempty"`
// Logging specifies the configuration for access logs.
Logging *LogConfig `json:"logging,omitempty"`
}
Expand Down Expand Up @@ -197,6 +198,12 @@ type CustomRequestHeadersConfig struct {
Headers []string `json:"headers,omitempty"`
}

// CustomResponseHeadersConfig contains configuration for custom response headers
// +k8s:openapi-gen=true
type CustomResponseHeadersConfig struct {
Headers []string `json:"headers,omitempty"`
}

// HealthCheckConfig contains configuration for the health check.
// +k8s:openapi-gen=true
type HealthCheckConfig struct {
Expand Down
27 changes: 27 additions & 0 deletions pkg/apis/backendconfig/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 50 additions & 16 deletions pkg/apis/backendconfig/v1/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/apis/backendconfig/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/apis/backendconfig/v1beta1/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/apis/frontendconfig/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/apis/frontendconfig/v1beta1/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/apis/ingparams/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1e774b0

Please sign in to comment.