Skip to content

Commit

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

Signed-off-by: 1gtm <1gtm@appscode.com>
  • Loading branch information
1gtm committed Oct 28, 2020
1 parent 3a803f8 commit 02c39c0
Show file tree
Hide file tree
Showing 9 changed files with 289 additions and 129 deletions.
4 changes: 2 additions & 2 deletions go.mod
Expand Up @@ -42,10 +42,10 @@ require (
k8s.io/client-go v12.0.0+incompatible
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
kubedb.dev/apimachinery v0.14.0-beta.2
sigs.k8s.io/yaml v1.2.0
stash.appscode.dev/apimachinery v0.11.3
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Expand Up @@ -1304,6 +1304,8 @@ kmodules.xyz/client-go v0.0.0-20200903033732-dab39b86c81b/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-20200521005638-2433a187de95 h1:v0S/+ftzL6Xrs9XevgchAOJyPKlRQXPiZf87xotj3X4=
kmodules.xyz/crd-schema-fuzz v0.0.0-20200521005638-2433a187de95/go.mod h1:jpu8xFsDKd6kAWUAKk8oTu/GQGBWqhrcaDeOJdaCJnk=
Expand All @@ -1322,6 +1324,8 @@ kmodules.xyz/offshoot-api v0.0.0-20200521035628-e135bf07b226 h1:RZ7H0gl1z/9jLI74
kmodules.xyz/offshoot-api v0.0.0-20200521035628-e135bf07b226/go.mod h1:IbK+hCI23UfTDMzG7hos9sERCase2xsFK+XC0Ns3OCg=
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/openshift v0.0.0-20200522123204-ce4abf5433c8/go.mod h1:nVhGcoB3Bi7Ots5+g972Ap/vtyIrrtoK3Z3aulNux7w=
kmodules.xyz/prober v0.0.0-20200521101241-adf06150535c h1:aV6O9NbDpnFVra/D8c7b7TjI05w/CyI5CYJ8IBg6lg8=
kmodules.xyz/prober v0.0.0-20200521101241-adf06150535c/go.mod h1:XYWZkfQquD09Mn+O7piHS+SEPq9oFV1Wy2WZ9DA+oeA=
Expand Down
12 changes: 9 additions & 3 deletions vendor/kmodules.xyz/client-go/core/v1/service.go
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
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
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 02c39c0

Please sign in to comment.