Skip to content

Commit 6b58712

Browse files
authored
[cherry-pick] Update Kubernetes v1.18.9 dependencies (#407) (#413)
/cherry-pick Signed-off-by: 1gtm <1gtm@appscode.com>
1 parent 588169f commit 6b58712

File tree

9 files changed

+289
-129
lines changed

9 files changed

+289
-129
lines changed

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ require (
4444
k8s.io/client-go v0.18.9
4545
k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6
4646
k8s.io/utils v0.0.0-20200414100711-2df71ebbae66 // indirect
47-
kmodules.xyz/client-go v0.0.0-20201021051118-03dac1aea508
47+
kmodules.xyz/client-go v0.0.0-20201027113349-01a6d453d836
4848
kmodules.xyz/crd-schema-fuzz v0.0.0-20200922204806-c1426cd7fcf4
4949
kmodules.xyz/custom-resources v0.0.0-20201008012351-6d8090f759d4
50-
kmodules.xyz/offshoot-api v0.0.0-20200922211229-36acc531abab
50+
kmodules.xyz/offshoot-api v0.0.0-20201027212804-f5e6dc573558
5151
sigs.k8s.io/yaml v1.2.0
5252
stash.appscode.dev/apimachinery v0.11.3
5353
)

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -973,6 +973,8 @@ kmodules.xyz/client-go v0.0.0-20200818143024-600fef263e03/go.mod h1:sY/eoe4ktxZE
973973
kmodules.xyz/client-go v0.0.0-20200922200830-63d86b6e5b63/go.mod h1:JZN34jqk6ZlR+QOnBPpnUVBab4rmfamqxfSvLaulBMY=
974974
kmodules.xyz/client-go v0.0.0-20201021051118-03dac1aea508 h1:LjidyEzvw1rSlwRQLWNfElleLJ6vr9Uu5tn5H6JO+QA=
975975
kmodules.xyz/client-go v0.0.0-20201021051118-03dac1aea508/go.mod h1:pnRh7gtJ6ErPJQBkQeRlpD95KRtxhD4eGrYagZEU8RM=
976+
kmodules.xyz/client-go v0.0.0-20201027113349-01a6d453d836 h1:oRtOV4teHgELaRJx+mjkpjlO03S9xl1g020RUoU4FDI=
977+
kmodules.xyz/client-go v0.0.0-20201027113349-01a6d453d836/go.mod h1:pnRh7gtJ6ErPJQBkQeRlpD95KRtxhD4eGrYagZEU8RM=
976978
kmodules.xyz/constants v0.0.0-20200506032633-a21e58ceec72/go.mod h1:DbiFk1bJ1KEO94t1SlAn7tzc+Zz95rSXgyUKa2nzPmY=
977979
kmodules.xyz/crd-schema-fuzz v0.0.0-20200922204806-c1426cd7fcf4 h1:NWWv+Qju8xzHZT9hIk1+BbgQtIytNOoCU4g4vqUmh3M=
978980
kmodules.xyz/crd-schema-fuzz v0.0.0-20200922204806-c1426cd7fcf4/go.mod h1:WrO3fryNyFCgqqyWnwI89lnzWA7kN072Ehya7ELGfzE=
@@ -982,6 +984,8 @@ kmodules.xyz/objectstore-api v0.0.0-20200922210707-59bab27e5d41 h1:BsCSSPoY0uRGy
982984
kmodules.xyz/objectstore-api v0.0.0-20200922210707-59bab27e5d41/go.mod h1:XAWxC/b1ICoufU6XDV0AOHNQY+y+4/B3Z5uyLnW1B6s=
983985
kmodules.xyz/offshoot-api v0.0.0-20200922211229-36acc531abab h1:d/4AFAN0TfKgwhjbQYzwXXHT/5/vTP7SAAvS4uJX+wQ=
984986
kmodules.xyz/offshoot-api v0.0.0-20200922211229-36acc531abab/go.mod h1:Wy3/mWK2lWQOviKVpBtiCEYtLaYIaSiym8leZNKBUd4=
987+
kmodules.xyz/offshoot-api v0.0.0-20201027212804-f5e6dc573558 h1:/gk1vlGimdRj3fYS2NUsoV4UKQxW/I2ORXssnz2sBNI=
988+
kmodules.xyz/offshoot-api v0.0.0-20201027212804-f5e6dc573558/go.mod h1:+tGJRjfzEFm01qWQZcmTkFhB5dWA1jKHXnlUS6O4ZkQ=
985989
kmodules.xyz/prober v0.0.0-20200922212142-743a6514664e h1:NASVP0dOE5Zdlq+3Op7Fh2Yc8ei32uf9PxEbuwGLQm0=
986990
kmodules.xyz/prober v0.0.0-20200922212142-743a6514664e/go.mod h1:AZ58K5hrxkkNPf8tM+UWeZjtNG3/mn192nKcUyC93F8=
987991
modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw=

vendor/kmodules.xyz/client-go/core/v1/service.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,24 +106,30 @@ func MergeServicePorts(cur, desired []core.ServicePort) []core.ServicePort {
106106
}
107107

108108
// ports
109-
curPorts := make(map[int32]core.ServicePort)
109+
curPorts := make(map[string]core.ServicePort)
110110
for _, p := range cur {
111-
curPorts[p.Port] = p
111+
curPorts[p.Name] = p
112112
}
113113
for i, dp := range desired {
114-
cp, ok := curPorts[dp.Port]
114+
cp, ok := curPorts[dp.Name]
115115

116116
// svc port not found
117117
if !ok {
118118
continue
119119
}
120120

121+
if dp.Port == 0 {
122+
dp.Port = cp.Port
123+
}
121124
if dp.NodePort == 0 {
122125
dp.NodePort = cp.NodePort // avoid reassigning port
123126
}
124127
if dp.Protocol == "" {
125128
dp.Protocol = cp.Protocol
126129
}
130+
if dp.AppProtocol == nil {
131+
dp.AppProtocol = cp.AppProtocol
132+
}
127133
desired[i] = dp
128134
}
129135
return desired

vendor/kmodules.xyz/offshoot-api/api/v1/generated.pb.go

Lines changed: 220 additions & 120 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/kmodules.xyz/offshoot-api/api/v1/generated.proto

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/kmodules.xyz/offshoot-api/api/v1/openapi_generated.go

Lines changed: 14 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/kmodules.xyz/offshoot-api/api/v1/types.go

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,21 @@ type PodSpec struct {
158158
// Cannot be updated.
159159
// +optional
160160
Lifecycle *core.Lifecycle `json:"lifecycle,omitempty" protobuf:"bytes,16,opt,name=lifecycle"`
161+
162+
// Set DNS policy for the pod.
163+
// Defaults to "ClusterFirst".
164+
// Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'.
165+
// DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy.
166+
// To have DNS options set along with hostNetwork, you have to specify DNS policy
167+
// explicitly to 'ClusterFirstWithHostNet'.
168+
// +optional
169+
DNSPolicy core.DNSPolicy `json:"dnsPolicy,omitempty" protobuf:"bytes,17,opt,name=dnsPolicy,casttype=k8s.io/api/core/v1.DNSPolicy"`
170+
171+
// Specifies the DNS parameters of a pod.
172+
// Parameters specified here will be merged to the generated DNS
173+
// configuration based on DNSPolicy.
174+
// +optional
175+
DNSConfig *core.PodDNSConfig `json:"dnsConfig,omitempty" protobuf:"bytes,18,opt,name=dnsConfig"`
161176
}
162177

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

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

vendor/kmodules.xyz/offshoot-api/api/v1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/modules.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ k8s.io/utils/net
843843
k8s.io/utils/path
844844
k8s.io/utils/pointer
845845
k8s.io/utils/trace
846-
# kmodules.xyz/client-go v0.0.0-20201021051118-03dac1aea508
846+
# kmodules.xyz/client-go v0.0.0-20201027113349-01a6d453d836
847847
kmodules.xyz/client-go
848848
kmodules.xyz/client-go/api/v1
849849
kmodules.xyz/client-go/apiextensions
@@ -869,7 +869,7 @@ kmodules.xyz/custom-resources/client/clientset/versioned/typed/appcatalog/v1alph
869869
kmodules.xyz/custom-resources/crds
870870
# kmodules.xyz/objectstore-api v0.0.0-20200922210707-59bab27e5d41
871871
kmodules.xyz/objectstore-api/api/v1
872-
# kmodules.xyz/offshoot-api v0.0.0-20200922211229-36acc531abab
872+
# kmodules.xyz/offshoot-api v0.0.0-20201027212804-f5e6dc573558
873873
kmodules.xyz/offshoot-api/api/v1
874874
# kmodules.xyz/prober v0.0.0-20200922212142-743a6514664e
875875
kmodules.xyz/prober/api/v1

0 commit comments

Comments
 (0)