Skip to content

Commit

Permalink
[cherry-pick] Update Kubernetes v1.18.9 dependencies (#199) (#202)
Browse files Browse the repository at this point in the history
/cherry-pick

Signed-off-by: 1gtm <1gtm@appscode.com>
  • Loading branch information
1gtm authored Oct 28, 2020
1 parent 7699793 commit 0679bff
Show file tree
Hide file tree
Showing 9 changed files with 289 additions and 129 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ require (
k8s.io/client-go v0.18.9
k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6
k8s.io/utils v0.0.0-20200414100711-2df71ebbae66 // indirect
kmodules.xyz/client-go v0.0.0-20201021051118-03dac1aea508
kmodules.xyz/client-go v0.0.0-20201027113349-01a6d453d836
kmodules.xyz/crd-schema-fuzz v0.0.0-20200922204806-c1426cd7fcf4
kmodules.xyz/custom-resources v0.0.0-20201008012351-6d8090f759d4
kmodules.xyz/offshoot-api v0.0.0-20200922211229-36acc531abab
kmodules.xyz/offshoot-api v0.0.0-20201027212804-f5e6dc573558
sigs.k8s.io/yaml v1.2.0
stash.appscode.dev/apimachinery v0.11.3
)
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,8 @@ kmodules.xyz/client-go v0.0.0-20200818143024-600fef263e03/go.mod h1:sY/eoe4ktxZE
kmodules.xyz/client-go v0.0.0-20200922200830-63d86b6e5b63/go.mod h1:JZN34jqk6ZlR+QOnBPpnUVBab4rmfamqxfSvLaulBMY=
kmodules.xyz/client-go v0.0.0-20201021051118-03dac1aea508 h1:LjidyEzvw1rSlwRQLWNfElleLJ6vr9Uu5tn5H6JO+QA=
kmodules.xyz/client-go v0.0.0-20201021051118-03dac1aea508/go.mod h1:pnRh7gtJ6ErPJQBkQeRlpD95KRtxhD4eGrYagZEU8RM=
kmodules.xyz/client-go v0.0.0-20201027113349-01a6d453d836 h1:oRtOV4teHgELaRJx+mjkpjlO03S9xl1g020RUoU4FDI=
kmodules.xyz/client-go v0.0.0-20201027113349-01a6d453d836/go.mod h1:pnRh7gtJ6ErPJQBkQeRlpD95KRtxhD4eGrYagZEU8RM=
kmodules.xyz/constants v0.0.0-20200506032633-a21e58ceec72/go.mod h1:DbiFk1bJ1KEO94t1SlAn7tzc+Zz95rSXgyUKa2nzPmY=
kmodules.xyz/crd-schema-fuzz v0.0.0-20200922204806-c1426cd7fcf4 h1:NWWv+Qju8xzHZT9hIk1+BbgQtIytNOoCU4g4vqUmh3M=
kmodules.xyz/crd-schema-fuzz v0.0.0-20200922204806-c1426cd7fcf4/go.mod h1:WrO3fryNyFCgqqyWnwI89lnzWA7kN072Ehya7ELGfzE=
Expand All @@ -969,6 +971,8 @@ kmodules.xyz/objectstore-api v0.0.0-20200922210707-59bab27e5d41 h1:BsCSSPoY0uRGy
kmodules.xyz/objectstore-api v0.0.0-20200922210707-59bab27e5d41/go.mod h1:XAWxC/b1ICoufU6XDV0AOHNQY+y+4/B3Z5uyLnW1B6s=
kmodules.xyz/offshoot-api v0.0.0-20200922211229-36acc531abab h1:d/4AFAN0TfKgwhjbQYzwXXHT/5/vTP7SAAvS4uJX+wQ=
kmodules.xyz/offshoot-api v0.0.0-20200922211229-36acc531abab/go.mod h1:Wy3/mWK2lWQOviKVpBtiCEYtLaYIaSiym8leZNKBUd4=
kmodules.xyz/offshoot-api v0.0.0-20201027212804-f5e6dc573558 h1:/gk1vlGimdRj3fYS2NUsoV4UKQxW/I2ORXssnz2sBNI=
kmodules.xyz/offshoot-api v0.0.0-20201027212804-f5e6dc573558/go.mod h1:+tGJRjfzEFm01qWQZcmTkFhB5dWA1jKHXnlUS6O4ZkQ=
kmodules.xyz/prober v0.0.0-20200922212142-743a6514664e h1:NASVP0dOE5Zdlq+3Op7Fh2Yc8ei32uf9PxEbuwGLQm0=
kmodules.xyz/prober v0.0.0-20200922212142-743a6514664e/go.mod h1:AZ58K5hrxkkNPf8tM+UWeZjtNG3/mn192nKcUyC93F8=
modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw=
Expand Down
12 changes: 9 additions & 3 deletions vendor/kmodules.xyz/client-go/core/v1/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,24 +106,30 @@ func MergeServicePorts(cur, desired []core.ServicePort) []core.ServicePort {
}

// ports
curPorts := make(map[int32]core.ServicePort)
curPorts := make(map[string]core.ServicePort)
for _, p := range cur {
curPorts[p.Port] = p
curPorts[p.Name] = p
}
for i, dp := range desired {
cp, ok := curPorts[dp.Port]
cp, ok := curPorts[dp.Name]

// svc port not found
if !ok {
continue
}

if dp.Port == 0 {
dp.Port = cp.Port
}
if dp.NodePort == 0 {
dp.NodePort = cp.NodePort // avoid reassigning port
}
if dp.Protocol == "" {
dp.Protocol = cp.Protocol
}
if dp.AppProtocol == nil {
dp.AppProtocol = cp.AppProtocol
}
desired[i] = dp
}
return desired
Expand Down
340 changes: 220 additions & 120 deletions vendor/kmodules.xyz/offshoot-api/api/v1/generated.pb.go

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions vendor/kmodules.xyz/offshoot-api/api/v1/generated.proto

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

15 changes: 14 additions & 1 deletion vendor/kmodules.xyz/offshoot-api/api/v1/openapi_generated.go

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

19 changes: 18 additions & 1 deletion vendor/kmodules.xyz/offshoot-api/api/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,21 @@ type PodSpec struct {
// Cannot be updated.
// +optional
Lifecycle *core.Lifecycle `json:"lifecycle,omitempty" protobuf:"bytes,16,opt,name=lifecycle"`

// Set DNS policy for the pod.
// Defaults to "ClusterFirst".
// Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'.
// DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy.
// To have DNS options set along with hostNetwork, you have to specify DNS policy
// explicitly to 'ClusterFirstWithHostNet'.
// +optional
DNSPolicy core.DNSPolicy `json:"dnsPolicy,omitempty" protobuf:"bytes,17,opt,name=dnsPolicy,casttype=k8s.io/api/core/v1.DNSPolicy"`

// Specifies the DNS parameters of a pod.
// Parameters specified here will be merged to the generated DNS
// configuration based on DNSPolicy.
// +optional
DNSConfig *core.PodDNSConfig `json:"dnsConfig,omitempty" protobuf:"bytes,18,opt,name=dnsConfig"`
}

// ServiceTemplateSpec describes the data a service should have when created from a template
Expand Down Expand Up @@ -276,7 +291,9 @@ type ServicePort struct {
NodePort int32 `json:"nodePort,omitempty" protobuf:"varint,3,opt,name=nodePort"`
}

func MergeServicePorts(cur []core.ServicePort, desired []ServicePort) []core.ServicePort {
// Beware of MergeServicePorts
// ref: https://github.com/kmodules/client-go/blob/03dac1aea5084354127990a10d0b0e7529460dd5/core/v1/service.go#L103-L136
func PatchServicePorts(cur []core.ServicePort, desired []ServicePort) []core.ServicePort {
if len(desired) == 0 {
return cur
}
Expand Down

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

4 changes: 2 additions & 2 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ k8s.io/utils/net
k8s.io/utils/path
k8s.io/utils/pointer
k8s.io/utils/trace
# kmodules.xyz/client-go v0.0.0-20201021051118-03dac1aea508
# kmodules.xyz/client-go v0.0.0-20201027113349-01a6d453d836
kmodules.xyz/client-go
kmodules.xyz/client-go/api/v1
kmodules.xyz/client-go/apiextensions
Expand All @@ -869,7 +869,7 @@ kmodules.xyz/custom-resources/client/clientset/versioned/typed/appcatalog/v1alph
kmodules.xyz/custom-resources/crds
# kmodules.xyz/objectstore-api v0.0.0-20200922210707-59bab27e5d41
kmodules.xyz/objectstore-api/api/v1
# kmodules.xyz/offshoot-api v0.0.0-20200922211229-36acc531abab
# kmodules.xyz/offshoot-api v0.0.0-20201027212804-f5e6dc573558
kmodules.xyz/offshoot-api/api/v1
# kmodules.xyz/prober v0.0.0-20200922212142-743a6514664e
kmodules.xyz/prober/api/v1
Expand Down

0 comments on commit 0679bff

Please sign in to comment.