Zack Williams | e940c7a | 2019-08-21 14:25:39 -0700 | [diff] [blame] | 1 | /* |
| 2 | Copyright The Kubernetes Authors. |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | // Code generated by protoc-gen-gogo. DO NOT EDIT. |
| 18 | // source: k8s.io/kubernetes/vendor/k8s.io/api/networking/v1/generated.proto |
| 19 | |
| 20 | /* |
| 21 | Package v1 is a generated protocol buffer package. |
| 22 | |
| 23 | It is generated from these files: |
| 24 | k8s.io/kubernetes/vendor/k8s.io/api/networking/v1/generated.proto |
| 25 | |
| 26 | It has these top-level messages: |
| 27 | IPBlock |
| 28 | NetworkPolicy |
| 29 | NetworkPolicyEgressRule |
| 30 | NetworkPolicyIngressRule |
| 31 | NetworkPolicyList |
| 32 | NetworkPolicyPeer |
| 33 | NetworkPolicyPort |
| 34 | NetworkPolicySpec |
| 35 | */ |
| 36 | package v1 |
| 37 | |
Scott Baker | 4a35a70 | 2019-11-26 08:17:33 -0800 | [diff] [blame] | 38 | import ( |
| 39 | fmt "fmt" |
Zack Williams | e940c7a | 2019-08-21 14:25:39 -0700 | [diff] [blame] | 40 | |
Scott Baker | 4a35a70 | 2019-11-26 08:17:33 -0800 | [diff] [blame] | 41 | proto "github.com/gogo/protobuf/proto" |
Zack Williams | e940c7a | 2019-08-21 14:25:39 -0700 | [diff] [blame] | 42 | |
Scott Baker | 4a35a70 | 2019-11-26 08:17:33 -0800 | [diff] [blame] | 43 | math "math" |
Zack Williams | e940c7a | 2019-08-21 14:25:39 -0700 | [diff] [blame] | 44 | |
Scott Baker | 4a35a70 | 2019-11-26 08:17:33 -0800 | [diff] [blame] | 45 | k8s_io_apimachinery_pkg_apis_meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
Zack Williams | e940c7a | 2019-08-21 14:25:39 -0700 | [diff] [blame] | 46 | |
Scott Baker | 4a35a70 | 2019-11-26 08:17:33 -0800 | [diff] [blame] | 47 | k8s_io_apimachinery_pkg_util_intstr "k8s.io/apimachinery/pkg/util/intstr" |
Zack Williams | e940c7a | 2019-08-21 14:25:39 -0700 | [diff] [blame] | 48 | |
Scott Baker | 4a35a70 | 2019-11-26 08:17:33 -0800 | [diff] [blame] | 49 | k8s_io_api_core_v1 "k8s.io/api/core/v1" |
| 50 | |
| 51 | strings "strings" |
| 52 | |
| 53 | reflect "reflect" |
| 54 | |
| 55 | io "io" |
| 56 | ) |
Zack Williams | e940c7a | 2019-08-21 14:25:39 -0700 | [diff] [blame] | 57 | |
| 58 | // Reference imports to suppress errors if they are not otherwise used. |
| 59 | var _ = proto.Marshal |
| 60 | var _ = fmt.Errorf |
| 61 | var _ = math.Inf |
| 62 | |
| 63 | // This is a compile-time assertion to ensure that this generated file |
| 64 | // is compatible with the proto package it is being compiled against. |
| 65 | // A compilation error at this line likely means your copy of the |
| 66 | // proto package needs to be updated. |
| 67 | const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package |
| 68 | |
| 69 | func (m *IPBlock) Reset() { *m = IPBlock{} } |
| 70 | func (*IPBlock) ProtoMessage() {} |
| 71 | func (*IPBlock) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{0} } |
| 72 | |
| 73 | func (m *NetworkPolicy) Reset() { *m = NetworkPolicy{} } |
| 74 | func (*NetworkPolicy) ProtoMessage() {} |
| 75 | func (*NetworkPolicy) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{1} } |
| 76 | |
| 77 | func (m *NetworkPolicyEgressRule) Reset() { *m = NetworkPolicyEgressRule{} } |
| 78 | func (*NetworkPolicyEgressRule) ProtoMessage() {} |
| 79 | func (*NetworkPolicyEgressRule) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{2} } |
| 80 | |
| 81 | func (m *NetworkPolicyIngressRule) Reset() { *m = NetworkPolicyIngressRule{} } |
| 82 | func (*NetworkPolicyIngressRule) ProtoMessage() {} |
| 83 | func (*NetworkPolicyIngressRule) Descriptor() ([]byte, []int) { |
| 84 | return fileDescriptorGenerated, []int{3} |
| 85 | } |
| 86 | |
| 87 | func (m *NetworkPolicyList) Reset() { *m = NetworkPolicyList{} } |
| 88 | func (*NetworkPolicyList) ProtoMessage() {} |
| 89 | func (*NetworkPolicyList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{4} } |
| 90 | |
| 91 | func (m *NetworkPolicyPeer) Reset() { *m = NetworkPolicyPeer{} } |
| 92 | func (*NetworkPolicyPeer) ProtoMessage() {} |
| 93 | func (*NetworkPolicyPeer) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{5} } |
| 94 | |
| 95 | func (m *NetworkPolicyPort) Reset() { *m = NetworkPolicyPort{} } |
| 96 | func (*NetworkPolicyPort) ProtoMessage() {} |
| 97 | func (*NetworkPolicyPort) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{6} } |
| 98 | |
| 99 | func (m *NetworkPolicySpec) Reset() { *m = NetworkPolicySpec{} } |
| 100 | func (*NetworkPolicySpec) ProtoMessage() {} |
| 101 | func (*NetworkPolicySpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{7} } |
| 102 | |
| 103 | func init() { |
| 104 | proto.RegisterType((*IPBlock)(nil), "k8s.io.api.networking.v1.IPBlock") |
| 105 | proto.RegisterType((*NetworkPolicy)(nil), "k8s.io.api.networking.v1.NetworkPolicy") |
| 106 | proto.RegisterType((*NetworkPolicyEgressRule)(nil), "k8s.io.api.networking.v1.NetworkPolicyEgressRule") |
| 107 | proto.RegisterType((*NetworkPolicyIngressRule)(nil), "k8s.io.api.networking.v1.NetworkPolicyIngressRule") |
| 108 | proto.RegisterType((*NetworkPolicyList)(nil), "k8s.io.api.networking.v1.NetworkPolicyList") |
| 109 | proto.RegisterType((*NetworkPolicyPeer)(nil), "k8s.io.api.networking.v1.NetworkPolicyPeer") |
| 110 | proto.RegisterType((*NetworkPolicyPort)(nil), "k8s.io.api.networking.v1.NetworkPolicyPort") |
| 111 | proto.RegisterType((*NetworkPolicySpec)(nil), "k8s.io.api.networking.v1.NetworkPolicySpec") |
| 112 | } |
| 113 | func (m *IPBlock) Marshal() (dAtA []byte, err error) { |
| 114 | size := m.Size() |
| 115 | dAtA = make([]byte, size) |
| 116 | n, err := m.MarshalTo(dAtA) |
| 117 | if err != nil { |
| 118 | return nil, err |
| 119 | } |
| 120 | return dAtA[:n], nil |
| 121 | } |
| 122 | |
| 123 | func (m *IPBlock) MarshalTo(dAtA []byte) (int, error) { |
| 124 | var i int |
| 125 | _ = i |
| 126 | var l int |
| 127 | _ = l |
| 128 | dAtA[i] = 0xa |
| 129 | i++ |
| 130 | i = encodeVarintGenerated(dAtA, i, uint64(len(m.CIDR))) |
| 131 | i += copy(dAtA[i:], m.CIDR) |
| 132 | if len(m.Except) > 0 { |
| 133 | for _, s := range m.Except { |
| 134 | dAtA[i] = 0x12 |
| 135 | i++ |
| 136 | l = len(s) |
| 137 | for l >= 1<<7 { |
| 138 | dAtA[i] = uint8(uint64(l)&0x7f | 0x80) |
| 139 | l >>= 7 |
| 140 | i++ |
| 141 | } |
| 142 | dAtA[i] = uint8(l) |
| 143 | i++ |
| 144 | i += copy(dAtA[i:], s) |
| 145 | } |
| 146 | } |
| 147 | return i, nil |
| 148 | } |
| 149 | |
| 150 | func (m *NetworkPolicy) Marshal() (dAtA []byte, err error) { |
| 151 | size := m.Size() |
| 152 | dAtA = make([]byte, size) |
| 153 | n, err := m.MarshalTo(dAtA) |
| 154 | if err != nil { |
| 155 | return nil, err |
| 156 | } |
| 157 | return dAtA[:n], nil |
| 158 | } |
| 159 | |
| 160 | func (m *NetworkPolicy) MarshalTo(dAtA []byte) (int, error) { |
| 161 | var i int |
| 162 | _ = i |
| 163 | var l int |
| 164 | _ = l |
| 165 | dAtA[i] = 0xa |
| 166 | i++ |
| 167 | i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size())) |
| 168 | n1, err := m.ObjectMeta.MarshalTo(dAtA[i:]) |
| 169 | if err != nil { |
| 170 | return 0, err |
| 171 | } |
| 172 | i += n1 |
| 173 | dAtA[i] = 0x12 |
| 174 | i++ |
| 175 | i = encodeVarintGenerated(dAtA, i, uint64(m.Spec.Size())) |
| 176 | n2, err := m.Spec.MarshalTo(dAtA[i:]) |
| 177 | if err != nil { |
| 178 | return 0, err |
| 179 | } |
| 180 | i += n2 |
| 181 | return i, nil |
| 182 | } |
| 183 | |
| 184 | func (m *NetworkPolicyEgressRule) Marshal() (dAtA []byte, err error) { |
| 185 | size := m.Size() |
| 186 | dAtA = make([]byte, size) |
| 187 | n, err := m.MarshalTo(dAtA) |
| 188 | if err != nil { |
| 189 | return nil, err |
| 190 | } |
| 191 | return dAtA[:n], nil |
| 192 | } |
| 193 | |
| 194 | func (m *NetworkPolicyEgressRule) MarshalTo(dAtA []byte) (int, error) { |
| 195 | var i int |
| 196 | _ = i |
| 197 | var l int |
| 198 | _ = l |
| 199 | if len(m.Ports) > 0 { |
| 200 | for _, msg := range m.Ports { |
| 201 | dAtA[i] = 0xa |
| 202 | i++ |
| 203 | i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) |
| 204 | n, err := msg.MarshalTo(dAtA[i:]) |
| 205 | if err != nil { |
| 206 | return 0, err |
| 207 | } |
| 208 | i += n |
| 209 | } |
| 210 | } |
| 211 | if len(m.To) > 0 { |
| 212 | for _, msg := range m.To { |
| 213 | dAtA[i] = 0x12 |
| 214 | i++ |
| 215 | i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) |
| 216 | n, err := msg.MarshalTo(dAtA[i:]) |
| 217 | if err != nil { |
| 218 | return 0, err |
| 219 | } |
| 220 | i += n |
| 221 | } |
| 222 | } |
| 223 | return i, nil |
| 224 | } |
| 225 | |
| 226 | func (m *NetworkPolicyIngressRule) Marshal() (dAtA []byte, err error) { |
| 227 | size := m.Size() |
| 228 | dAtA = make([]byte, size) |
| 229 | n, err := m.MarshalTo(dAtA) |
| 230 | if err != nil { |
| 231 | return nil, err |
| 232 | } |
| 233 | return dAtA[:n], nil |
| 234 | } |
| 235 | |
| 236 | func (m *NetworkPolicyIngressRule) MarshalTo(dAtA []byte) (int, error) { |
| 237 | var i int |
| 238 | _ = i |
| 239 | var l int |
| 240 | _ = l |
| 241 | if len(m.Ports) > 0 { |
| 242 | for _, msg := range m.Ports { |
| 243 | dAtA[i] = 0xa |
| 244 | i++ |
| 245 | i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) |
| 246 | n, err := msg.MarshalTo(dAtA[i:]) |
| 247 | if err != nil { |
| 248 | return 0, err |
| 249 | } |
| 250 | i += n |
| 251 | } |
| 252 | } |
| 253 | if len(m.From) > 0 { |
| 254 | for _, msg := range m.From { |
| 255 | dAtA[i] = 0x12 |
| 256 | i++ |
| 257 | i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) |
| 258 | n, err := msg.MarshalTo(dAtA[i:]) |
| 259 | if err != nil { |
| 260 | return 0, err |
| 261 | } |
| 262 | i += n |
| 263 | } |
| 264 | } |
| 265 | return i, nil |
| 266 | } |
| 267 | |
| 268 | func (m *NetworkPolicyList) Marshal() (dAtA []byte, err error) { |
| 269 | size := m.Size() |
| 270 | dAtA = make([]byte, size) |
| 271 | n, err := m.MarshalTo(dAtA) |
| 272 | if err != nil { |
| 273 | return nil, err |
| 274 | } |
| 275 | return dAtA[:n], nil |
| 276 | } |
| 277 | |
| 278 | func (m *NetworkPolicyList) MarshalTo(dAtA []byte) (int, error) { |
| 279 | var i int |
| 280 | _ = i |
| 281 | var l int |
| 282 | _ = l |
| 283 | dAtA[i] = 0xa |
| 284 | i++ |
| 285 | i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size())) |
| 286 | n3, err := m.ListMeta.MarshalTo(dAtA[i:]) |
| 287 | if err != nil { |
| 288 | return 0, err |
| 289 | } |
| 290 | i += n3 |
| 291 | if len(m.Items) > 0 { |
| 292 | for _, msg := range m.Items { |
| 293 | dAtA[i] = 0x12 |
| 294 | i++ |
| 295 | i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) |
| 296 | n, err := msg.MarshalTo(dAtA[i:]) |
| 297 | if err != nil { |
| 298 | return 0, err |
| 299 | } |
| 300 | i += n |
| 301 | } |
| 302 | } |
| 303 | return i, nil |
| 304 | } |
| 305 | |
| 306 | func (m *NetworkPolicyPeer) Marshal() (dAtA []byte, err error) { |
| 307 | size := m.Size() |
| 308 | dAtA = make([]byte, size) |
| 309 | n, err := m.MarshalTo(dAtA) |
| 310 | if err != nil { |
| 311 | return nil, err |
| 312 | } |
| 313 | return dAtA[:n], nil |
| 314 | } |
| 315 | |
| 316 | func (m *NetworkPolicyPeer) MarshalTo(dAtA []byte) (int, error) { |
| 317 | var i int |
| 318 | _ = i |
| 319 | var l int |
| 320 | _ = l |
| 321 | if m.PodSelector != nil { |
| 322 | dAtA[i] = 0xa |
| 323 | i++ |
| 324 | i = encodeVarintGenerated(dAtA, i, uint64(m.PodSelector.Size())) |
| 325 | n4, err := m.PodSelector.MarshalTo(dAtA[i:]) |
| 326 | if err != nil { |
| 327 | return 0, err |
| 328 | } |
| 329 | i += n4 |
| 330 | } |
| 331 | if m.NamespaceSelector != nil { |
| 332 | dAtA[i] = 0x12 |
| 333 | i++ |
| 334 | i = encodeVarintGenerated(dAtA, i, uint64(m.NamespaceSelector.Size())) |
| 335 | n5, err := m.NamespaceSelector.MarshalTo(dAtA[i:]) |
| 336 | if err != nil { |
| 337 | return 0, err |
| 338 | } |
| 339 | i += n5 |
| 340 | } |
| 341 | if m.IPBlock != nil { |
| 342 | dAtA[i] = 0x1a |
| 343 | i++ |
| 344 | i = encodeVarintGenerated(dAtA, i, uint64(m.IPBlock.Size())) |
| 345 | n6, err := m.IPBlock.MarshalTo(dAtA[i:]) |
| 346 | if err != nil { |
| 347 | return 0, err |
| 348 | } |
| 349 | i += n6 |
| 350 | } |
| 351 | return i, nil |
| 352 | } |
| 353 | |
| 354 | func (m *NetworkPolicyPort) Marshal() (dAtA []byte, err error) { |
| 355 | size := m.Size() |
| 356 | dAtA = make([]byte, size) |
| 357 | n, err := m.MarshalTo(dAtA) |
| 358 | if err != nil { |
| 359 | return nil, err |
| 360 | } |
| 361 | return dAtA[:n], nil |
| 362 | } |
| 363 | |
| 364 | func (m *NetworkPolicyPort) MarshalTo(dAtA []byte) (int, error) { |
| 365 | var i int |
| 366 | _ = i |
| 367 | var l int |
| 368 | _ = l |
| 369 | if m.Protocol != nil { |
| 370 | dAtA[i] = 0xa |
| 371 | i++ |
| 372 | i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Protocol))) |
| 373 | i += copy(dAtA[i:], *m.Protocol) |
| 374 | } |
| 375 | if m.Port != nil { |
| 376 | dAtA[i] = 0x12 |
| 377 | i++ |
| 378 | i = encodeVarintGenerated(dAtA, i, uint64(m.Port.Size())) |
| 379 | n7, err := m.Port.MarshalTo(dAtA[i:]) |
| 380 | if err != nil { |
| 381 | return 0, err |
| 382 | } |
| 383 | i += n7 |
| 384 | } |
| 385 | return i, nil |
| 386 | } |
| 387 | |
| 388 | func (m *NetworkPolicySpec) Marshal() (dAtA []byte, err error) { |
| 389 | size := m.Size() |
| 390 | dAtA = make([]byte, size) |
| 391 | n, err := m.MarshalTo(dAtA) |
| 392 | if err != nil { |
| 393 | return nil, err |
| 394 | } |
| 395 | return dAtA[:n], nil |
| 396 | } |
| 397 | |
| 398 | func (m *NetworkPolicySpec) MarshalTo(dAtA []byte) (int, error) { |
| 399 | var i int |
| 400 | _ = i |
| 401 | var l int |
| 402 | _ = l |
| 403 | dAtA[i] = 0xa |
| 404 | i++ |
| 405 | i = encodeVarintGenerated(dAtA, i, uint64(m.PodSelector.Size())) |
| 406 | n8, err := m.PodSelector.MarshalTo(dAtA[i:]) |
| 407 | if err != nil { |
| 408 | return 0, err |
| 409 | } |
| 410 | i += n8 |
| 411 | if len(m.Ingress) > 0 { |
| 412 | for _, msg := range m.Ingress { |
| 413 | dAtA[i] = 0x12 |
| 414 | i++ |
| 415 | i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) |
| 416 | n, err := msg.MarshalTo(dAtA[i:]) |
| 417 | if err != nil { |
| 418 | return 0, err |
| 419 | } |
| 420 | i += n |
| 421 | } |
| 422 | } |
| 423 | if len(m.Egress) > 0 { |
| 424 | for _, msg := range m.Egress { |
| 425 | dAtA[i] = 0x1a |
| 426 | i++ |
| 427 | i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) |
| 428 | n, err := msg.MarshalTo(dAtA[i:]) |
| 429 | if err != nil { |
| 430 | return 0, err |
| 431 | } |
| 432 | i += n |
| 433 | } |
| 434 | } |
| 435 | if len(m.PolicyTypes) > 0 { |
| 436 | for _, s := range m.PolicyTypes { |
| 437 | dAtA[i] = 0x22 |
| 438 | i++ |
| 439 | l = len(s) |
| 440 | for l >= 1<<7 { |
| 441 | dAtA[i] = uint8(uint64(l)&0x7f | 0x80) |
| 442 | l >>= 7 |
| 443 | i++ |
| 444 | } |
| 445 | dAtA[i] = uint8(l) |
| 446 | i++ |
| 447 | i += copy(dAtA[i:], s) |
| 448 | } |
| 449 | } |
| 450 | return i, nil |
| 451 | } |
| 452 | |
| 453 | func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { |
| 454 | for v >= 1<<7 { |
| 455 | dAtA[offset] = uint8(v&0x7f | 0x80) |
| 456 | v >>= 7 |
| 457 | offset++ |
| 458 | } |
| 459 | dAtA[offset] = uint8(v) |
| 460 | return offset + 1 |
| 461 | } |
| 462 | func (m *IPBlock) Size() (n int) { |
| 463 | var l int |
| 464 | _ = l |
| 465 | l = len(m.CIDR) |
| 466 | n += 1 + l + sovGenerated(uint64(l)) |
| 467 | if len(m.Except) > 0 { |
| 468 | for _, s := range m.Except { |
| 469 | l = len(s) |
| 470 | n += 1 + l + sovGenerated(uint64(l)) |
| 471 | } |
| 472 | } |
| 473 | return n |
| 474 | } |
| 475 | |
| 476 | func (m *NetworkPolicy) Size() (n int) { |
| 477 | var l int |
| 478 | _ = l |
| 479 | l = m.ObjectMeta.Size() |
| 480 | n += 1 + l + sovGenerated(uint64(l)) |
| 481 | l = m.Spec.Size() |
| 482 | n += 1 + l + sovGenerated(uint64(l)) |
| 483 | return n |
| 484 | } |
| 485 | |
| 486 | func (m *NetworkPolicyEgressRule) Size() (n int) { |
| 487 | var l int |
| 488 | _ = l |
| 489 | if len(m.Ports) > 0 { |
| 490 | for _, e := range m.Ports { |
| 491 | l = e.Size() |
| 492 | n += 1 + l + sovGenerated(uint64(l)) |
| 493 | } |
| 494 | } |
| 495 | if len(m.To) > 0 { |
| 496 | for _, e := range m.To { |
| 497 | l = e.Size() |
| 498 | n += 1 + l + sovGenerated(uint64(l)) |
| 499 | } |
| 500 | } |
| 501 | return n |
| 502 | } |
| 503 | |
| 504 | func (m *NetworkPolicyIngressRule) Size() (n int) { |
| 505 | var l int |
| 506 | _ = l |
| 507 | if len(m.Ports) > 0 { |
| 508 | for _, e := range m.Ports { |
| 509 | l = e.Size() |
| 510 | n += 1 + l + sovGenerated(uint64(l)) |
| 511 | } |
| 512 | } |
| 513 | if len(m.From) > 0 { |
| 514 | for _, e := range m.From { |
| 515 | l = e.Size() |
| 516 | n += 1 + l + sovGenerated(uint64(l)) |
| 517 | } |
| 518 | } |
| 519 | return n |
| 520 | } |
| 521 | |
| 522 | func (m *NetworkPolicyList) Size() (n int) { |
| 523 | var l int |
| 524 | _ = l |
| 525 | l = m.ListMeta.Size() |
| 526 | n += 1 + l + sovGenerated(uint64(l)) |
| 527 | if len(m.Items) > 0 { |
| 528 | for _, e := range m.Items { |
| 529 | l = e.Size() |
| 530 | n += 1 + l + sovGenerated(uint64(l)) |
| 531 | } |
| 532 | } |
| 533 | return n |
| 534 | } |
| 535 | |
| 536 | func (m *NetworkPolicyPeer) Size() (n int) { |
| 537 | var l int |
| 538 | _ = l |
| 539 | if m.PodSelector != nil { |
| 540 | l = m.PodSelector.Size() |
| 541 | n += 1 + l + sovGenerated(uint64(l)) |
| 542 | } |
| 543 | if m.NamespaceSelector != nil { |
| 544 | l = m.NamespaceSelector.Size() |
| 545 | n += 1 + l + sovGenerated(uint64(l)) |
| 546 | } |
| 547 | if m.IPBlock != nil { |
| 548 | l = m.IPBlock.Size() |
| 549 | n += 1 + l + sovGenerated(uint64(l)) |
| 550 | } |
| 551 | return n |
| 552 | } |
| 553 | |
| 554 | func (m *NetworkPolicyPort) Size() (n int) { |
| 555 | var l int |
| 556 | _ = l |
| 557 | if m.Protocol != nil { |
| 558 | l = len(*m.Protocol) |
| 559 | n += 1 + l + sovGenerated(uint64(l)) |
| 560 | } |
| 561 | if m.Port != nil { |
| 562 | l = m.Port.Size() |
| 563 | n += 1 + l + sovGenerated(uint64(l)) |
| 564 | } |
| 565 | return n |
| 566 | } |
| 567 | |
| 568 | func (m *NetworkPolicySpec) Size() (n int) { |
| 569 | var l int |
| 570 | _ = l |
| 571 | l = m.PodSelector.Size() |
| 572 | n += 1 + l + sovGenerated(uint64(l)) |
| 573 | if len(m.Ingress) > 0 { |
| 574 | for _, e := range m.Ingress { |
| 575 | l = e.Size() |
| 576 | n += 1 + l + sovGenerated(uint64(l)) |
| 577 | } |
| 578 | } |
| 579 | if len(m.Egress) > 0 { |
| 580 | for _, e := range m.Egress { |
| 581 | l = e.Size() |
| 582 | n += 1 + l + sovGenerated(uint64(l)) |
| 583 | } |
| 584 | } |
| 585 | if len(m.PolicyTypes) > 0 { |
| 586 | for _, s := range m.PolicyTypes { |
| 587 | l = len(s) |
| 588 | n += 1 + l + sovGenerated(uint64(l)) |
| 589 | } |
| 590 | } |
| 591 | return n |
| 592 | } |
| 593 | |
| 594 | func sovGenerated(x uint64) (n int) { |
| 595 | for { |
| 596 | n++ |
| 597 | x >>= 7 |
| 598 | if x == 0 { |
| 599 | break |
| 600 | } |
| 601 | } |
| 602 | return n |
| 603 | } |
| 604 | func sozGenerated(x uint64) (n int) { |
| 605 | return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) |
| 606 | } |
| 607 | func (this *IPBlock) String() string { |
| 608 | if this == nil { |
| 609 | return "nil" |
| 610 | } |
| 611 | s := strings.Join([]string{`&IPBlock{`, |
| 612 | `CIDR:` + fmt.Sprintf("%v", this.CIDR) + `,`, |
| 613 | `Except:` + fmt.Sprintf("%v", this.Except) + `,`, |
| 614 | `}`, |
| 615 | }, "") |
| 616 | return s |
| 617 | } |
| 618 | func (this *NetworkPolicy) String() string { |
| 619 | if this == nil { |
| 620 | return "nil" |
| 621 | } |
| 622 | s := strings.Join([]string{`&NetworkPolicy{`, |
| 623 | `ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ObjectMeta", 1), `&`, ``, 1) + `,`, |
| 624 | `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "NetworkPolicySpec", "NetworkPolicySpec", 1), `&`, ``, 1) + `,`, |
| 625 | `}`, |
| 626 | }, "") |
| 627 | return s |
| 628 | } |
| 629 | func (this *NetworkPolicyEgressRule) String() string { |
| 630 | if this == nil { |
| 631 | return "nil" |
| 632 | } |
| 633 | s := strings.Join([]string{`&NetworkPolicyEgressRule{`, |
| 634 | `Ports:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Ports), "NetworkPolicyPort", "NetworkPolicyPort", 1), `&`, ``, 1) + `,`, |
| 635 | `To:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.To), "NetworkPolicyPeer", "NetworkPolicyPeer", 1), `&`, ``, 1) + `,`, |
| 636 | `}`, |
| 637 | }, "") |
| 638 | return s |
| 639 | } |
| 640 | func (this *NetworkPolicyIngressRule) String() string { |
| 641 | if this == nil { |
| 642 | return "nil" |
| 643 | } |
| 644 | s := strings.Join([]string{`&NetworkPolicyIngressRule{`, |
| 645 | `Ports:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Ports), "NetworkPolicyPort", "NetworkPolicyPort", 1), `&`, ``, 1) + `,`, |
| 646 | `From:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.From), "NetworkPolicyPeer", "NetworkPolicyPeer", 1), `&`, ``, 1) + `,`, |
| 647 | `}`, |
| 648 | }, "") |
| 649 | return s |
| 650 | } |
| 651 | func (this *NetworkPolicyList) String() string { |
| 652 | if this == nil { |
| 653 | return "nil" |
| 654 | } |
| 655 | s := strings.Join([]string{`&NetworkPolicyList{`, |
| 656 | `ListMeta:` + strings.Replace(strings.Replace(this.ListMeta.String(), "ListMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ListMeta", 1), `&`, ``, 1) + `,`, |
| 657 | `Items:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Items), "NetworkPolicy", "NetworkPolicy", 1), `&`, ``, 1) + `,`, |
| 658 | `}`, |
| 659 | }, "") |
| 660 | return s |
| 661 | } |
| 662 | func (this *NetworkPolicyPeer) String() string { |
| 663 | if this == nil { |
| 664 | return "nil" |
| 665 | } |
| 666 | s := strings.Join([]string{`&NetworkPolicyPeer{`, |
| 667 | `PodSelector:` + strings.Replace(fmt.Sprintf("%v", this.PodSelector), "LabelSelector", "k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector", 1) + `,`, |
| 668 | `NamespaceSelector:` + strings.Replace(fmt.Sprintf("%v", this.NamespaceSelector), "LabelSelector", "k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector", 1) + `,`, |
| 669 | `IPBlock:` + strings.Replace(fmt.Sprintf("%v", this.IPBlock), "IPBlock", "IPBlock", 1) + `,`, |
| 670 | `}`, |
| 671 | }, "") |
| 672 | return s |
| 673 | } |
| 674 | func (this *NetworkPolicyPort) String() string { |
| 675 | if this == nil { |
| 676 | return "nil" |
| 677 | } |
| 678 | s := strings.Join([]string{`&NetworkPolicyPort{`, |
| 679 | `Protocol:` + valueToStringGenerated(this.Protocol) + `,`, |
| 680 | `Port:` + strings.Replace(fmt.Sprintf("%v", this.Port), "IntOrString", "k8s_io_apimachinery_pkg_util_intstr.IntOrString", 1) + `,`, |
| 681 | `}`, |
| 682 | }, "") |
| 683 | return s |
| 684 | } |
| 685 | func (this *NetworkPolicySpec) String() string { |
| 686 | if this == nil { |
| 687 | return "nil" |
| 688 | } |
| 689 | s := strings.Join([]string{`&NetworkPolicySpec{`, |
| 690 | `PodSelector:` + strings.Replace(strings.Replace(this.PodSelector.String(), "LabelSelector", "k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector", 1), `&`, ``, 1) + `,`, |
| 691 | `Ingress:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Ingress), "NetworkPolicyIngressRule", "NetworkPolicyIngressRule", 1), `&`, ``, 1) + `,`, |
| 692 | `Egress:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Egress), "NetworkPolicyEgressRule", "NetworkPolicyEgressRule", 1), `&`, ``, 1) + `,`, |
| 693 | `PolicyTypes:` + fmt.Sprintf("%v", this.PolicyTypes) + `,`, |
| 694 | `}`, |
| 695 | }, "") |
| 696 | return s |
| 697 | } |
| 698 | func valueToStringGenerated(v interface{}) string { |
| 699 | rv := reflect.ValueOf(v) |
| 700 | if rv.IsNil() { |
| 701 | return "nil" |
| 702 | } |
| 703 | pv := reflect.Indirect(rv).Interface() |
| 704 | return fmt.Sprintf("*%v", pv) |
| 705 | } |
| 706 | func (m *IPBlock) Unmarshal(dAtA []byte) error { |
| 707 | l := len(dAtA) |
| 708 | iNdEx := 0 |
| 709 | for iNdEx < l { |
| 710 | preIndex := iNdEx |
| 711 | var wire uint64 |
| 712 | for shift := uint(0); ; shift += 7 { |
| 713 | if shift >= 64 { |
| 714 | return ErrIntOverflowGenerated |
| 715 | } |
| 716 | if iNdEx >= l { |
| 717 | return io.ErrUnexpectedEOF |
| 718 | } |
| 719 | b := dAtA[iNdEx] |
| 720 | iNdEx++ |
| 721 | wire |= (uint64(b) & 0x7F) << shift |
| 722 | if b < 0x80 { |
| 723 | break |
| 724 | } |
| 725 | } |
| 726 | fieldNum := int32(wire >> 3) |
| 727 | wireType := int(wire & 0x7) |
| 728 | if wireType == 4 { |
| 729 | return fmt.Errorf("proto: IPBlock: wiretype end group for non-group") |
| 730 | } |
| 731 | if fieldNum <= 0 { |
| 732 | return fmt.Errorf("proto: IPBlock: illegal tag %d (wire type %d)", fieldNum, wire) |
| 733 | } |
| 734 | switch fieldNum { |
| 735 | case 1: |
| 736 | if wireType != 2 { |
| 737 | return fmt.Errorf("proto: wrong wireType = %d for field CIDR", wireType) |
| 738 | } |
| 739 | var stringLen uint64 |
| 740 | for shift := uint(0); ; shift += 7 { |
| 741 | if shift >= 64 { |
| 742 | return ErrIntOverflowGenerated |
| 743 | } |
| 744 | if iNdEx >= l { |
| 745 | return io.ErrUnexpectedEOF |
| 746 | } |
| 747 | b := dAtA[iNdEx] |
| 748 | iNdEx++ |
| 749 | stringLen |= (uint64(b) & 0x7F) << shift |
| 750 | if b < 0x80 { |
| 751 | break |
| 752 | } |
| 753 | } |
| 754 | intStringLen := int(stringLen) |
| 755 | if intStringLen < 0 { |
| 756 | return ErrInvalidLengthGenerated |
| 757 | } |
| 758 | postIndex := iNdEx + intStringLen |
| 759 | if postIndex > l { |
| 760 | return io.ErrUnexpectedEOF |
| 761 | } |
| 762 | m.CIDR = string(dAtA[iNdEx:postIndex]) |
| 763 | iNdEx = postIndex |
| 764 | case 2: |
| 765 | if wireType != 2 { |
| 766 | return fmt.Errorf("proto: wrong wireType = %d for field Except", wireType) |
| 767 | } |
| 768 | var stringLen uint64 |
| 769 | for shift := uint(0); ; shift += 7 { |
| 770 | if shift >= 64 { |
| 771 | return ErrIntOverflowGenerated |
| 772 | } |
| 773 | if iNdEx >= l { |
| 774 | return io.ErrUnexpectedEOF |
| 775 | } |
| 776 | b := dAtA[iNdEx] |
| 777 | iNdEx++ |
| 778 | stringLen |= (uint64(b) & 0x7F) << shift |
| 779 | if b < 0x80 { |
| 780 | break |
| 781 | } |
| 782 | } |
| 783 | intStringLen := int(stringLen) |
| 784 | if intStringLen < 0 { |
| 785 | return ErrInvalidLengthGenerated |
| 786 | } |
| 787 | postIndex := iNdEx + intStringLen |
| 788 | if postIndex > l { |
| 789 | return io.ErrUnexpectedEOF |
| 790 | } |
| 791 | m.Except = append(m.Except, string(dAtA[iNdEx:postIndex])) |
| 792 | iNdEx = postIndex |
| 793 | default: |
| 794 | iNdEx = preIndex |
| 795 | skippy, err := skipGenerated(dAtA[iNdEx:]) |
| 796 | if err != nil { |
| 797 | return err |
| 798 | } |
| 799 | if skippy < 0 { |
| 800 | return ErrInvalidLengthGenerated |
| 801 | } |
| 802 | if (iNdEx + skippy) > l { |
| 803 | return io.ErrUnexpectedEOF |
| 804 | } |
| 805 | iNdEx += skippy |
| 806 | } |
| 807 | } |
| 808 | |
| 809 | if iNdEx > l { |
| 810 | return io.ErrUnexpectedEOF |
| 811 | } |
| 812 | return nil |
| 813 | } |
| 814 | func (m *NetworkPolicy) Unmarshal(dAtA []byte) error { |
| 815 | l := len(dAtA) |
| 816 | iNdEx := 0 |
| 817 | for iNdEx < l { |
| 818 | preIndex := iNdEx |
| 819 | var wire uint64 |
| 820 | for shift := uint(0); ; shift += 7 { |
| 821 | if shift >= 64 { |
| 822 | return ErrIntOverflowGenerated |
| 823 | } |
| 824 | if iNdEx >= l { |
| 825 | return io.ErrUnexpectedEOF |
| 826 | } |
| 827 | b := dAtA[iNdEx] |
| 828 | iNdEx++ |
| 829 | wire |= (uint64(b) & 0x7F) << shift |
| 830 | if b < 0x80 { |
| 831 | break |
| 832 | } |
| 833 | } |
| 834 | fieldNum := int32(wire >> 3) |
| 835 | wireType := int(wire & 0x7) |
| 836 | if wireType == 4 { |
| 837 | return fmt.Errorf("proto: NetworkPolicy: wiretype end group for non-group") |
| 838 | } |
| 839 | if fieldNum <= 0 { |
| 840 | return fmt.Errorf("proto: NetworkPolicy: illegal tag %d (wire type %d)", fieldNum, wire) |
| 841 | } |
| 842 | switch fieldNum { |
| 843 | case 1: |
| 844 | if wireType != 2 { |
| 845 | return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) |
| 846 | } |
| 847 | var msglen int |
| 848 | for shift := uint(0); ; shift += 7 { |
| 849 | if shift >= 64 { |
| 850 | return ErrIntOverflowGenerated |
| 851 | } |
| 852 | if iNdEx >= l { |
| 853 | return io.ErrUnexpectedEOF |
| 854 | } |
| 855 | b := dAtA[iNdEx] |
| 856 | iNdEx++ |
| 857 | msglen |= (int(b) & 0x7F) << shift |
| 858 | if b < 0x80 { |
| 859 | break |
| 860 | } |
| 861 | } |
| 862 | if msglen < 0 { |
| 863 | return ErrInvalidLengthGenerated |
| 864 | } |
| 865 | postIndex := iNdEx + msglen |
| 866 | if postIndex > l { |
| 867 | return io.ErrUnexpectedEOF |
| 868 | } |
| 869 | if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 870 | return err |
| 871 | } |
| 872 | iNdEx = postIndex |
| 873 | case 2: |
| 874 | if wireType != 2 { |
| 875 | return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) |
| 876 | } |
| 877 | var msglen int |
| 878 | for shift := uint(0); ; shift += 7 { |
| 879 | if shift >= 64 { |
| 880 | return ErrIntOverflowGenerated |
| 881 | } |
| 882 | if iNdEx >= l { |
| 883 | return io.ErrUnexpectedEOF |
| 884 | } |
| 885 | b := dAtA[iNdEx] |
| 886 | iNdEx++ |
| 887 | msglen |= (int(b) & 0x7F) << shift |
| 888 | if b < 0x80 { |
| 889 | break |
| 890 | } |
| 891 | } |
| 892 | if msglen < 0 { |
| 893 | return ErrInvalidLengthGenerated |
| 894 | } |
| 895 | postIndex := iNdEx + msglen |
| 896 | if postIndex > l { |
| 897 | return io.ErrUnexpectedEOF |
| 898 | } |
| 899 | if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 900 | return err |
| 901 | } |
| 902 | iNdEx = postIndex |
| 903 | default: |
| 904 | iNdEx = preIndex |
| 905 | skippy, err := skipGenerated(dAtA[iNdEx:]) |
| 906 | if err != nil { |
| 907 | return err |
| 908 | } |
| 909 | if skippy < 0 { |
| 910 | return ErrInvalidLengthGenerated |
| 911 | } |
| 912 | if (iNdEx + skippy) > l { |
| 913 | return io.ErrUnexpectedEOF |
| 914 | } |
| 915 | iNdEx += skippy |
| 916 | } |
| 917 | } |
| 918 | |
| 919 | if iNdEx > l { |
| 920 | return io.ErrUnexpectedEOF |
| 921 | } |
| 922 | return nil |
| 923 | } |
| 924 | func (m *NetworkPolicyEgressRule) Unmarshal(dAtA []byte) error { |
| 925 | l := len(dAtA) |
| 926 | iNdEx := 0 |
| 927 | for iNdEx < l { |
| 928 | preIndex := iNdEx |
| 929 | var wire uint64 |
| 930 | for shift := uint(0); ; shift += 7 { |
| 931 | if shift >= 64 { |
| 932 | return ErrIntOverflowGenerated |
| 933 | } |
| 934 | if iNdEx >= l { |
| 935 | return io.ErrUnexpectedEOF |
| 936 | } |
| 937 | b := dAtA[iNdEx] |
| 938 | iNdEx++ |
| 939 | wire |= (uint64(b) & 0x7F) << shift |
| 940 | if b < 0x80 { |
| 941 | break |
| 942 | } |
| 943 | } |
| 944 | fieldNum := int32(wire >> 3) |
| 945 | wireType := int(wire & 0x7) |
| 946 | if wireType == 4 { |
| 947 | return fmt.Errorf("proto: NetworkPolicyEgressRule: wiretype end group for non-group") |
| 948 | } |
| 949 | if fieldNum <= 0 { |
| 950 | return fmt.Errorf("proto: NetworkPolicyEgressRule: illegal tag %d (wire type %d)", fieldNum, wire) |
| 951 | } |
| 952 | switch fieldNum { |
| 953 | case 1: |
| 954 | if wireType != 2 { |
| 955 | return fmt.Errorf("proto: wrong wireType = %d for field Ports", wireType) |
| 956 | } |
| 957 | var msglen int |
| 958 | for shift := uint(0); ; shift += 7 { |
| 959 | if shift >= 64 { |
| 960 | return ErrIntOverflowGenerated |
| 961 | } |
| 962 | if iNdEx >= l { |
| 963 | return io.ErrUnexpectedEOF |
| 964 | } |
| 965 | b := dAtA[iNdEx] |
| 966 | iNdEx++ |
| 967 | msglen |= (int(b) & 0x7F) << shift |
| 968 | if b < 0x80 { |
| 969 | break |
| 970 | } |
| 971 | } |
| 972 | if msglen < 0 { |
| 973 | return ErrInvalidLengthGenerated |
| 974 | } |
| 975 | postIndex := iNdEx + msglen |
| 976 | if postIndex > l { |
| 977 | return io.ErrUnexpectedEOF |
| 978 | } |
| 979 | m.Ports = append(m.Ports, NetworkPolicyPort{}) |
| 980 | if err := m.Ports[len(m.Ports)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 981 | return err |
| 982 | } |
| 983 | iNdEx = postIndex |
| 984 | case 2: |
| 985 | if wireType != 2 { |
| 986 | return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) |
| 987 | } |
| 988 | var msglen int |
| 989 | for shift := uint(0); ; shift += 7 { |
| 990 | if shift >= 64 { |
| 991 | return ErrIntOverflowGenerated |
| 992 | } |
| 993 | if iNdEx >= l { |
| 994 | return io.ErrUnexpectedEOF |
| 995 | } |
| 996 | b := dAtA[iNdEx] |
| 997 | iNdEx++ |
| 998 | msglen |= (int(b) & 0x7F) << shift |
| 999 | if b < 0x80 { |
| 1000 | break |
| 1001 | } |
| 1002 | } |
| 1003 | if msglen < 0 { |
| 1004 | return ErrInvalidLengthGenerated |
| 1005 | } |
| 1006 | postIndex := iNdEx + msglen |
| 1007 | if postIndex > l { |
| 1008 | return io.ErrUnexpectedEOF |
| 1009 | } |
| 1010 | m.To = append(m.To, NetworkPolicyPeer{}) |
| 1011 | if err := m.To[len(m.To)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 1012 | return err |
| 1013 | } |
| 1014 | iNdEx = postIndex |
| 1015 | default: |
| 1016 | iNdEx = preIndex |
| 1017 | skippy, err := skipGenerated(dAtA[iNdEx:]) |
| 1018 | if err != nil { |
| 1019 | return err |
| 1020 | } |
| 1021 | if skippy < 0 { |
| 1022 | return ErrInvalidLengthGenerated |
| 1023 | } |
| 1024 | if (iNdEx + skippy) > l { |
| 1025 | return io.ErrUnexpectedEOF |
| 1026 | } |
| 1027 | iNdEx += skippy |
| 1028 | } |
| 1029 | } |
| 1030 | |
| 1031 | if iNdEx > l { |
| 1032 | return io.ErrUnexpectedEOF |
| 1033 | } |
| 1034 | return nil |
| 1035 | } |
| 1036 | func (m *NetworkPolicyIngressRule) Unmarshal(dAtA []byte) error { |
| 1037 | l := len(dAtA) |
| 1038 | iNdEx := 0 |
| 1039 | for iNdEx < l { |
| 1040 | preIndex := iNdEx |
| 1041 | var wire uint64 |
| 1042 | for shift := uint(0); ; shift += 7 { |
| 1043 | if shift >= 64 { |
| 1044 | return ErrIntOverflowGenerated |
| 1045 | } |
| 1046 | if iNdEx >= l { |
| 1047 | return io.ErrUnexpectedEOF |
| 1048 | } |
| 1049 | b := dAtA[iNdEx] |
| 1050 | iNdEx++ |
| 1051 | wire |= (uint64(b) & 0x7F) << shift |
| 1052 | if b < 0x80 { |
| 1053 | break |
| 1054 | } |
| 1055 | } |
| 1056 | fieldNum := int32(wire >> 3) |
| 1057 | wireType := int(wire & 0x7) |
| 1058 | if wireType == 4 { |
| 1059 | return fmt.Errorf("proto: NetworkPolicyIngressRule: wiretype end group for non-group") |
| 1060 | } |
| 1061 | if fieldNum <= 0 { |
| 1062 | return fmt.Errorf("proto: NetworkPolicyIngressRule: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1063 | } |
| 1064 | switch fieldNum { |
| 1065 | case 1: |
| 1066 | if wireType != 2 { |
| 1067 | return fmt.Errorf("proto: wrong wireType = %d for field Ports", wireType) |
| 1068 | } |
| 1069 | var msglen int |
| 1070 | for shift := uint(0); ; shift += 7 { |
| 1071 | if shift >= 64 { |
| 1072 | return ErrIntOverflowGenerated |
| 1073 | } |
| 1074 | if iNdEx >= l { |
| 1075 | return io.ErrUnexpectedEOF |
| 1076 | } |
| 1077 | b := dAtA[iNdEx] |
| 1078 | iNdEx++ |
| 1079 | msglen |= (int(b) & 0x7F) << shift |
| 1080 | if b < 0x80 { |
| 1081 | break |
| 1082 | } |
| 1083 | } |
| 1084 | if msglen < 0 { |
| 1085 | return ErrInvalidLengthGenerated |
| 1086 | } |
| 1087 | postIndex := iNdEx + msglen |
| 1088 | if postIndex > l { |
| 1089 | return io.ErrUnexpectedEOF |
| 1090 | } |
| 1091 | m.Ports = append(m.Ports, NetworkPolicyPort{}) |
| 1092 | if err := m.Ports[len(m.Ports)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 1093 | return err |
| 1094 | } |
| 1095 | iNdEx = postIndex |
| 1096 | case 2: |
| 1097 | if wireType != 2 { |
| 1098 | return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) |
| 1099 | } |
| 1100 | var msglen int |
| 1101 | for shift := uint(0); ; shift += 7 { |
| 1102 | if shift >= 64 { |
| 1103 | return ErrIntOverflowGenerated |
| 1104 | } |
| 1105 | if iNdEx >= l { |
| 1106 | return io.ErrUnexpectedEOF |
| 1107 | } |
| 1108 | b := dAtA[iNdEx] |
| 1109 | iNdEx++ |
| 1110 | msglen |= (int(b) & 0x7F) << shift |
| 1111 | if b < 0x80 { |
| 1112 | break |
| 1113 | } |
| 1114 | } |
| 1115 | if msglen < 0 { |
| 1116 | return ErrInvalidLengthGenerated |
| 1117 | } |
| 1118 | postIndex := iNdEx + msglen |
| 1119 | if postIndex > l { |
| 1120 | return io.ErrUnexpectedEOF |
| 1121 | } |
| 1122 | m.From = append(m.From, NetworkPolicyPeer{}) |
| 1123 | if err := m.From[len(m.From)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 1124 | return err |
| 1125 | } |
| 1126 | iNdEx = postIndex |
| 1127 | default: |
| 1128 | iNdEx = preIndex |
| 1129 | skippy, err := skipGenerated(dAtA[iNdEx:]) |
| 1130 | if err != nil { |
| 1131 | return err |
| 1132 | } |
| 1133 | if skippy < 0 { |
| 1134 | return ErrInvalidLengthGenerated |
| 1135 | } |
| 1136 | if (iNdEx + skippy) > l { |
| 1137 | return io.ErrUnexpectedEOF |
| 1138 | } |
| 1139 | iNdEx += skippy |
| 1140 | } |
| 1141 | } |
| 1142 | |
| 1143 | if iNdEx > l { |
| 1144 | return io.ErrUnexpectedEOF |
| 1145 | } |
| 1146 | return nil |
| 1147 | } |
| 1148 | func (m *NetworkPolicyList) Unmarshal(dAtA []byte) error { |
| 1149 | l := len(dAtA) |
| 1150 | iNdEx := 0 |
| 1151 | for iNdEx < l { |
| 1152 | preIndex := iNdEx |
| 1153 | var wire uint64 |
| 1154 | for shift := uint(0); ; shift += 7 { |
| 1155 | if shift >= 64 { |
| 1156 | return ErrIntOverflowGenerated |
| 1157 | } |
| 1158 | if iNdEx >= l { |
| 1159 | return io.ErrUnexpectedEOF |
| 1160 | } |
| 1161 | b := dAtA[iNdEx] |
| 1162 | iNdEx++ |
| 1163 | wire |= (uint64(b) & 0x7F) << shift |
| 1164 | if b < 0x80 { |
| 1165 | break |
| 1166 | } |
| 1167 | } |
| 1168 | fieldNum := int32(wire >> 3) |
| 1169 | wireType := int(wire & 0x7) |
| 1170 | if wireType == 4 { |
| 1171 | return fmt.Errorf("proto: NetworkPolicyList: wiretype end group for non-group") |
| 1172 | } |
| 1173 | if fieldNum <= 0 { |
| 1174 | return fmt.Errorf("proto: NetworkPolicyList: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1175 | } |
| 1176 | switch fieldNum { |
| 1177 | case 1: |
| 1178 | if wireType != 2 { |
| 1179 | return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) |
| 1180 | } |
| 1181 | var msglen int |
| 1182 | for shift := uint(0); ; shift += 7 { |
| 1183 | if shift >= 64 { |
| 1184 | return ErrIntOverflowGenerated |
| 1185 | } |
| 1186 | if iNdEx >= l { |
| 1187 | return io.ErrUnexpectedEOF |
| 1188 | } |
| 1189 | b := dAtA[iNdEx] |
| 1190 | iNdEx++ |
| 1191 | msglen |= (int(b) & 0x7F) << shift |
| 1192 | if b < 0x80 { |
| 1193 | break |
| 1194 | } |
| 1195 | } |
| 1196 | if msglen < 0 { |
| 1197 | return ErrInvalidLengthGenerated |
| 1198 | } |
| 1199 | postIndex := iNdEx + msglen |
| 1200 | if postIndex > l { |
| 1201 | return io.ErrUnexpectedEOF |
| 1202 | } |
| 1203 | if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 1204 | return err |
| 1205 | } |
| 1206 | iNdEx = postIndex |
| 1207 | case 2: |
| 1208 | if wireType != 2 { |
| 1209 | return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) |
| 1210 | } |
| 1211 | var msglen int |
| 1212 | for shift := uint(0); ; shift += 7 { |
| 1213 | if shift >= 64 { |
| 1214 | return ErrIntOverflowGenerated |
| 1215 | } |
| 1216 | if iNdEx >= l { |
| 1217 | return io.ErrUnexpectedEOF |
| 1218 | } |
| 1219 | b := dAtA[iNdEx] |
| 1220 | iNdEx++ |
| 1221 | msglen |= (int(b) & 0x7F) << shift |
| 1222 | if b < 0x80 { |
| 1223 | break |
| 1224 | } |
| 1225 | } |
| 1226 | if msglen < 0 { |
| 1227 | return ErrInvalidLengthGenerated |
| 1228 | } |
| 1229 | postIndex := iNdEx + msglen |
| 1230 | if postIndex > l { |
| 1231 | return io.ErrUnexpectedEOF |
| 1232 | } |
| 1233 | m.Items = append(m.Items, NetworkPolicy{}) |
| 1234 | if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 1235 | return err |
| 1236 | } |
| 1237 | iNdEx = postIndex |
| 1238 | default: |
| 1239 | iNdEx = preIndex |
| 1240 | skippy, err := skipGenerated(dAtA[iNdEx:]) |
| 1241 | if err != nil { |
| 1242 | return err |
| 1243 | } |
| 1244 | if skippy < 0 { |
| 1245 | return ErrInvalidLengthGenerated |
| 1246 | } |
| 1247 | if (iNdEx + skippy) > l { |
| 1248 | return io.ErrUnexpectedEOF |
| 1249 | } |
| 1250 | iNdEx += skippy |
| 1251 | } |
| 1252 | } |
| 1253 | |
| 1254 | if iNdEx > l { |
| 1255 | return io.ErrUnexpectedEOF |
| 1256 | } |
| 1257 | return nil |
| 1258 | } |
| 1259 | func (m *NetworkPolicyPeer) Unmarshal(dAtA []byte) error { |
| 1260 | l := len(dAtA) |
| 1261 | iNdEx := 0 |
| 1262 | for iNdEx < l { |
| 1263 | preIndex := iNdEx |
| 1264 | var wire uint64 |
| 1265 | for shift := uint(0); ; shift += 7 { |
| 1266 | if shift >= 64 { |
| 1267 | return ErrIntOverflowGenerated |
| 1268 | } |
| 1269 | if iNdEx >= l { |
| 1270 | return io.ErrUnexpectedEOF |
| 1271 | } |
| 1272 | b := dAtA[iNdEx] |
| 1273 | iNdEx++ |
| 1274 | wire |= (uint64(b) & 0x7F) << shift |
| 1275 | if b < 0x80 { |
| 1276 | break |
| 1277 | } |
| 1278 | } |
| 1279 | fieldNum := int32(wire >> 3) |
| 1280 | wireType := int(wire & 0x7) |
| 1281 | if wireType == 4 { |
| 1282 | return fmt.Errorf("proto: NetworkPolicyPeer: wiretype end group for non-group") |
| 1283 | } |
| 1284 | if fieldNum <= 0 { |
| 1285 | return fmt.Errorf("proto: NetworkPolicyPeer: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1286 | } |
| 1287 | switch fieldNum { |
| 1288 | case 1: |
| 1289 | if wireType != 2 { |
| 1290 | return fmt.Errorf("proto: wrong wireType = %d for field PodSelector", wireType) |
| 1291 | } |
| 1292 | var msglen int |
| 1293 | for shift := uint(0); ; shift += 7 { |
| 1294 | if shift >= 64 { |
| 1295 | return ErrIntOverflowGenerated |
| 1296 | } |
| 1297 | if iNdEx >= l { |
| 1298 | return io.ErrUnexpectedEOF |
| 1299 | } |
| 1300 | b := dAtA[iNdEx] |
| 1301 | iNdEx++ |
| 1302 | msglen |= (int(b) & 0x7F) << shift |
| 1303 | if b < 0x80 { |
| 1304 | break |
| 1305 | } |
| 1306 | } |
| 1307 | if msglen < 0 { |
| 1308 | return ErrInvalidLengthGenerated |
| 1309 | } |
| 1310 | postIndex := iNdEx + msglen |
| 1311 | if postIndex > l { |
| 1312 | return io.ErrUnexpectedEOF |
| 1313 | } |
| 1314 | if m.PodSelector == nil { |
| 1315 | m.PodSelector = &k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector{} |
| 1316 | } |
| 1317 | if err := m.PodSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 1318 | return err |
| 1319 | } |
| 1320 | iNdEx = postIndex |
| 1321 | case 2: |
| 1322 | if wireType != 2 { |
| 1323 | return fmt.Errorf("proto: wrong wireType = %d for field NamespaceSelector", wireType) |
| 1324 | } |
| 1325 | var msglen int |
| 1326 | for shift := uint(0); ; shift += 7 { |
| 1327 | if shift >= 64 { |
| 1328 | return ErrIntOverflowGenerated |
| 1329 | } |
| 1330 | if iNdEx >= l { |
| 1331 | return io.ErrUnexpectedEOF |
| 1332 | } |
| 1333 | b := dAtA[iNdEx] |
| 1334 | iNdEx++ |
| 1335 | msglen |= (int(b) & 0x7F) << shift |
| 1336 | if b < 0x80 { |
| 1337 | break |
| 1338 | } |
| 1339 | } |
| 1340 | if msglen < 0 { |
| 1341 | return ErrInvalidLengthGenerated |
| 1342 | } |
| 1343 | postIndex := iNdEx + msglen |
| 1344 | if postIndex > l { |
| 1345 | return io.ErrUnexpectedEOF |
| 1346 | } |
| 1347 | if m.NamespaceSelector == nil { |
| 1348 | m.NamespaceSelector = &k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector{} |
| 1349 | } |
| 1350 | if err := m.NamespaceSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 1351 | return err |
| 1352 | } |
| 1353 | iNdEx = postIndex |
| 1354 | case 3: |
| 1355 | if wireType != 2 { |
| 1356 | return fmt.Errorf("proto: wrong wireType = %d for field IPBlock", wireType) |
| 1357 | } |
| 1358 | var msglen int |
| 1359 | for shift := uint(0); ; shift += 7 { |
| 1360 | if shift >= 64 { |
| 1361 | return ErrIntOverflowGenerated |
| 1362 | } |
| 1363 | if iNdEx >= l { |
| 1364 | return io.ErrUnexpectedEOF |
| 1365 | } |
| 1366 | b := dAtA[iNdEx] |
| 1367 | iNdEx++ |
| 1368 | msglen |= (int(b) & 0x7F) << shift |
| 1369 | if b < 0x80 { |
| 1370 | break |
| 1371 | } |
| 1372 | } |
| 1373 | if msglen < 0 { |
| 1374 | return ErrInvalidLengthGenerated |
| 1375 | } |
| 1376 | postIndex := iNdEx + msglen |
| 1377 | if postIndex > l { |
| 1378 | return io.ErrUnexpectedEOF |
| 1379 | } |
| 1380 | if m.IPBlock == nil { |
| 1381 | m.IPBlock = &IPBlock{} |
| 1382 | } |
| 1383 | if err := m.IPBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 1384 | return err |
| 1385 | } |
| 1386 | iNdEx = postIndex |
| 1387 | default: |
| 1388 | iNdEx = preIndex |
| 1389 | skippy, err := skipGenerated(dAtA[iNdEx:]) |
| 1390 | if err != nil { |
| 1391 | return err |
| 1392 | } |
| 1393 | if skippy < 0 { |
| 1394 | return ErrInvalidLengthGenerated |
| 1395 | } |
| 1396 | if (iNdEx + skippy) > l { |
| 1397 | return io.ErrUnexpectedEOF |
| 1398 | } |
| 1399 | iNdEx += skippy |
| 1400 | } |
| 1401 | } |
| 1402 | |
| 1403 | if iNdEx > l { |
| 1404 | return io.ErrUnexpectedEOF |
| 1405 | } |
| 1406 | return nil |
| 1407 | } |
| 1408 | func (m *NetworkPolicyPort) Unmarshal(dAtA []byte) error { |
| 1409 | l := len(dAtA) |
| 1410 | iNdEx := 0 |
| 1411 | for iNdEx < l { |
| 1412 | preIndex := iNdEx |
| 1413 | var wire uint64 |
| 1414 | for shift := uint(0); ; shift += 7 { |
| 1415 | if shift >= 64 { |
| 1416 | return ErrIntOverflowGenerated |
| 1417 | } |
| 1418 | if iNdEx >= l { |
| 1419 | return io.ErrUnexpectedEOF |
| 1420 | } |
| 1421 | b := dAtA[iNdEx] |
| 1422 | iNdEx++ |
| 1423 | wire |= (uint64(b) & 0x7F) << shift |
| 1424 | if b < 0x80 { |
| 1425 | break |
| 1426 | } |
| 1427 | } |
| 1428 | fieldNum := int32(wire >> 3) |
| 1429 | wireType := int(wire & 0x7) |
| 1430 | if wireType == 4 { |
| 1431 | return fmt.Errorf("proto: NetworkPolicyPort: wiretype end group for non-group") |
| 1432 | } |
| 1433 | if fieldNum <= 0 { |
| 1434 | return fmt.Errorf("proto: NetworkPolicyPort: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1435 | } |
| 1436 | switch fieldNum { |
| 1437 | case 1: |
| 1438 | if wireType != 2 { |
| 1439 | return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType) |
| 1440 | } |
| 1441 | var stringLen uint64 |
| 1442 | for shift := uint(0); ; shift += 7 { |
| 1443 | if shift >= 64 { |
| 1444 | return ErrIntOverflowGenerated |
| 1445 | } |
| 1446 | if iNdEx >= l { |
| 1447 | return io.ErrUnexpectedEOF |
| 1448 | } |
| 1449 | b := dAtA[iNdEx] |
| 1450 | iNdEx++ |
| 1451 | stringLen |= (uint64(b) & 0x7F) << shift |
| 1452 | if b < 0x80 { |
| 1453 | break |
| 1454 | } |
| 1455 | } |
| 1456 | intStringLen := int(stringLen) |
| 1457 | if intStringLen < 0 { |
| 1458 | return ErrInvalidLengthGenerated |
| 1459 | } |
| 1460 | postIndex := iNdEx + intStringLen |
| 1461 | if postIndex > l { |
| 1462 | return io.ErrUnexpectedEOF |
| 1463 | } |
| 1464 | s := k8s_io_api_core_v1.Protocol(dAtA[iNdEx:postIndex]) |
| 1465 | m.Protocol = &s |
| 1466 | iNdEx = postIndex |
| 1467 | case 2: |
| 1468 | if wireType != 2 { |
| 1469 | return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) |
| 1470 | } |
| 1471 | var msglen int |
| 1472 | for shift := uint(0); ; shift += 7 { |
| 1473 | if shift >= 64 { |
| 1474 | return ErrIntOverflowGenerated |
| 1475 | } |
| 1476 | if iNdEx >= l { |
| 1477 | return io.ErrUnexpectedEOF |
| 1478 | } |
| 1479 | b := dAtA[iNdEx] |
| 1480 | iNdEx++ |
| 1481 | msglen |= (int(b) & 0x7F) << shift |
| 1482 | if b < 0x80 { |
| 1483 | break |
| 1484 | } |
| 1485 | } |
| 1486 | if msglen < 0 { |
| 1487 | return ErrInvalidLengthGenerated |
| 1488 | } |
| 1489 | postIndex := iNdEx + msglen |
| 1490 | if postIndex > l { |
| 1491 | return io.ErrUnexpectedEOF |
| 1492 | } |
| 1493 | if m.Port == nil { |
| 1494 | m.Port = &k8s_io_apimachinery_pkg_util_intstr.IntOrString{} |
| 1495 | } |
| 1496 | if err := m.Port.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 1497 | return err |
| 1498 | } |
| 1499 | iNdEx = postIndex |
| 1500 | default: |
| 1501 | iNdEx = preIndex |
| 1502 | skippy, err := skipGenerated(dAtA[iNdEx:]) |
| 1503 | if err != nil { |
| 1504 | return err |
| 1505 | } |
| 1506 | if skippy < 0 { |
| 1507 | return ErrInvalidLengthGenerated |
| 1508 | } |
| 1509 | if (iNdEx + skippy) > l { |
| 1510 | return io.ErrUnexpectedEOF |
| 1511 | } |
| 1512 | iNdEx += skippy |
| 1513 | } |
| 1514 | } |
| 1515 | |
| 1516 | if iNdEx > l { |
| 1517 | return io.ErrUnexpectedEOF |
| 1518 | } |
| 1519 | return nil |
| 1520 | } |
| 1521 | func (m *NetworkPolicySpec) Unmarshal(dAtA []byte) error { |
| 1522 | l := len(dAtA) |
| 1523 | iNdEx := 0 |
| 1524 | for iNdEx < l { |
| 1525 | preIndex := iNdEx |
| 1526 | var wire uint64 |
| 1527 | for shift := uint(0); ; shift += 7 { |
| 1528 | if shift >= 64 { |
| 1529 | return ErrIntOverflowGenerated |
| 1530 | } |
| 1531 | if iNdEx >= l { |
| 1532 | return io.ErrUnexpectedEOF |
| 1533 | } |
| 1534 | b := dAtA[iNdEx] |
| 1535 | iNdEx++ |
| 1536 | wire |= (uint64(b) & 0x7F) << shift |
| 1537 | if b < 0x80 { |
| 1538 | break |
| 1539 | } |
| 1540 | } |
| 1541 | fieldNum := int32(wire >> 3) |
| 1542 | wireType := int(wire & 0x7) |
| 1543 | if wireType == 4 { |
| 1544 | return fmt.Errorf("proto: NetworkPolicySpec: wiretype end group for non-group") |
| 1545 | } |
| 1546 | if fieldNum <= 0 { |
| 1547 | return fmt.Errorf("proto: NetworkPolicySpec: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1548 | } |
| 1549 | switch fieldNum { |
| 1550 | case 1: |
| 1551 | if wireType != 2 { |
| 1552 | return fmt.Errorf("proto: wrong wireType = %d for field PodSelector", wireType) |
| 1553 | } |
| 1554 | var msglen int |
| 1555 | for shift := uint(0); ; shift += 7 { |
| 1556 | if shift >= 64 { |
| 1557 | return ErrIntOverflowGenerated |
| 1558 | } |
| 1559 | if iNdEx >= l { |
| 1560 | return io.ErrUnexpectedEOF |
| 1561 | } |
| 1562 | b := dAtA[iNdEx] |
| 1563 | iNdEx++ |
| 1564 | msglen |= (int(b) & 0x7F) << shift |
| 1565 | if b < 0x80 { |
| 1566 | break |
| 1567 | } |
| 1568 | } |
| 1569 | if msglen < 0 { |
| 1570 | return ErrInvalidLengthGenerated |
| 1571 | } |
| 1572 | postIndex := iNdEx + msglen |
| 1573 | if postIndex > l { |
| 1574 | return io.ErrUnexpectedEOF |
| 1575 | } |
| 1576 | if err := m.PodSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 1577 | return err |
| 1578 | } |
| 1579 | iNdEx = postIndex |
| 1580 | case 2: |
| 1581 | if wireType != 2 { |
| 1582 | return fmt.Errorf("proto: wrong wireType = %d for field Ingress", wireType) |
| 1583 | } |
| 1584 | var msglen int |
| 1585 | for shift := uint(0); ; shift += 7 { |
| 1586 | if shift >= 64 { |
| 1587 | return ErrIntOverflowGenerated |
| 1588 | } |
| 1589 | if iNdEx >= l { |
| 1590 | return io.ErrUnexpectedEOF |
| 1591 | } |
| 1592 | b := dAtA[iNdEx] |
| 1593 | iNdEx++ |
| 1594 | msglen |= (int(b) & 0x7F) << shift |
| 1595 | if b < 0x80 { |
| 1596 | break |
| 1597 | } |
| 1598 | } |
| 1599 | if msglen < 0 { |
| 1600 | return ErrInvalidLengthGenerated |
| 1601 | } |
| 1602 | postIndex := iNdEx + msglen |
| 1603 | if postIndex > l { |
| 1604 | return io.ErrUnexpectedEOF |
| 1605 | } |
| 1606 | m.Ingress = append(m.Ingress, NetworkPolicyIngressRule{}) |
| 1607 | if err := m.Ingress[len(m.Ingress)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 1608 | return err |
| 1609 | } |
| 1610 | iNdEx = postIndex |
| 1611 | case 3: |
| 1612 | if wireType != 2 { |
| 1613 | return fmt.Errorf("proto: wrong wireType = %d for field Egress", wireType) |
| 1614 | } |
| 1615 | var msglen int |
| 1616 | for shift := uint(0); ; shift += 7 { |
| 1617 | if shift >= 64 { |
| 1618 | return ErrIntOverflowGenerated |
| 1619 | } |
| 1620 | if iNdEx >= l { |
| 1621 | return io.ErrUnexpectedEOF |
| 1622 | } |
| 1623 | b := dAtA[iNdEx] |
| 1624 | iNdEx++ |
| 1625 | msglen |= (int(b) & 0x7F) << shift |
| 1626 | if b < 0x80 { |
| 1627 | break |
| 1628 | } |
| 1629 | } |
| 1630 | if msglen < 0 { |
| 1631 | return ErrInvalidLengthGenerated |
| 1632 | } |
| 1633 | postIndex := iNdEx + msglen |
| 1634 | if postIndex > l { |
| 1635 | return io.ErrUnexpectedEOF |
| 1636 | } |
| 1637 | m.Egress = append(m.Egress, NetworkPolicyEgressRule{}) |
| 1638 | if err := m.Egress[len(m.Egress)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 1639 | return err |
| 1640 | } |
| 1641 | iNdEx = postIndex |
| 1642 | case 4: |
| 1643 | if wireType != 2 { |
| 1644 | return fmt.Errorf("proto: wrong wireType = %d for field PolicyTypes", wireType) |
| 1645 | } |
| 1646 | var stringLen uint64 |
| 1647 | for shift := uint(0); ; shift += 7 { |
| 1648 | if shift >= 64 { |
| 1649 | return ErrIntOverflowGenerated |
| 1650 | } |
| 1651 | if iNdEx >= l { |
| 1652 | return io.ErrUnexpectedEOF |
| 1653 | } |
| 1654 | b := dAtA[iNdEx] |
| 1655 | iNdEx++ |
| 1656 | stringLen |= (uint64(b) & 0x7F) << shift |
| 1657 | if b < 0x80 { |
| 1658 | break |
| 1659 | } |
| 1660 | } |
| 1661 | intStringLen := int(stringLen) |
| 1662 | if intStringLen < 0 { |
| 1663 | return ErrInvalidLengthGenerated |
| 1664 | } |
| 1665 | postIndex := iNdEx + intStringLen |
| 1666 | if postIndex > l { |
| 1667 | return io.ErrUnexpectedEOF |
| 1668 | } |
| 1669 | m.PolicyTypes = append(m.PolicyTypes, PolicyType(dAtA[iNdEx:postIndex])) |
| 1670 | iNdEx = postIndex |
| 1671 | default: |
| 1672 | iNdEx = preIndex |
| 1673 | skippy, err := skipGenerated(dAtA[iNdEx:]) |
| 1674 | if err != nil { |
| 1675 | return err |
| 1676 | } |
| 1677 | if skippy < 0 { |
| 1678 | return ErrInvalidLengthGenerated |
| 1679 | } |
| 1680 | if (iNdEx + skippy) > l { |
| 1681 | return io.ErrUnexpectedEOF |
| 1682 | } |
| 1683 | iNdEx += skippy |
| 1684 | } |
| 1685 | } |
| 1686 | |
| 1687 | if iNdEx > l { |
| 1688 | return io.ErrUnexpectedEOF |
| 1689 | } |
| 1690 | return nil |
| 1691 | } |
| 1692 | func skipGenerated(dAtA []byte) (n int, err error) { |
| 1693 | l := len(dAtA) |
| 1694 | iNdEx := 0 |
| 1695 | for iNdEx < l { |
| 1696 | var wire uint64 |
| 1697 | for shift := uint(0); ; shift += 7 { |
| 1698 | if shift >= 64 { |
| 1699 | return 0, ErrIntOverflowGenerated |
| 1700 | } |
| 1701 | if iNdEx >= l { |
| 1702 | return 0, io.ErrUnexpectedEOF |
| 1703 | } |
| 1704 | b := dAtA[iNdEx] |
| 1705 | iNdEx++ |
| 1706 | wire |= (uint64(b) & 0x7F) << shift |
| 1707 | if b < 0x80 { |
| 1708 | break |
| 1709 | } |
| 1710 | } |
| 1711 | wireType := int(wire & 0x7) |
| 1712 | switch wireType { |
| 1713 | case 0: |
| 1714 | for shift := uint(0); ; shift += 7 { |
| 1715 | if shift >= 64 { |
| 1716 | return 0, ErrIntOverflowGenerated |
| 1717 | } |
| 1718 | if iNdEx >= l { |
| 1719 | return 0, io.ErrUnexpectedEOF |
| 1720 | } |
| 1721 | iNdEx++ |
| 1722 | if dAtA[iNdEx-1] < 0x80 { |
| 1723 | break |
| 1724 | } |
| 1725 | } |
| 1726 | return iNdEx, nil |
| 1727 | case 1: |
| 1728 | iNdEx += 8 |
| 1729 | return iNdEx, nil |
| 1730 | case 2: |
| 1731 | var length int |
| 1732 | for shift := uint(0); ; shift += 7 { |
| 1733 | if shift >= 64 { |
| 1734 | return 0, ErrIntOverflowGenerated |
| 1735 | } |
| 1736 | if iNdEx >= l { |
| 1737 | return 0, io.ErrUnexpectedEOF |
| 1738 | } |
| 1739 | b := dAtA[iNdEx] |
| 1740 | iNdEx++ |
| 1741 | length |= (int(b) & 0x7F) << shift |
| 1742 | if b < 0x80 { |
| 1743 | break |
| 1744 | } |
| 1745 | } |
| 1746 | iNdEx += length |
| 1747 | if length < 0 { |
| 1748 | return 0, ErrInvalidLengthGenerated |
| 1749 | } |
| 1750 | return iNdEx, nil |
| 1751 | case 3: |
| 1752 | for { |
| 1753 | var innerWire uint64 |
| 1754 | var start int = iNdEx |
| 1755 | for shift := uint(0); ; shift += 7 { |
| 1756 | if shift >= 64 { |
| 1757 | return 0, ErrIntOverflowGenerated |
| 1758 | } |
| 1759 | if iNdEx >= l { |
| 1760 | return 0, io.ErrUnexpectedEOF |
| 1761 | } |
| 1762 | b := dAtA[iNdEx] |
| 1763 | iNdEx++ |
| 1764 | innerWire |= (uint64(b) & 0x7F) << shift |
| 1765 | if b < 0x80 { |
| 1766 | break |
| 1767 | } |
| 1768 | } |
| 1769 | innerWireType := int(innerWire & 0x7) |
| 1770 | if innerWireType == 4 { |
| 1771 | break |
| 1772 | } |
| 1773 | next, err := skipGenerated(dAtA[start:]) |
| 1774 | if err != nil { |
| 1775 | return 0, err |
| 1776 | } |
| 1777 | iNdEx = start + next |
| 1778 | } |
| 1779 | return iNdEx, nil |
| 1780 | case 4: |
| 1781 | return iNdEx, nil |
| 1782 | case 5: |
| 1783 | iNdEx += 4 |
| 1784 | return iNdEx, nil |
| 1785 | default: |
| 1786 | return 0, fmt.Errorf("proto: illegal wireType %d", wireType) |
| 1787 | } |
| 1788 | } |
| 1789 | panic("unreachable") |
| 1790 | } |
| 1791 | |
| 1792 | var ( |
| 1793 | ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") |
| 1794 | ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") |
| 1795 | ) |
| 1796 | |
| 1797 | func init() { |
| 1798 | proto.RegisterFile("k8s.io/kubernetes/vendor/k8s.io/api/networking/v1/generated.proto", fileDescriptorGenerated) |
| 1799 | } |
| 1800 | |
| 1801 | var fileDescriptorGenerated = []byte{ |
| 1802 | // 804 bytes of a gzipped FileDescriptorProto |
| 1803 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xcf, 0x8f, 0xdb, 0x44, |
| 1804 | 0x14, 0x8e, 0x9d, 0x6c, 0x92, 0x4e, 0x28, 0x65, 0x07, 0x21, 0xac, 0x45, 0xd8, 0xc1, 0x17, 0x56, |
| 1805 | 0xaa, 0x18, 0x93, 0x16, 0x21, 0x6e, 0x08, 0x43, 0x29, 0x91, 0xba, 0xbb, 0xd1, 0x6c, 0x2f, 0x20, |
| 1806 | 0x90, 0x70, 0x9c, 0x59, 0xef, 0x34, 0xb1, 0xc7, 0x1a, 0x4f, 0x42, 0xf7, 0xc6, 0x9f, 0xc0, 0x1f, |
| 1807 | 0xc2, 0x91, 0x1b, 0x87, 0x72, 0xdc, 0x63, 0x8f, 0x3d, 0x59, 0xac, 0xf9, 0x2f, 0xf6, 0x84, 0x66, |
| 1808 | 0x3c, 0x89, 0xf3, 0xa3, 0x11, 0xd9, 0x15, 0xbd, 0x65, 0xde, 0xbc, 0xef, 0x7b, 0xf3, 0xde, 0xfb, |
| 1809 | 0xf2, 0x19, 0x7c, 0x35, 0xfe, 0x22, 0x43, 0x94, 0x79, 0xe3, 0xe9, 0x90, 0xf0, 0x84, 0x08, 0x92, |
| 1810 | 0x79, 0x33, 0x92, 0x8c, 0x18, 0xf7, 0xf4, 0x45, 0x90, 0x52, 0x2f, 0x21, 0xe2, 0x17, 0xc6, 0xc7, |
| 1811 | 0x34, 0x89, 0xbc, 0x59, 0xcf, 0x8b, 0x48, 0x42, 0x78, 0x20, 0xc8, 0x08, 0xa5, 0x9c, 0x09, 0x06, |
| 1812 | 0xad, 0x32, 0x13, 0x05, 0x29, 0x45, 0x55, 0x26, 0x9a, 0xf5, 0x0e, 0x3e, 0x89, 0xa8, 0x38, 0x9f, |
| 1813 | 0x0e, 0x51, 0xc8, 0x62, 0x2f, 0x62, 0x11, 0xf3, 0x14, 0x60, 0x38, 0x3d, 0x53, 0x27, 0x75, 0x50, |
| 1814 | 0xbf, 0x4a, 0xa2, 0x03, 0x77, 0xa9, 0x64, 0xc8, 0x38, 0x79, 0x4d, 0xb1, 0x83, 0xcf, 0xaa, 0x9c, |
| 1815 | 0x38, 0x08, 0xcf, 0x69, 0x42, 0xf8, 0x85, 0x97, 0x8e, 0x23, 0x19, 0xc8, 0xbc, 0x98, 0x88, 0xe0, |
| 1816 | 0x75, 0x28, 0x6f, 0x1b, 0x8a, 0x4f, 0x13, 0x41, 0x63, 0xb2, 0x01, 0xf8, 0xfc, 0xbf, 0x00, 0x59, |
| 1817 | 0x78, 0x4e, 0xe2, 0x60, 0x03, 0xf7, 0x70, 0x1b, 0x6e, 0x2a, 0xe8, 0xc4, 0xa3, 0x89, 0xc8, 0x04, |
| 1818 | 0x5f, 0x07, 0xb9, 0x27, 0xa0, 0xd5, 0x1f, 0xf8, 0x13, 0x16, 0x8e, 0x61, 0x17, 0x34, 0x42, 0x3a, |
| 1819 | 0xe2, 0x96, 0xd1, 0x35, 0x0e, 0xef, 0xf8, 0x6f, 0x5d, 0xe6, 0x4e, 0xad, 0xc8, 0x9d, 0xc6, 0xd7, |
| 1820 | 0xfd, 0x6f, 0x30, 0x56, 0x37, 0xd0, 0x05, 0x4d, 0xf2, 0x3c, 0x24, 0xa9, 0xb0, 0xcc, 0x6e, 0xfd, |
| 1821 | 0xf0, 0x8e, 0x0f, 0x8a, 0xdc, 0x69, 0x3e, 0x52, 0x11, 0xac, 0x6f, 0xdc, 0xbf, 0x0c, 0x70, 0xf7, |
| 1822 | 0xb8, 0xdc, 0xc4, 0x80, 0x4d, 0x68, 0x78, 0x01, 0x7f, 0x06, 0x6d, 0x39, 0x9b, 0x51, 0x20, 0x02, |
| 1823 | 0xc5, 0xdd, 0x79, 0xf0, 0x29, 0xaa, 0xd6, 0xb6, 0x78, 0x2a, 0x4a, 0xc7, 0x91, 0x0c, 0x64, 0x48, |
| 1824 | 0x66, 0xa3, 0x59, 0x0f, 0x9d, 0x0c, 0x9f, 0x91, 0x50, 0x1c, 0x11, 0x11, 0xf8, 0x50, 0xbf, 0x06, |
| 1825 | 0x54, 0x31, 0xbc, 0x60, 0x85, 0x47, 0xa0, 0x91, 0xa5, 0x24, 0xb4, 0x4c, 0xc5, 0x7e, 0x1f, 0x6d, |
| 1826 | 0x13, 0x05, 0x5a, 0x79, 0xd8, 0x69, 0x4a, 0xc2, 0xaa, 0x4d, 0x79, 0xc2, 0x8a, 0xc6, 0xfd, 0xc3, |
| 1827 | 0x00, 0xef, 0xaf, 0x64, 0x3e, 0x8a, 0x38, 0xc9, 0x32, 0x3c, 0x9d, 0x10, 0x38, 0x00, 0x7b, 0x29, |
| 1828 | 0xe3, 0x22, 0xb3, 0x8c, 0x6e, 0xfd, 0x06, 0xb5, 0x06, 0x8c, 0x0b, 0xff, 0xae, 0xae, 0xb5, 0x27, |
| 1829 | 0x4f, 0x19, 0x2e, 0x89, 0xe0, 0x63, 0x60, 0x0a, 0xa6, 0x06, 0x7a, 0x03, 0x3a, 0x42, 0xb8, 0x0f, |
| 1830 | 0x34, 0x9d, 0xf9, 0x94, 0x61, 0x53, 0x30, 0xf7, 0x4f, 0x03, 0x58, 0x2b, 0x59, 0xfd, 0xe4, 0x4d, |
| 1831 | 0xbe, 0xfb, 0x08, 0x34, 0xce, 0x38, 0x8b, 0x6f, 0xf3, 0xf2, 0xc5, 0xd0, 0xbf, 0xe5, 0x2c, 0xc6, |
| 1832 | 0x8a, 0xc6, 0x7d, 0x61, 0x80, 0xfd, 0x95, 0xcc, 0x27, 0x34, 0x13, 0xf0, 0xc7, 0x0d, 0xed, 0xa0, |
| 1833 | 0xdd, 0xb4, 0x23, 0xd1, 0x4a, 0x39, 0xef, 0xe8, 0x5a, 0xed, 0x79, 0x64, 0x49, 0x37, 0x4f, 0xc0, |
| 1834 | 0x1e, 0x15, 0x24, 0xce, 0x74, 0x0f, 0x1f, 0xef, 0xd8, 0x43, 0x35, 0x90, 0xbe, 0x44, 0xe3, 0x92, |
| 1835 | 0xc4, 0x7d, 0x61, 0xae, 0x75, 0x20, 0x7b, 0x85, 0x67, 0xa0, 0x93, 0xb2, 0xd1, 0x29, 0x99, 0x90, |
| 1836 | 0x50, 0x30, 0xae, 0x9b, 0x78, 0xb8, 0x63, 0x13, 0xc1, 0x90, 0x4c, 0xe6, 0x50, 0xff, 0x5e, 0x91, |
| 1837 | 0x3b, 0x9d, 0x41, 0xc5, 0x85, 0x97, 0x89, 0xe1, 0x73, 0xb0, 0x9f, 0x04, 0x31, 0xc9, 0xd2, 0x20, |
| 1838 | 0x24, 0x8b, 0x6a, 0xe6, 0xed, 0xab, 0xbd, 0x57, 0xe4, 0xce, 0xfe, 0xf1, 0x3a, 0x23, 0xde, 0x2c, |
| 1839 | 0x02, 0xbf, 0x03, 0x2d, 0x9a, 0x2a, 0x0b, 0xb1, 0xea, 0xaa, 0xde, 0x47, 0xdb, 0xe7, 0xa8, 0xbd, |
| 1840 | 0xc6, 0xef, 0x14, 0xb9, 0x33, 0x37, 0x1e, 0x3c, 0x87, 0xbb, 0xbf, 0xaf, 0x6b, 0x40, 0x0a, 0x0e, |
| 1841 | 0x3e, 0x06, 0x6d, 0xe5, 0x55, 0x21, 0x9b, 0x68, 0x6f, 0xba, 0x2f, 0xf7, 0x39, 0xd0, 0xb1, 0xeb, |
| 1842 | 0xdc, 0xf9, 0x60, 0xd3, 0xbc, 0xd1, 0xfc, 0x1a, 0x2f, 0xc0, 0xf0, 0x18, 0x34, 0xa4, 0x74, 0xf5, |
| 1843 | 0x54, 0xb6, 0x9b, 0x90, 0xf4, 0x4b, 0x54, 0xfa, 0x25, 0xea, 0x27, 0xe2, 0x84, 0x9f, 0x0a, 0x4e, |
| 1844 | 0x93, 0xc8, 0x6f, 0x4b, 0xc9, 0xca, 0x27, 0x61, 0xc5, 0xe3, 0x5e, 0xaf, 0x2f, 0x5c, 0x7a, 0x08, |
| 1845 | 0x7c, 0xf6, 0xbf, 0x2d, 0xfc, 0x5d, 0x2d, 0xb3, 0xed, 0x4b, 0xff, 0x09, 0xb4, 0x68, 0xf9, 0x27, |
| 1846 | 0xd7, 0x12, 0x7e, 0xb0, 0xa3, 0x84, 0x97, 0xac, 0xc1, 0xbf, 0xa7, 0xcb, 0xb4, 0xe6, 0xc1, 0x39, |
| 1847 | 0x27, 0xfc, 0x1e, 0x34, 0x49, 0xc9, 0x5e, 0x57, 0xec, 0xbd, 0x1d, 0xd9, 0x2b, 0xbf, 0xf4, 0xdf, |
| 1848 | 0xd6, 0xe4, 0x4d, 0x1d, 0xd3, 0x84, 0xf0, 0x4b, 0x39, 0x25, 0x99, 0xfb, 0xf4, 0x22, 0x25, 0x99, |
| 1849 | 0xd5, 0x50, 0xdf, 0x93, 0x0f, 0xcb, 0x66, 0x17, 0xe1, 0xeb, 0xdc, 0x01, 0xd5, 0x11, 0x2f, 0x23, |
| 1850 | 0xfc, 0xc3, 0xcb, 0x2b, 0xbb, 0xf6, 0xf2, 0xca, 0xae, 0xbd, 0xba, 0xb2, 0x6b, 0xbf, 0x16, 0xb6, |
| 1851 | 0x71, 0x59, 0xd8, 0xc6, 0xcb, 0xc2, 0x36, 0x5e, 0x15, 0xb6, 0xf1, 0x77, 0x61, 0x1b, 0xbf, 0xfd, |
| 1852 | 0x63, 0xd7, 0x7e, 0x30, 0x67, 0xbd, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xf7, 0x7b, 0xc9, 0x59, |
| 1853 | 0x67, 0x08, 0x00, 0x00, |
| 1854 | } |