Change-Id: I5cf0f646251eefb42f6395be5910027d2c8942f2
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/5240
Reviewed-by: Anish Swaminathan <anishs@vmware.com>
Tested-by: Anish Swaminathan <anishs@vmware.com>
| ... | ... |
@@ -1,7 +1,7 @@ |
| 1 |
-From e6e701d8663ca3dbcf298ed4a10bf5b6120ce4d3 Mon Sep 17 00:00:00 2001 |
|
| 1 |
+From 40064b0cbc084faa76f8f2d29f1c3ed8ae693b02 Mon Sep 17 00:00:00 2001 |
|
| 2 | 2 |
From: Bo Gan <ganb@vmware.com> |
| 3 |
-Date: Sat, 2 Jun 2018 16:24:59 -0700 |
|
| 4 |
-Subject: [PATCH] Cascade Kubernetes patches for v1.9.6 (8ef8da7) |
|
| 3 |
+Date: Fri, 8 Jun 2018 16:29:28 -0700 |
|
| 4 |
+Subject: [PATCH] Cascade Kubernetes patches for v1.9.6 (df346df) |
|
| 5 | 5 |
|
| 6 | 6 |
--- |
| 7 | 7 |
api/swagger-spec/apps_v1alpha1.json | 21 + |
| ... | ... |
@@ -22,16 +22,17 @@ Subject: [PATCH] Cascade Kubernetes patches for v1.9.6 (8ef8da7) |
| 22 | 22 |
pkg/apis/core/validation/validation.go | 25 + |
| 23 | 23 |
pkg/apis/extensions/types.go | 1 + |
| 24 | 24 |
pkg/cloudprovider/providers/BUILD | 2 + |
| 25 |
- pkg/cloudprovider/providers/cascade/BUILD | 44 ++ |
|
| 25 |
+ pkg/cloudprovider/providers/cascade/BUILD | 56 +++ |
|
| 26 | 26 |
pkg/cloudprovider/providers/cascade/OWNERS | 3 + |
| 27 | 27 |
pkg/cloudprovider/providers/cascade/apitypes.go | 227 +++++++++ |
| 28 | 28 |
pkg/cloudprovider/providers/cascade/auth.go | 145 ++++++ |
| 29 |
- pkg/cloudprovider/providers/cascade/cascade.go | 216 ++++++++ |
|
| 29 |
+ pkg/cloudprovider/providers/cascade/cascade.go | 218 +++++++++ |
|
| 30 | 30 |
.../providers/cascade/cascade_disks.go | 225 +++++++++ |
| 31 |
- .../providers/cascade/cascade_instances.go | 90 ++++ |
|
| 31 |
+ .../providers/cascade/cascade_instances.go | 91 ++++ |
|
| 32 |
+ .../providers/cascade/cascade_instances_test.go | 43 ++ |
|
| 32 | 33 |
.../providers/cascade/cascade_loadbalancer.go | 284 +++++++++++ |
| 33 | 34 |
pkg/cloudprovider/providers/cascade/client.go | 394 +++++++++++++++ |
| 34 |
- pkg/cloudprovider/providers/cascade/oidcclient.go | 297 +++++++++++ |
|
| 35 |
+ pkg/cloudprovider/providers/cascade/oidcclient.go | 297 ++++++++++++ |
|
| 35 | 36 |
pkg/cloudprovider/providers/cascade/restclient.go | 262 ++++++++++ |
| 36 | 37 |
pkg/cloudprovider/providers/cascade/tests_owed | 5 + |
| 37 | 38 |
pkg/cloudprovider/providers/cascade/utils.go | 25 + |
| ... | ... |
@@ -40,16 +41,16 @@ Subject: [PATCH] Cascade Kubernetes patches for v1.9.6 (8ef8da7) |
| 40 | 40 |
pkg/security/podsecuritypolicy/util/util.go | 3 + |
| 41 | 41 |
pkg/volume/cascade_disk/BUILD | 43 ++ |
| 42 | 42 |
pkg/volume/cascade_disk/OWNERS | 2 + |
| 43 |
- pkg/volume/cascade_disk/attacher.go | 269 ++++++++++ |
|
| 43 |
+ pkg/volume/cascade_disk/attacher.go | 269 +++++++++++ |
|
| 44 | 44 |
pkg/volume/cascade_disk/cascade_disk.go | 391 +++++++++++++++ |
| 45 | 45 |
pkg/volume/cascade_disk/cascade_util.go | 107 ++++ |
| 46 |
- .../admission/persistentvolume/label/admission.go | 54 ++ |
|
| 46 |
+ .../admission/persistentvolume/label/admission.go | 54 +++ |
|
| 47 | 47 |
plugin/pkg/admission/vke/BUILD | 58 +++ |
| 48 |
- plugin/pkg/admission/vke/admission.go | 374 ++++++++++++++ |
|
| 49 |
- plugin/pkg/admission/vke/admission_test.go | 541 +++++++++++++++++++++ |
|
| 48 |
+ plugin/pkg/admission/vke/admission.go | 349 +++++++++++++ |
|
| 49 |
+ plugin/pkg/admission/vke/admission_test.go | 538 +++++++++++++++++++++ |
|
| 50 | 50 |
staging/src/k8s.io/api/core/v1/generated.pb.go | 310 +++++++++++- |
| 51 | 51 |
staging/src/k8s.io/api/core/v1/types.go | 26 +- |
| 52 |
- 45 files changed, 4623 insertions(+), 29 deletions(-) |
|
| 52 |
+ 46 files changed, 4653 insertions(+), 29 deletions(-) |
|
| 53 | 53 |
create mode 100644 pkg/cloudprovider/providers/cascade/BUILD |
| 54 | 54 |
create mode 100644 pkg/cloudprovider/providers/cascade/OWNERS |
| 55 | 55 |
create mode 100644 pkg/cloudprovider/providers/cascade/apitypes.go |
| ... | ... |
@@ -57,6 +58,7 @@ Subject: [PATCH] Cascade Kubernetes patches for v1.9.6 (8ef8da7) |
| 57 | 57 |
create mode 100644 pkg/cloudprovider/providers/cascade/cascade.go |
| 58 | 58 |
create mode 100644 pkg/cloudprovider/providers/cascade/cascade_disks.go |
| 59 | 59 |
create mode 100644 pkg/cloudprovider/providers/cascade/cascade_instances.go |
| 60 |
+ create mode 100644 pkg/cloudprovider/providers/cascade/cascade_instances_test.go |
|
| 60 | 61 |
create mode 100644 pkg/cloudprovider/providers/cascade/cascade_loadbalancer.go |
| 61 | 62 |
create mode 100644 pkg/cloudprovider/providers/cascade/client.go |
| 62 | 63 |
create mode 100644 pkg/cloudprovider/providers/cascade/oidcclient.go |
| ... | ... |
@@ -73,7 +75,7 @@ Subject: [PATCH] Cascade Kubernetes patches for v1.9.6 (8ef8da7) |
| 73 | 73 |
create mode 100644 plugin/pkg/admission/vke/admission_test.go |
| 74 | 74 |
|
| 75 | 75 |
diff --git a/api/swagger-spec/apps_v1alpha1.json b/api/swagger-spec/apps_v1alpha1.json |
| 76 |
-index aa3fbdc..9dba11e 100644 |
|
| 76 |
+index aa3fbdc..0189f38 100644 |
|
| 77 | 77 |
--- a/api/swagger-spec/apps_v1alpha1.json |
| 78 | 78 |
+++ b/api/swagger-spec/apps_v1alpha1.json |
| 79 | 79 |
@@ -1459,6 +1459,10 @@ |
| ... | ... |
@@ -81,9 +83,9 @@ index aa3fbdc..9dba11e 100644 |
| 81 | 81 |
"$ref": "v1.PhotonPersistentDiskVolumeSource", |
| 82 | 82 |
"description": "PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine" |
| 83 | 83 |
+ }, |
| 84 |
-+ "cascadeDisk": {
|
|
| 84 |
++ "vkeDisk": {
|
|
| 85 | 85 |
+ "$ref": "v1.CascadeDiskVolumeSource", |
| 86 |
-+ "description": "CascadeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 86 |
++ "description": "vkeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 87 | 87 |
} |
| 88 | 88 |
} |
| 89 | 89 |
}, |
| ... | ... |
@@ -112,16 +114,16 @@ index aa3fbdc..9dba11e 100644 |
| 112 | 112 |
"id": "v1.Container", |
| 113 | 113 |
"description": "A single application container that you want to run within a pod.", |
| 114 | 114 |
diff --git a/api/swagger-spec/apps_v1beta1.json b/api/swagger-spec/apps_v1beta1.json |
| 115 |
-index e253317..6968ed0 100644 |
|
| 115 |
+index e253317..c1fa812 100644 |
|
| 116 | 116 |
--- a/api/swagger-spec/apps_v1beta1.json |
| 117 | 117 |
+++ b/api/swagger-spec/apps_v1beta1.json |
| 118 | 118 |
@@ -4479,6 +4479,10 @@ |
| 119 | 119 |
"$ref": "v1.PhotonPersistentDiskVolumeSource", |
| 120 | 120 |
"description": "PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine" |
| 121 | 121 |
}, |
| 122 |
-+ "cascadeDisk": {
|
|
| 122 |
++ "vkeDisk": {
|
|
| 123 | 123 |
+ "$ref": "v1.CascadeDiskVolumeSource", |
| 124 |
-+ "description": "CascadeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 124 |
++ "description": "vkeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 125 | 125 |
+ }, |
| 126 | 126 |
"projected": {
|
| 127 | 127 |
"$ref": "v1.ProjectedVolumeSource", |
| ... | ... |
@@ -151,16 +153,16 @@ index e253317..6968ed0 100644 |
| 151 | 151 |
"id": "v1.ProjectedVolumeSource", |
| 152 | 152 |
"description": "Represents a projected volume source", |
| 153 | 153 |
diff --git a/api/swagger-spec/apps_v1beta2.json b/api/swagger-spec/apps_v1beta2.json |
| 154 |
-index be42788..28d0247 100644 |
|
| 154 |
+index be42788..5abb9f5 100644 |
|
| 155 | 155 |
--- a/api/swagger-spec/apps_v1beta2.json |
| 156 | 156 |
+++ b/api/swagger-spec/apps_v1beta2.json |
| 157 | 157 |
@@ -6845,6 +6845,10 @@ |
| 158 | 158 |
"$ref": "v1.PhotonPersistentDiskVolumeSource", |
| 159 | 159 |
"description": "PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine" |
| 160 | 160 |
}, |
| 161 |
-+ "cascadeDisk": {
|
|
| 161 |
++ "vkeDisk": {
|
|
| 162 | 162 |
+ "$ref": "v1.CascadeDiskVolumeSource", |
| 163 |
-+ "description": "CascadeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 163 |
++ "description": "vkeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 164 | 164 |
+ }, |
| 165 | 165 |
"projected": {
|
| 166 | 166 |
"$ref": "v1.ProjectedVolumeSource", |
| ... | ... |
@@ -190,16 +192,16 @@ index be42788..28d0247 100644 |
| 190 | 190 |
"id": "v1.ProjectedVolumeSource", |
| 191 | 191 |
"description": "Represents a projected volume source", |
| 192 | 192 |
diff --git a/api/swagger-spec/batch_v1.json b/api/swagger-spec/batch_v1.json |
| 193 |
-index 28787d8..9adba42 100644 |
|
| 193 |
+index 28787d8..28fcb65 100644 |
|
| 194 | 194 |
--- a/api/swagger-spec/batch_v1.json |
| 195 | 195 |
+++ b/api/swagger-spec/batch_v1.json |
| 196 | 196 |
@@ -1819,6 +1819,10 @@ |
| 197 | 197 |
"$ref": "v1.PhotonPersistentDiskVolumeSource", |
| 198 | 198 |
"description": "PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine" |
| 199 | 199 |
}, |
| 200 |
-+ "cascadeDisk": {
|
|
| 200 |
++ "vkeDisk": {
|
|
| 201 | 201 |
+ "$ref": "v1.CascadeDiskVolumeSource", |
| 202 |
-+ "description": "CascadeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 202 |
++ "description": "vkeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 203 | 203 |
+ }, |
| 204 | 204 |
"projected": {
|
| 205 | 205 |
"$ref": "v1.ProjectedVolumeSource", |
| ... | ... |
@@ -229,16 +231,16 @@ index 28787d8..9adba42 100644 |
| 229 | 229 |
"id": "v1.ProjectedVolumeSource", |
| 230 | 230 |
"description": "Represents a projected volume source", |
| 231 | 231 |
diff --git a/api/swagger-spec/batch_v1beta1.json b/api/swagger-spec/batch_v1beta1.json |
| 232 |
-index bb9b870..8bab946 100644 |
|
| 232 |
+index bb9b870..f67a014 100644 |
|
| 233 | 233 |
--- a/api/swagger-spec/batch_v1beta1.json |
| 234 | 234 |
+++ b/api/swagger-spec/batch_v1beta1.json |
| 235 | 235 |
@@ -1874,6 +1874,10 @@ |
| 236 | 236 |
"$ref": "v1.PhotonPersistentDiskVolumeSource", |
| 237 | 237 |
"description": "PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine" |
| 238 | 238 |
}, |
| 239 |
-+ "cascadeDisk": {
|
|
| 239 |
++ "vkeDisk": {
|
|
| 240 | 240 |
+ "$ref": "v1.CascadeDiskVolumeSource", |
| 241 |
-+ "description": "CascadeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 241 |
++ "description": "vkeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 242 | 242 |
+ }, |
| 243 | 243 |
"projected": {
|
| 244 | 244 |
"$ref": "v1.ProjectedVolumeSource", |
| ... | ... |
@@ -268,7 +270,7 @@ index bb9b870..8bab946 100644 |
| 268 | 268 |
"id": "v1.ProjectedVolumeSource", |
| 269 | 269 |
"description": "Represents a projected volume source", |
| 270 | 270 |
diff --git a/api/swagger-spec/batch_v2alpha1.json b/api/swagger-spec/batch_v2alpha1.json |
| 271 |
-index cde6619..1e428a5 100644 |
|
| 271 |
+index cde6619..78888be 100644 |
|
| 272 | 272 |
--- a/api/swagger-spec/batch_v2alpha1.json |
| 273 | 273 |
+++ b/api/swagger-spec/batch_v2alpha1.json |
| 274 | 274 |
@@ -1889,6 +1889,10 @@ |
| ... | ... |
@@ -276,9 +278,9 @@ index cde6619..1e428a5 100644 |
| 276 | 276 |
"$ref": "v1.StorageOSVolumeSource", |
| 277 | 277 |
"description": "StorageOS represents a StorageOS volume attached and mounted on Kubernetes nodes." |
| 278 | 278 |
+ }, |
| 279 |
-+ "cascadeDisk": {
|
|
| 279 |
++ "vkeDisk": {
|
|
| 280 | 280 |
+ "$ref": "v1.CascadeDiskVolumeSource", |
| 281 |
-+ "description": "CascadeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 281 |
++ "description": "vkeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 282 | 282 |
} |
| 283 | 283 |
} |
| 284 | 284 |
}, |
| ... | ... |
@@ -307,7 +309,7 @@ index cde6619..1e428a5 100644 |
| 307 | 307 |
"id": "v1.Container", |
| 308 | 308 |
"description": "A single application container that you want to run within a pod.", |
| 309 | 309 |
diff --git a/api/swagger-spec/extensions_v1beta1.json b/api/swagger-spec/extensions_v1beta1.json |
| 310 |
-index d8b20a3..ea271e1 100644 |
|
| 310 |
+index d8b20a3..73342a1 100644 |
|
| 311 | 311 |
--- a/api/swagger-spec/extensions_v1beta1.json |
| 312 | 312 |
+++ b/api/swagger-spec/extensions_v1beta1.json |
| 313 | 313 |
@@ -7502,6 +7502,10 @@ |
| ... | ... |
@@ -315,9 +317,9 @@ index d8b20a3..ea271e1 100644 |
| 315 | 315 |
"$ref": "v1.StorageOSVolumeSource", |
| 316 | 316 |
"description": "StorageOS represents a StorageOS volume attached and mounted on Kubernetes nodes." |
| 317 | 317 |
+ }, |
| 318 |
-+ "cascadeDisk": {
|
|
| 318 |
++ "vkeDisk": {
|
|
| 319 | 319 |
+ "$ref": "v1.CascadeDiskVolumeSource", |
| 320 |
-+ "description": "CascadeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 320 |
++ "description": "vkeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 321 | 321 |
} |
| 322 | 322 |
} |
| 323 | 323 |
}, |
| ... | ... |
@@ -346,7 +348,7 @@ index d8b20a3..ea271e1 100644 |
| 346 | 346 |
"id": "v1.ProjectedVolumeSource", |
| 347 | 347 |
"description": "Represents a projected volume source", |
| 348 | 348 |
diff --git a/api/swagger-spec/settings.k8s.io_v1alpha1.json b/api/swagger-spec/settings.k8s.io_v1alpha1.json |
| 349 |
-index dc442a8..c1b2d1e 100644 |
|
| 349 |
+index dc442a8..8c1f100 100644 |
|
| 350 | 350 |
--- a/api/swagger-spec/settings.k8s.io_v1alpha1.json |
| 351 | 351 |
+++ b/api/swagger-spec/settings.k8s.io_v1alpha1.json |
| 352 | 352 |
@@ -1676,6 +1676,10 @@ |
| ... | ... |
@@ -354,9 +356,9 @@ index dc442a8..c1b2d1e 100644 |
| 354 | 354 |
"$ref": "v1.StorageOSVolumeSource", |
| 355 | 355 |
"description": "StorageOS represents a StorageOS volume attached and mounted on Kubernetes nodes." |
| 356 | 356 |
+ }, |
| 357 |
-+ "cascadeDisk": {
|
|
| 357 |
++ "vkeDisk": {
|
|
| 358 | 358 |
+ "$ref": "v1.CascadeDiskVolumeSource", |
| 359 |
-+ "description": "CascadeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 359 |
++ "description": "vkeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 360 | 360 |
} |
| 361 | 361 |
} |
| 362 | 362 |
}, |
| ... | ... |
@@ -385,16 +387,16 @@ index dc442a8..c1b2d1e 100644 |
| 385 | 385 |
"id": "v1.ProjectedVolumeSource", |
| 386 | 386 |
"description": "Represents a projected volume source", |
| 387 | 387 |
diff --git a/api/swagger-spec/v1.json b/api/swagger-spec/v1.json |
| 388 |
-index 97be62b..e1cba2b 100644 |
|
| 388 |
+index 97be62b..df544c8 100644 |
|
| 389 | 389 |
--- a/api/swagger-spec/v1.json |
| 390 | 390 |
+++ b/api/swagger-spec/v1.json |
| 391 | 391 |
@@ -20629,6 +20629,10 @@ |
| 392 | 392 |
"$ref": "v1.PhotonPersistentDiskVolumeSource", |
| 393 | 393 |
"description": "PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine" |
| 394 | 394 |
}, |
| 395 |
-+ "cascadeDisk": {
|
|
| 395 |
++ "vkeDisk": {
|
|
| 396 | 396 |
+ "$ref": "v1.CascadeDiskVolumeSource", |
| 397 |
-+ "description": "CascadeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 397 |
++ "description": "vkeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 398 | 398 |
+ }, |
| 399 | 399 |
"portworxVolume": {
|
| 400 | 400 |
"$ref": "v1.PortworxVolumeSource", |
| ... | ... |
@@ -428,9 +430,9 @@ index 97be62b..e1cba2b 100644 |
| 428 | 428 |
"$ref": "v1.StorageOSVolumeSource", |
| 429 | 429 |
"description": "StorageOS represents a StorageOS volume attached and mounted on Kubernetes nodes." |
| 430 | 430 |
+ }, |
| 431 |
-+ "cascadeDisk": {
|
|
| 431 |
++ "vkeDisk": {
|
|
| 432 | 432 |
+ "$ref": "v1.CascadeDiskVolumeSource", |
| 433 |
-+ "description": "CascadeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 433 |
++ "description": "vkeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 434 | 434 |
} |
| 435 | 435 |
} |
| 436 | 436 |
}, |
| ... | ... |
@@ -655,10 +657,10 @@ index aeccfa1..4313576 100644 |
| 655 | 655 |
"//pkg/cloudprovider/providers/gce:all-srcs", |
| 656 | 656 |
diff --git a/pkg/cloudprovider/providers/cascade/BUILD b/pkg/cloudprovider/providers/cascade/BUILD |
| 657 | 657 |
new file mode 100644 |
| 658 |
-index 0000000..1ff2ad1 |
|
| 658 |
+index 0000000..4089166 |
|
| 659 | 659 |
--- /dev/null |
| 660 | 660 |
+++ b/pkg/cloudprovider/providers/cascade/BUILD |
| 661 |
-@@ -0,0 +1,44 @@ |
|
| 661 |
+@@ -0,0 +1,56 @@ |
|
| 662 | 662 |
+package(default_visibility = ["//visibility:public"]) |
| 663 | 663 |
+ |
| 664 | 664 |
+load( |
| ... | ... |
@@ -691,6 +693,18 @@ index 0000000..1ff2ad1 |
| 691 | 691 |
+ ], |
| 692 | 692 |
+) |
| 693 | 693 |
+ |
| 694 |
++go_test( |
|
| 695 |
++ name = "go_default_test", |
|
| 696 |
++ srcs = [ |
|
| 697 |
++ "cascade_instances_test.go", |
|
| 698 |
++ ], |
|
| 699 |
++ embed = [":go_default_library"], |
|
| 700 |
++ deps = [ |
|
| 701 |
++ "//vendor/k8s.io/api/core/v1:go_default_library", |
|
| 702 |
++ "//vendor/github.com/stretchr/testify/assert:go_default_library", |
|
| 703 |
++ ], |
|
| 704 |
++) |
|
| 705 |
++ |
|
| 694 | 706 |
+filegroup( |
| 695 | 707 |
+ name = "package-srcs", |
| 696 | 708 |
+ srcs = glob(["**"]), |
| ... | ... |
@@ -1099,10 +1113,10 @@ index 0000000..fc92377 |
| 1099 | 1099 |
\ No newline at end of file |
| 1100 | 1100 |
diff --git a/pkg/cloudprovider/providers/cascade/cascade.go b/pkg/cloudprovider/providers/cascade/cascade.go |
| 1101 | 1101 |
new file mode 100644 |
| 1102 |
-index 0000000..e5e2baf |
|
| 1102 |
+index 0000000..db97234 |
|
| 1103 | 1103 |
--- /dev/null |
| 1104 | 1104 |
+++ b/pkg/cloudprovider/providers/cascade/cascade.go |
| 1105 |
-@@ -0,0 +1,216 @@ |
|
| 1105 |
+@@ -0,0 +1,218 @@ |
|
| 1106 | 1106 |
+// The use of Cascade cloud provider requires the kubelet, kube-apiserver, and kube-controller-manager to be started |
| 1107 | 1107 |
+// with config flag: '--cloud-provider=cascade --cloud-config=[path_to_config_file]'. |
| 1108 | 1108 |
+package cascade |
| ... | ... |
@@ -1110,18 +1124,18 @@ index 0000000..e5e2baf |
| 1110 | 1110 |
+import ( |
| 1111 | 1111 |
+ "errors" |
| 1112 | 1112 |
+ "fmt" |
| 1113 |
-+ "io" |
|
| 1114 |
-+ "os" |
|
| 1115 | 1113 |
+ "github.com/golang/glog" |
| 1116 | 1114 |
+ "gopkg.in/gcfg.v1" |
| 1115 |
++ "io" |
|
| 1117 | 1116 |
+ k8stypes "k8s.io/apimachinery/pkg/types" |
| 1118 | 1117 |
+ "k8s.io/kubernetes/pkg/cloudprovider" |
| 1119 | 1118 |
+ "k8s.io/kubernetes/pkg/controller" |
| 1119 |
++ "os" |
|
| 1120 | 1120 |
+ "strings" |
| 1121 | 1121 |
+) |
| 1122 | 1122 |
+ |
| 1123 | 1123 |
+const ( |
| 1124 |
-+ ProviderName = "cascade" |
|
| 1124 |
++ ProviderName = "vke" |
|
| 1125 | 1125 |
+ DiskSpecKind = "persistent-disk" |
| 1126 | 1126 |
+ MasterPrefix = "master" |
| 1127 | 1127 |
+) |
| ... | ... |
@@ -1158,6 +1172,8 @@ index 0000000..e5e2baf |
| 1158 | 1158 |
+ Region string `gcfg:"region"` |
| 1159 | 1159 |
+ // Availability zone in which the cluster is in |
| 1160 | 1160 |
+ Zone string `gcfg:"zone"` |
| 1161 |
++ // IP address of the node. |
|
| 1162 |
++ IPAddress string `gcfg:"ipAddress"` |
|
| 1161 | 1163 |
+ } |
| 1162 | 1164 |
+} |
| 1163 | 1165 |
+ |
| ... | ... |
@@ -1286,7 +1302,7 @@ index 0000000..e5e2baf |
| 1286 | 1286 |
+ |
| 1287 | 1287 |
+func (cc *CascadeCloud) GetZone() (cloudprovider.Zone, error) {
|
| 1288 | 1288 |
+ return cloudprovider.Zone{
|
| 1289 |
-+ Region: cc.cfg.Global.Region, |
|
| 1289 |
++ Region: cc.cfg.Global.Region, |
|
| 1290 | 1290 |
+ FailureDomain: cc.cfg.Global.Zone, |
| 1291 | 1291 |
+ }, nil |
| 1292 | 1292 |
+} |
| ... | ... |
@@ -1319,7 +1335,6 @@ index 0000000..e5e2baf |
| 1319 | 1319 |
+func (cc *CascadeCloud) HasClusterID() bool {
|
| 1320 | 1320 |
+ return true |
| 1321 | 1321 |
+} |
| 1322 |
-\ No newline at end of file |
|
| 1323 | 1322 |
diff --git a/pkg/cloudprovider/providers/cascade/cascade_disks.go b/pkg/cloudprovider/providers/cascade/cascade_disks.go |
| 1324 | 1323 |
new file mode 100644 |
| 1325 | 1324 |
index 0000000..320e123 |
| ... | ... |
@@ -1553,10 +1568,10 @@ index 0000000..320e123 |
| 1553 | 1553 |
+} |
| 1554 | 1554 |
diff --git a/pkg/cloudprovider/providers/cascade/cascade_instances.go b/pkg/cloudprovider/providers/cascade/cascade_instances.go |
| 1555 | 1555 |
new file mode 100644 |
| 1556 |
-index 0000000..f270a3d |
|
| 1556 |
+index 0000000..0172151 |
|
| 1557 | 1557 |
--- /dev/null |
| 1558 | 1558 |
+++ b/pkg/cloudprovider/providers/cascade/cascade_instances.go |
| 1559 |
-@@ -0,0 +1,90 @@ |
|
| 1559 |
+@@ -0,0 +1,91 @@ |
|
| 1560 | 1560 |
+package cascade |
| 1561 | 1561 |
+ |
| 1562 | 1562 |
+import ( |
| ... | ... |
@@ -1569,9 +1584,10 @@ index 0000000..f270a3d |
| 1569 | 1569 |
+// NodeAddresses is an implementation of Instances.NodeAddresses. In the future, private IP address, external IP, etc. |
| 1570 | 1570 |
+// will be added based on need. |
| 1571 | 1571 |
+func (cc *CascadeCloud) NodeAddresses(nodeName k8stypes.NodeName) ([]v1.NodeAddress, error) {
|
| 1572 |
-+ addresses := []v1.NodeAddress{}
|
|
| 1573 |
-+ addresses = append(addresses, v1.NodeAddress{Type: v1.NodeInternalDNS, Address: cc.cfg.Global.DNSName})
|
|
| 1574 |
-+ return addresses, nil |
|
| 1572 |
++ return []v1.NodeAddress{
|
|
| 1573 |
++ {Type: v1.NodeInternalIP, Address: cc.cfg.Global.IPAddress},
|
|
| 1574 |
++ {Type: v1.NodeInternalDNS, Address: cc.cfg.Global.DNSName},
|
|
| 1575 |
++ }, nil |
|
| 1575 | 1576 |
+} |
| 1576 | 1577 |
+ |
| 1577 | 1578 |
+// NodeAddressesByProviderID returns the node addresses of an instances with the specified unique providerID |
| ... | ... |
@@ -1647,6 +1663,55 @@ index 0000000..f270a3d |
| 1647 | 1647 |
+func (cc *CascadeCloud) InstanceType(nodeName k8stypes.NodeName) (string, error) {
|
| 1648 | 1648 |
+ return "", nil |
| 1649 | 1649 |
+} |
| 1650 |
+diff --git a/pkg/cloudprovider/providers/cascade/cascade_instances_test.go b/pkg/cloudprovider/providers/cascade/cascade_instances_test.go |
|
| 1651 |
+new file mode 100644 |
|
| 1652 |
+index 0000000..bec5491 |
|
| 1653 |
+--- /dev/null |
|
| 1654 |
+@@ -0,0 +1,43 @@ |
|
| 1655 |
++package cascade |
|
| 1656 |
++ |
|
| 1657 |
++import ( |
|
| 1658 |
++ "strings" |
|
| 1659 |
++ "testing" |
|
| 1660 |
++ |
|
| 1661 |
++ "github.com/stretchr/testify/assert" |
|
| 1662 |
++ "k8s.io/api/core/v1" |
|
| 1663 |
++) |
|
| 1664 |
++ |
|
| 1665 |
++const configFile = ` |
|
| 1666 |
++[Global] |
|
| 1667 |
++target = target |
|
| 1668 |
++tenantName = tenant |
|
| 1669 |
++clusterID = cluster-id |
|
| 1670 |
++authEndpoint = auth-endpoint |
|
| 1671 |
++domainName = domain.test |
|
| 1672 |
++dnsName = node.domain.test |
|
| 1673 |
++region = region |
|
| 1674 |
++zone = zone |
|
| 1675 |
++ipAddress = 1.1.1.1 |
|
| 1676 |
++` |
|
| 1677 |
++ |
|
| 1678 |
++func getCascadeInstance() (*CascadeCloud, error) {
|
|
| 1679 |
++ cfg, err := readConfig(strings.NewReader(configFile)) |
|
| 1680 |
++ return &CascadeCloud{
|
|
| 1681 |
++ cfg: cfg, |
|
| 1682 |
++ localHostname: "hostname", |
|
| 1683 |
++ localK8sHostname: "", |
|
| 1684 |
++ }, err |
|
| 1685 |
++} |
|
| 1686 |
++ |
|
| 1687 |
++func TestNodeAddresses(t *testing.T) {
|
|
| 1688 |
++ cc, err := getCascadeInstance() |
|
| 1689 |
++ assert.Nil(t, err) |
|
| 1690 |
++ expectedNodeAddresses := []v1.NodeAddress{
|
|
| 1691 |
++ {Type: v1.NodeInternalIP, Address: "1.1.1.1"},
|
|
| 1692 |
++ {Type: v1.NodeInternalDNS, Address: "node.domain.test"},
|
|
| 1693 |
++ } |
|
| 1694 |
++ actualNodeAddresses, err := cc.NodeAddresses("node")
|
|
| 1695 |
++ assert.Nil(t, err) |
|
| 1696 |
++ assert.Equal(t, expectedNodeAddresses, actualNodeAddresses) |
|
| 1697 |
++} |
|
| 1650 | 1698 |
diff --git a/pkg/cloudprovider/providers/cascade/cascade_loadbalancer.go b/pkg/cloudprovider/providers/cascade/cascade_loadbalancer.go |
| 1651 | 1699 |
new file mode 100644 |
| 1652 | 1700 |
index 0000000..e28282f |
| ... | ... |
@@ -2965,7 +3030,7 @@ index 7de9ca9..6d8a1d2 100644 |
| 2965 | 2965 |
_ "k8s.io/kubernetes/pkg/cloudprovider/providers/gce" |
| 2966 | 2966 |
_ "k8s.io/kubernetes/pkg/cloudprovider/providers/openstack" |
| 2967 | 2967 |
diff --git a/pkg/printers/internalversion/describe.go b/pkg/printers/internalversion/describe.go |
| 2968 |
-index c33b1c6..11e6c8b 100644 |
|
| 2968 |
+index c33b1c6..ef39b3b 100644 |
|
| 2969 | 2969 |
--- a/pkg/printers/internalversion/describe.go |
| 2970 | 2970 |
+++ b/pkg/printers/internalversion/describe.go |
| 2971 | 2971 |
@@ -751,6 +751,8 @@ func describeVolumes(volumes []api.Volume, w PrefixWriter, space string) {
|
| ... | ... |
@@ -2982,7 +3047,7 @@ index c33b1c6..11e6c8b 100644 |
| 2982 | 2982 |
} |
| 2983 | 2983 |
|
| 2984 | 2984 |
+func printCascadeDiskVolumeSource(cascade *api.CascadeDiskVolumeSource, w PrefixWriter) {
|
| 2985 |
-+ w.Write(LEVEL_2, "Type:\tCascadeDisk (a Persistent Disk resource in Cascade)\n"+ |
|
| 2985 |
++ w.Write(LEVEL_2, "Type:\tVKEDisk (a Persistent Disk resource in VKE)\n"+ |
|
| 2986 | 2986 |
+ " DiskID:\t%v\n"+ |
| 2987 | 2987 |
+ " FSType:\t%v\n", |
| 2988 | 2988 |
+ cascade.DiskID, cascade.FSType) |
| ... | ... |
@@ -3355,7 +3420,7 @@ index 0000000..607fcb5 |
| 3355 | 3355 |
+} |
| 3356 | 3356 |
diff --git a/pkg/volume/cascade_disk/cascade_disk.go b/pkg/volume/cascade_disk/cascade_disk.go |
| 3357 | 3357 |
new file mode 100644 |
| 3358 |
-index 0000000..88945c3 |
|
| 3358 |
+index 0000000..a25f224 |
|
| 3359 | 3359 |
--- /dev/null |
| 3360 | 3360 |
+++ b/pkg/volume/cascade_disk/cascade_disk.go |
| 3361 | 3361 |
@@ -0,0 +1,391 @@ |
| ... | ... |
@@ -3393,7 +3458,7 @@ index 0000000..88945c3 |
| 3393 | 3393 |
+var _ volume.ProvisionableVolumePlugin = &cascadeDiskPlugin{}
|
| 3394 | 3394 |
+ |
| 3395 | 3395 |
+const ( |
| 3396 |
-+ cascadeDiskPluginName = "kubernetes.io/cascade-disk" |
|
| 3396 |
++ cascadeDiskPluginName = "kubernetes.io/vke-disk" |
|
| 3397 | 3397 |
+) |
| 3398 | 3398 |
+ |
| 3399 | 3399 |
+// Init initializes the Cascade volume plugin. |
| ... | ... |
@@ -3716,7 +3781,7 @@ index 0000000..88945c3 |
| 3716 | 3716 |
+ Name: p.options.PVName, |
| 3717 | 3717 |
+ Labels: map[string]string{},
|
| 3718 | 3718 |
+ Annotations: map[string]string{
|
| 3719 |
-+ volumehelper.VolumeDynamicallyCreatedByKey: "cascade-volume-dynamic-provisioner", |
|
| 3719 |
++ volumehelper.VolumeDynamicallyCreatedByKey: "vke-volume-dynamic-provisioner", |
|
| 3720 | 3720 |
+ }, |
| 3721 | 3721 |
+ }, |
| 3722 | 3722 |
+ Spec: v1.PersistentVolumeSpec{
|
| ... | ... |
@@ -3865,7 +3930,7 @@ index 0000000..3dcef3d |
| 3865 | 3865 |
+ return cc, nil |
| 3866 | 3866 |
+} |
| 3867 | 3867 |
diff --git a/plugin/pkg/admission/persistentvolume/label/admission.go b/plugin/pkg/admission/persistentvolume/label/admission.go |
| 3868 |
-index 86e1921..b9b546f 100644 |
|
| 3868 |
+index 86e1921..bf2912b 100644 |
|
| 3869 | 3869 |
--- a/plugin/pkg/admission/persistentvolume/label/admission.go |
| 3870 | 3870 |
+++ b/plugin/pkg/admission/persistentvolume/label/admission.go |
| 3871 | 3871 |
@@ -27,6 +27,7 @@ import ( |
| ... | ... |
@@ -3934,7 +3999,7 @@ index 86e1921..b9b546f 100644 |
| 3934 | 3934 |
+ if len(l.cloudConfig) > 0 {
|
| 3935 | 3935 |
+ cloudConfigReader = bytes.NewReader(l.cloudConfig) |
| 3936 | 3936 |
+ } |
| 3937 |
-+ cloudProvider, err := cloudprovider.GetCloudProvider("cascade", cloudConfigReader)
|
|
| 3937 |
++ cloudProvider, err := cloudprovider.GetCloudProvider("vke", cloudConfigReader)
|
|
| 3938 | 3938 |
+ if err != nil || cloudProvider == nil {
|
| 3939 | 3939 |
+ return nil, err |
| 3940 | 3940 |
+ } |
| ... | ... |
@@ -4014,10 +4079,10 @@ index 0000000..b0a6026 |
| 4014 | 4014 |
\ No newline at end of file |
| 4015 | 4015 |
diff --git a/plugin/pkg/admission/vke/admission.go b/plugin/pkg/admission/vke/admission.go |
| 4016 | 4016 |
new file mode 100644 |
| 4017 |
-index 0000000..4cfc8c5 |
|
| 4017 |
+index 0000000..15cbb85 |
|
| 4018 | 4018 |
--- /dev/null |
| 4019 | 4019 |
+++ b/plugin/pkg/admission/vke/admission.go |
| 4020 |
-@@ -0,0 +1,374 @@ |
|
| 4020 |
+@@ -0,0 +1,349 @@ |
|
| 4021 | 4021 |
+package vke |
| 4022 | 4022 |
+ |
| 4023 | 4023 |
+import ( |
| ... | ... |
@@ -4047,9 +4112,7 @@ index 0000000..4cfc8c5 |
| 4047 | 4047 |
+ privilegedServiceAccount = "system:serviceaccount:" + privilegedNamespace + ":" |
| 4048 | 4048 |
+ reservedPrefix = "vke" |
| 4049 | 4049 |
+ kubeletGroup = "system:nodes" |
| 4050 |
-+ kubeProxyGroup = "cascade:kube-proxies" |
|
| 4051 |
-+ dashboardPod = "vke-dashboard-0" |
|
| 4052 |
-+ kubeSystemNamespace = "kube-system" |
|
| 4050 |
++ kubeProxyGroup = "vke:kube-proxies" |
|
| 4053 | 4051 |
+) |
| 4054 | 4052 |
+ |
| 4055 | 4053 |
+// Register registers a plugin. |
| ... | ... |
@@ -4148,6 +4211,9 @@ index 0000000..4cfc8c5 |
| 4148 | 4148 |
+ HostIPC: false, |
| 4149 | 4149 |
+ HostPID: false, |
| 4150 | 4150 |
+ AllowPrivilegeEscalation: false, |
| 4151 |
++ HostPorts: []extensions.HostPortRange{
|
|
| 4152 |
++ {1, 65535},
|
|
| 4153 |
++ }, |
|
| 4151 | 4154 |
+ Volumes: []extensions.FSType{
|
| 4152 | 4155 |
+ "emptyDir", |
| 4153 | 4156 |
+ "secret", |
| ... | ... |
@@ -4284,20 +4350,13 @@ index 0000000..4cfc8c5 |
| 4284 | 4284 |
+ return nil |
| 4285 | 4285 |
+ } |
| 4286 | 4286 |
+ |
| 4287 |
-+ // If it is a Connect operation, allow it. We restrict access to connect to any pods in the vke-system namespace. |
|
| 4288 |
-+ // Also, DenyEscalatingExec admission controller denies access to connect to any privileged pod in general. So it is |
|
| 4289 |
-+ // OK to allow this. |
|
| 4290 |
-+ if a.GetOperation() == admission.Connect {
|
|
| 4287 |
++ // If it is a Connect or Delete operation, allow it. We restrict access to connect to any pods in the vke-system |
|
| 4288 |
++ // namespace. Also, DenyEscalatingExec admission controller denies access to connect to any privileged pod in |
|
| 4289 |
++ // general. So it is OK to allow this. |
|
| 4290 |
++ if a.GetOperation() == admission.Connect && a.GetOperation() == admission.Delete {
|
|
| 4291 | 4291 |
+ return nil |
| 4292 | 4292 |
+ } |
| 4293 | 4293 |
+ |
| 4294 |
-+ // If it is a Delete operation and it is not a pod with a reserved prefix, allow it. We restrict access to delete |
|
| 4295 |
-+ // any pods in the vke-system namespace. So it is OK to allow this. |
|
| 4296 |
-+ // TODO: Make sure we do not have a need to delete the dashboard stateful set. If we do then it will fail. |
|
| 4297 |
-+ if a.GetOperation() == admission.Delete {
|
|
| 4298 |
-+ return checkReservedPrefix(a.GetName(), a) |
|
| 4299 |
-+ } |
|
| 4300 |
-+ |
|
| 4301 | 4294 |
+ // If we cannot get the pod object, fail. |
| 4302 | 4295 |
+ if _, ok := a.GetObject().(*api.Pod); !ok {
|
| 4303 | 4296 |
+ return admission.NewForbidden(a, |
| ... | ... |
@@ -4315,25 +4374,6 @@ index 0000000..4cfc8c5 |
| 4315 | 4315 |
+ errs := field.ErrorList{}
|
| 4316 | 4316 |
+ originalPod := a.GetObject().(*api.Pod) |
| 4317 | 4317 |
+ |
| 4318 |
-+ // If the pod is our dashboard pod, its namespace is kube-system and it is created by the controller-manager then |
|
| 4319 |
-+ // skip validation. This pod is in kube-system namespace which is not privileged. But we need to allow the dashboard |
|
| 4320 |
-+ // pod to be privileged because it has the OIDC proxy container which requires hostPath volume mount. Just to make |
|
| 4321 |
-+ // sure we allow only this one pod, we make sure that it is created by the controller manager and name matches the |
|
| 4322 |
-+ // dashboard pod and it is in kube-system. |
|
| 4323 |
-+ if a.GetUserInfo().GetName() == systemUnsecuredUser && a.GetNamespace() == kubeSystemNamespace && |
|
| 4324 |
-+ (a.GetName() == dashboardPod || originalPod.Name == dashboardPod) {
|
|
| 4325 |
-+ return nil |
|
| 4326 |
-+ } |
|
| 4327 |
-+ |
|
| 4328 |
-+ // Check if the pod that needs to be created or updated has the reserved prefix. If it does, deny the request. |
|
| 4329 |
-+ podName := a.GetName() |
|
| 4330 |
-+ if podName == "" {
|
|
| 4331 |
-+ podName = originalPod.Name |
|
| 4332 |
-+ } |
|
| 4333 |
-+ if err := checkReservedPrefix(podName, a); err != nil {
|
|
| 4334 |
-+ return err |
|
| 4335 |
-+ } |
|
| 4336 |
-+ |
|
| 4337 | 4318 |
+ // Generate a copy of the pod object because we are not allowed to mutate the pod object. |
| 4338 | 4319 |
+ pod := originalPod.DeepCopy() |
| 4339 | 4320 |
+ |
| ... | ... |
@@ -4394,10 +4434,10 @@ index 0000000..4cfc8c5 |
| 4394 | 4394 |
+} |
| 4395 | 4395 |
diff --git a/plugin/pkg/admission/vke/admission_test.go b/plugin/pkg/admission/vke/admission_test.go |
| 4396 | 4396 |
new file mode 100644 |
| 4397 |
-index 0000000..81acbe1 |
|
| 4397 |
+index 0000000..596b7d4 |
|
| 4398 | 4398 |
--- /dev/null |
| 4399 | 4399 |
+++ b/plugin/pkg/admission/vke/admission_test.go |
| 4400 |
-@@ -0,0 +1,541 @@ |
|
| 4400 |
+@@ -0,0 +1,538 @@ |
|
| 4401 | 4401 |
+package vke |
| 4402 | 4402 |
+ |
| 4403 | 4403 |
+import ( |
| ... | ... |
@@ -4476,6 +4516,12 @@ index 0000000..81acbe1 |
| 4476 | 4476 |
+ userInfo: newTestUserBuilder().build(), |
| 4477 | 4477 |
+ shouldPassValidate: false, |
| 4478 | 4478 |
+ }, |
| 4479 |
++ "create pod with HostPort allowed": {
|
|
| 4480 |
++ operation: kadmission.Create, |
|
| 4481 |
++ pod: newTestPodBuilder().withHostPort().build(), |
|
| 4482 |
++ userInfo: newTestUserBuilder().build(), |
|
| 4483 |
++ shouldPassValidate: true, |
|
| 4484 |
++ }, |
|
| 4479 | 4485 |
+ "create pod with HostVolume denied": {
|
| 4480 | 4486 |
+ operation: kadmission.Create, |
| 4481 | 4487 |
+ pod: newTestPodBuilder().withHostVolume().build(), |
| ... | ... |
@@ -4494,20 +4540,6 @@ index 0000000..81acbe1 |
| 4494 | 4494 |
+ userInfo: newTestUserBuilder().build(), |
| 4495 | 4495 |
+ shouldPassValidate: false, |
| 4496 | 4496 |
+ }, |
| 4497 |
-+ "create pod with vke prefix denied": {
|
|
| 4498 |
-+ operation: kadmission.Create, |
|
| 4499 |
-+ pod: newTestPodBuilder().build(), |
|
| 4500 |
-+ name: "vke-dashboard", |
|
| 4501 |
-+ userInfo: newTestUserBuilder().build(), |
|
| 4502 |
-+ shouldPassValidate: false, |
|
| 4503 |
-+ }, |
|
| 4504 |
-+ "create dashboard pod with vke prefix by privileged user in kube-system allowed": {
|
|
| 4505 |
-+ operation: kadmission.Create, |
|
| 4506 |
-+ pod: newTestPodBuilder().withNamespace(kubeSystemNamespace).build(), |
|
| 4507 |
-+ name: "vke-dashboard-0", |
|
| 4508 |
-+ userInfo: newTestUserBuilder().withName(systemUnsecuredUser).build(), |
|
| 4509 |
-+ shouldPassValidate: true, |
|
| 4510 |
-+ }, |
|
| 4511 | 4497 |
+ "connect pod allowed": {
|
| 4512 | 4498 |
+ operation: kadmission.Connect, |
| 4513 | 4499 |
+ pod: newTestPodBuilder().build(), |
| ... | ... |
@@ -4520,13 +4552,6 @@ index 0000000..81acbe1 |
| 4520 | 4520 |
+ userInfo: newTestUserBuilder().build(), |
| 4521 | 4521 |
+ shouldPassValidate: true, |
| 4522 | 4522 |
+ }, |
| 4523 |
-+ "delete pod with vke prefix denied": {
|
|
| 4524 |
-+ operation: kadmission.Delete, |
|
| 4525 |
-+ pod: newTestPodBuilder().build(), |
|
| 4526 |
-+ name: "vke-dashboard", |
|
| 4527 |
-+ userInfo: newTestUserBuilder().build(), |
|
| 4528 |
-+ shouldPassValidate: false, |
|
| 4529 |
-+ }, |
|
| 4530 | 4523 |
+ } |
| 4531 | 4524 |
+ |
| 4532 | 4525 |
+ for k, v := range tests {
|
| ... | ... |
@@ -4854,6 +4879,18 @@ index 0000000..81acbe1 |
| 4854 | 4854 |
+ return p |
| 4855 | 4855 |
+} |
| 4856 | 4856 |
+ |
| 4857 |
++func (p *testPodBuilder) withHostPort() *testPodBuilder {
|
|
| 4858 |
++ containerPorts := []kapi.ContainerPort{
|
|
| 4859 |
++ {
|
|
| 4860 |
++ HostPort: 3000, |
|
| 4861 |
++ ContainerPort: 80, |
|
| 4862 |
++ }, |
|
| 4863 |
++ } |
|
| 4864 |
++ |
|
| 4865 |
++ p.pod.Spec.Containers[0].Ports = containerPorts |
|
| 4866 |
++ return p |
|
| 4867 |
++} |
|
| 4868 |
++ |
|
| 4857 | 4869 |
+func (p *testPodBuilder) withHostVolume() *testPodBuilder {
|
| 4858 | 4870 |
+ volume := kapi.Volume{
|
| 4859 | 4871 |
+ Name: "host", |
| ... | ... |
@@ -5443,7 +5480,7 @@ index 5aeae2c..a7d5b12 100644 |
| 5443 | 5443 |
iNdEx = preIndex |
| 5444 | 5444 |
skippy, err := skipGenerated(dAtA[iNdEx:]) |
| 5445 | 5445 |
diff --git a/staging/src/k8s.io/api/core/v1/types.go b/staging/src/k8s.io/api/core/v1/types.go |
| 5446 |
-index 728cbd5..8c50888 100644 |
|
| 5446 |
+index 728cbd5..87ba6a4 100644 |
|
| 5447 | 5447 |
--- a/staging/src/k8s.io/api/core/v1/types.go |
| 5448 | 5448 |
+++ b/staging/src/k8s.io/api/core/v1/types.go |
| 5449 | 5449 |
@@ -333,9 +333,8 @@ type VolumeSource struct {
|
| ... | ... |
@@ -5454,7 +5491,7 @@ index 728cbd5..8c50888 100644 |
| 5454 | 5454 |
- // +optional |
| 5455 | 5455 |
- AzureDisk *AzureDiskVolumeSource `json:"azureDisk,omitempty" protobuf:"bytes,22,opt,name=azureDisk"` |
| 5456 | 5456 |
+ // CascadeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine |
| 5457 |
-+ CascadeDisk *CascadeDiskVolumeSource `json:"cascadeDisk,omitempty" protobuf:"bytes,22,opt,name=cascadeDisk"` |
|
| 5457 |
++ CascadeDisk *CascadeDiskVolumeSource `json:"vkeDisk,omitempty" protobuf:"bytes,22,opt,name=cascadeDisk"` |
|
| 5458 | 5458 |
// PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine |
| 5459 | 5459 |
PhotonPersistentDisk *PhotonPersistentDiskVolumeSource `json:"photonPersistentDisk,omitempty" protobuf:"bytes,23,opt,name=photonPersistentDisk"` |
| 5460 | 5460 |
// Items for all in one resources secrets, configmaps, and downward API |
| ... | ... |
@@ -5476,7 +5513,7 @@ index 728cbd5..8c50888 100644 |
| 5476 | 5476 |
- // +optional |
| 5477 | 5477 |
- AzureDisk *AzureDiskVolumeSource `json:"azureDisk,omitempty" protobuf:"bytes,16,opt,name=azureDisk"` |
| 5478 | 5478 |
+ // CascadeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine |
| 5479 |
-+ CascadeDisk *CascadeDiskVolumeSource `json:"cascadeDisk,omitempty" protobuf:"bytes,16,opt,name=cascadeDisk"` |
|
| 5479 |
++ CascadeDisk *CascadeDiskVolumeSource `json:"vkeDisk,omitempty" protobuf:"bytes,16,opt,name=cascadeDisk"` |
|
| 5480 | 5480 |
// PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine |
| 5481 | 5481 |
PhotonPersistentDisk *PhotonPersistentDiskVolumeSource `json:"photonPersistentDisk,omitempty" protobuf:"bytes,17,opt,name=photonPersistentDisk"` |
| 5482 | 5482 |
// PortworxVolume represents a portworx volume attached and mounted on kubelets host machine |
| ... | ... |
@@ -1,7 +1,7 @@ |
| 1 |
-From e1297ed2ee86ca1fca087b06ae1227c1e5e4d61f Mon Sep 17 00:00:00 2001 |
|
| 1 |
+From e4ee3045ca2827e20374b9f1da439eb400d3366c Mon Sep 17 00:00:00 2001 |
|
| 2 | 2 |
From: Bo Gan <ganb@vmware.com> |
| 3 |
-Date: Sat, 2 Jun 2018 16:12:09 -0700 |
|
| 4 |
-Subject: [PATCH] Cascade Kubernetes patches for v1.10.2 (7b1ec01) |
|
| 3 |
+Date: Fri, 8 Jun 2018 16:15:19 -0700 |
|
| 4 |
+Subject: [PATCH] Cascade Kubernetes patches for v1.10.2 (df346df) |
|
| 5 | 5 |
|
| 6 | 6 |
--- |
| 7 | 7 |
api/swagger-spec/apps_v1alpha1.json | 21 + |
| ... | ... |
@@ -21,16 +21,17 @@ Subject: [PATCH] Cascade Kubernetes patches for v1.10.2 (7b1ec01) |
| 21 | 21 |
pkg/apis/core/validation/validation.go | 29 +- |
| 22 | 22 |
pkg/apis/extensions/types.go | 1 + |
| 23 | 23 |
pkg/cloudprovider/providers/BUILD | 2 + |
| 24 |
- pkg/cloudprovider/providers/cascade/BUILD | 44 ++ |
|
| 24 |
+ pkg/cloudprovider/providers/cascade/BUILD | 56 +++ |
|
| 25 | 25 |
pkg/cloudprovider/providers/cascade/OWNERS | 3 + |
| 26 | 26 |
pkg/cloudprovider/providers/cascade/apitypes.go | 227 +++++++++ |
| 27 | 27 |
pkg/cloudprovider/providers/cascade/auth.go | 145 ++++++ |
| 28 |
- pkg/cloudprovider/providers/cascade/cascade.go | 212 ++++++++ |
|
| 28 |
+ pkg/cloudprovider/providers/cascade/cascade.go | 214 ++++++++ |
|
| 29 | 29 |
.../providers/cascade/cascade_disks.go | 227 +++++++++ |
| 30 |
- .../providers/cascade/cascade_instances.go | 91 ++++ |
|
| 30 |
+ .../providers/cascade/cascade_instances.go | 92 ++++ |
|
| 31 |
+ .../providers/cascade/cascade_instances_test.go | 44 ++ |
|
| 31 | 32 |
.../providers/cascade/cascade_loadbalancer.go | 285 +++++++++++ |
| 32 | 33 |
pkg/cloudprovider/providers/cascade/client.go | 394 +++++++++++++++ |
| 33 |
- pkg/cloudprovider/providers/cascade/oidcclient.go | 297 +++++++++++ |
|
| 34 |
+ pkg/cloudprovider/providers/cascade/oidcclient.go | 297 ++++++++++++ |
|
| 34 | 35 |
pkg/cloudprovider/providers/cascade/restclient.go | 262 ++++++++++ |
| 35 | 36 |
pkg/cloudprovider/providers/cascade/tests_owed | 5 + |
| 36 | 37 |
pkg/cloudprovider/providers/cascade/utils.go | 25 + |
| ... | ... |
@@ -43,13 +44,13 @@ Subject: [PATCH] Cascade Kubernetes patches for v1.10.2 (7b1ec01) |
| 43 | 43 |
pkg/volume/cascade_disk/attacher.go | 268 ++++++++++ |
| 44 | 44 |
pkg/volume/cascade_disk/cascade_disk.go | 390 +++++++++++++++ |
| 45 | 45 |
pkg/volume/cascade_disk/cascade_util.go | 107 ++++ |
| 46 |
- .../admission/persistentvolume/label/admission.go | 54 ++ |
|
| 46 |
+ .../admission/persistentvolume/label/admission.go | 54 +++ |
|
| 47 | 47 |
plugin/pkg/admission/vke/BUILD | 58 +++ |
| 48 |
- plugin/pkg/admission/vke/admission.go | 374 ++++++++++++++ |
|
| 49 |
- plugin/pkg/admission/vke/admission_test.go | 541 +++++++++++++++++++++ |
|
| 48 |
+ plugin/pkg/admission/vke/admission.go | 349 +++++++++++++ |
|
| 49 |
+ plugin/pkg/admission/vke/admission_test.go | 538 +++++++++++++++++++++ |
|
| 50 | 50 |
staging/src/k8s.io/api/core/v1/generated.pb.go | 310 +++++++++++- |
| 51 | 51 |
staging/src/k8s.io/api/core/v1/types.go | 24 +- |
| 52 |
- 45 files changed, 4624 insertions(+), 29 deletions(-) |
|
| 52 |
+ 46 files changed, 4655 insertions(+), 29 deletions(-) |
|
| 53 | 53 |
create mode 100644 pkg/cloudprovider/providers/cascade/BUILD |
| 54 | 54 |
create mode 100644 pkg/cloudprovider/providers/cascade/OWNERS |
| 55 | 55 |
create mode 100644 pkg/cloudprovider/providers/cascade/apitypes.go |
| ... | ... |
@@ -57,6 +58,7 @@ Subject: [PATCH] Cascade Kubernetes patches for v1.10.2 (7b1ec01) |
| 57 | 57 |
create mode 100644 pkg/cloudprovider/providers/cascade/cascade.go |
| 58 | 58 |
create mode 100644 pkg/cloudprovider/providers/cascade/cascade_disks.go |
| 59 | 59 |
create mode 100644 pkg/cloudprovider/providers/cascade/cascade_instances.go |
| 60 |
+ create mode 100644 pkg/cloudprovider/providers/cascade/cascade_instances_test.go |
|
| 60 | 61 |
create mode 100644 pkg/cloudprovider/providers/cascade/cascade_loadbalancer.go |
| 61 | 62 |
create mode 100644 pkg/cloudprovider/providers/cascade/client.go |
| 62 | 63 |
create mode 100644 pkg/cloudprovider/providers/cascade/oidcclient.go |
| ... | ... |
@@ -73,7 +75,7 @@ Subject: [PATCH] Cascade Kubernetes patches for v1.10.2 (7b1ec01) |
| 73 | 73 |
create mode 100644 plugin/pkg/admission/vke/admission_test.go |
| 74 | 74 |
|
| 75 | 75 |
diff --git a/api/swagger-spec/apps_v1alpha1.json b/api/swagger-spec/apps_v1alpha1.json |
| 76 |
-index 6f54662..bf61f93 100644 |
|
| 76 |
+index 6f54662..0ce6f3f 100644 |
|
| 77 | 77 |
--- a/api/swagger-spec/apps_v1alpha1.json |
| 78 | 78 |
+++ b/api/swagger-spec/apps_v1alpha1.json |
| 79 | 79 |
@@ -1459,6 +1459,10 @@ |
| ... | ... |
@@ -81,9 +83,9 @@ index 6f54662..bf61f93 100644 |
| 81 | 81 |
"$ref": "v1.PhotonPersistentDiskVolumeSource", |
| 82 | 82 |
"description": "PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine" |
| 83 | 83 |
+ }, |
| 84 |
-+ "cascadeDisk": {
|
|
| 84 |
++ "vkeDisk": {
|
|
| 85 | 85 |
+ "$ref": "v1.CascadeDiskVolumeSource", |
| 86 |
-+ "description": "CascadeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 86 |
++ "description": "vkeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 87 | 87 |
} |
| 88 | 88 |
} |
| 89 | 89 |
}, |
| ... | ... |
@@ -112,16 +114,16 @@ index 6f54662..bf61f93 100644 |
| 112 | 112 |
"id": "v1.Container", |
| 113 | 113 |
"description": "A single application container that you want to run within a pod.", |
| 114 | 114 |
diff --git a/api/swagger-spec/apps_v1beta1.json b/api/swagger-spec/apps_v1beta1.json |
| 115 |
-index a4b090a..6e6471b 100644 |
|
| 115 |
+index a4b090a..6fc1e0a 100644 |
|
| 116 | 116 |
--- a/api/swagger-spec/apps_v1beta1.json |
| 117 | 117 |
+++ b/api/swagger-spec/apps_v1beta1.json |
| 118 | 118 |
@@ -4483,6 +4483,10 @@ |
| 119 | 119 |
"$ref": "v1.PhotonPersistentDiskVolumeSource", |
| 120 | 120 |
"description": "PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine" |
| 121 | 121 |
}, |
| 122 |
-+ "cascadeDisk": {
|
|
| 122 |
++ "vkeDisk": {
|
|
| 123 | 123 |
+ "$ref": "v1.CascadeDiskVolumeSource", |
| 124 |
-+ "description": "CascadeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 124 |
++ "description": "vkeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 125 | 125 |
+ }, |
| 126 | 126 |
"projected": {
|
| 127 | 127 |
"$ref": "v1.ProjectedVolumeSource", |
| ... | ... |
@@ -151,16 +153,16 @@ index a4b090a..6e6471b 100644 |
| 151 | 151 |
"id": "v1.ProjectedVolumeSource", |
| 152 | 152 |
"description": "Represents a projected volume source", |
| 153 | 153 |
diff --git a/api/swagger-spec/apps_v1beta2.json b/api/swagger-spec/apps_v1beta2.json |
| 154 |
-index b1fcb48..b00e42e 100644 |
|
| 154 |
+index b1fcb48..3193163 100644 |
|
| 155 | 155 |
--- a/api/swagger-spec/apps_v1beta2.json |
| 156 | 156 |
+++ b/api/swagger-spec/apps_v1beta2.json |
| 157 | 157 |
@@ -6849,6 +6849,10 @@ |
| 158 | 158 |
"$ref": "v1.PhotonPersistentDiskVolumeSource", |
| 159 | 159 |
"description": "PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine" |
| 160 | 160 |
}, |
| 161 |
-+ "cascadeDisk": {
|
|
| 161 |
++ "vkeDisk": {
|
|
| 162 | 162 |
+ "$ref": "v1.CascadeDiskVolumeSource", |
| 163 |
-+ "description": "CascadeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 163 |
++ "description": "vkeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 164 | 164 |
+ }, |
| 165 | 165 |
"projected": {
|
| 166 | 166 |
"$ref": "v1.ProjectedVolumeSource", |
| ... | ... |
@@ -190,16 +192,16 @@ index b1fcb48..b00e42e 100644 |
| 190 | 190 |
"id": "v1.ProjectedVolumeSource", |
| 191 | 191 |
"description": "Represents a projected volume source", |
| 192 | 192 |
diff --git a/api/swagger-spec/batch_v1.json b/api/swagger-spec/batch_v1.json |
| 193 |
-index b6d6cea..fafdd88 100644 |
|
| 193 |
+index b6d6cea..a6f3aae 100644 |
|
| 194 | 194 |
--- a/api/swagger-spec/batch_v1.json |
| 195 | 195 |
+++ b/api/swagger-spec/batch_v1.json |
| 196 | 196 |
@@ -1823,6 +1823,10 @@ |
| 197 | 197 |
"$ref": "v1.PhotonPersistentDiskVolumeSource", |
| 198 | 198 |
"description": "PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine" |
| 199 | 199 |
}, |
| 200 |
-+ "cascadeDisk": {
|
|
| 200 |
++ "vkeDisk": {
|
|
| 201 | 201 |
+ "$ref": "v1.CascadeDiskVolumeSource", |
| 202 |
-+ "description": "CascadeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 202 |
++ "description": "vkeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 203 | 203 |
+ }, |
| 204 | 204 |
"projected": {
|
| 205 | 205 |
"$ref": "v1.ProjectedVolumeSource", |
| ... | ... |
@@ -229,16 +231,16 @@ index b6d6cea..fafdd88 100644 |
| 229 | 229 |
"id": "v1.ProjectedVolumeSource", |
| 230 | 230 |
"description": "Represents a projected volume source", |
| 231 | 231 |
diff --git a/api/swagger-spec/batch_v1beta1.json b/api/swagger-spec/batch_v1beta1.json |
| 232 |
-index 32cdfc0..a91eca5 100644 |
|
| 232 |
+index 32cdfc0..9aa9744 100644 |
|
| 233 | 233 |
--- a/api/swagger-spec/batch_v1beta1.json |
| 234 | 234 |
+++ b/api/swagger-spec/batch_v1beta1.json |
| 235 | 235 |
@@ -1878,6 +1878,10 @@ |
| 236 | 236 |
"$ref": "v1.PhotonPersistentDiskVolumeSource", |
| 237 | 237 |
"description": "PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine" |
| 238 | 238 |
}, |
| 239 |
-+ "cascadeDisk": {
|
|
| 239 |
++ "vkeDisk": {
|
|
| 240 | 240 |
+ "$ref": "v1.CascadeDiskVolumeSource", |
| 241 |
-+ "description": "CascadeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 241 |
++ "description": "vkeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 242 | 242 |
+ }, |
| 243 | 243 |
"projected": {
|
| 244 | 244 |
"$ref": "v1.ProjectedVolumeSource", |
| ... | ... |
@@ -268,7 +270,7 @@ index 32cdfc0..a91eca5 100644 |
| 268 | 268 |
"id": "v1.ProjectedVolumeSource", |
| 269 | 269 |
"description": "Represents a projected volume source", |
| 270 | 270 |
diff --git a/api/swagger-spec/batch_v2alpha1.json b/api/swagger-spec/batch_v2alpha1.json |
| 271 |
-index 57acdbb..7866e56 100644 |
|
| 271 |
+index 57acdbb..c8a6ff3 100644 |
|
| 272 | 272 |
--- a/api/swagger-spec/batch_v2alpha1.json |
| 273 | 273 |
+++ b/api/swagger-spec/batch_v2alpha1.json |
| 274 | 274 |
@@ -1893,6 +1893,10 @@ |
| ... | ... |
@@ -276,9 +278,9 @@ index 57acdbb..7866e56 100644 |
| 276 | 276 |
"$ref": "v1.StorageOSVolumeSource", |
| 277 | 277 |
"description": "StorageOS represents a StorageOS volume attached and mounted on Kubernetes nodes." |
| 278 | 278 |
+ }, |
| 279 |
-+ "cascadeDisk": {
|
|
| 279 |
++ "vkeDisk": {
|
|
| 280 | 280 |
+ "$ref": "v1.CascadeDiskVolumeSource", |
| 281 |
-+ "description": "CascadeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 281 |
++ "description": "vkeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 282 | 282 |
} |
| 283 | 283 |
} |
| 284 | 284 |
}, |
| ... | ... |
@@ -307,7 +309,7 @@ index 57acdbb..7866e56 100644 |
| 307 | 307 |
"id": "v1.Container", |
| 308 | 308 |
"description": "A single application container that you want to run within a pod.", |
| 309 | 309 |
diff --git a/api/swagger-spec/extensions_v1beta1.json b/api/swagger-spec/extensions_v1beta1.json |
| 310 |
-index 6d2e049..d0c687e 100644 |
|
| 310 |
+index 6d2e049..66b6632 100644 |
|
| 311 | 311 |
--- a/api/swagger-spec/extensions_v1beta1.json |
| 312 | 312 |
+++ b/api/swagger-spec/extensions_v1beta1.json |
| 313 | 313 |
@@ -7506,6 +7506,10 @@ |
| ... | ... |
@@ -315,9 +317,9 @@ index 6d2e049..d0c687e 100644 |
| 315 | 315 |
"$ref": "v1.StorageOSVolumeSource", |
| 316 | 316 |
"description": "StorageOS represents a StorageOS volume attached and mounted on Kubernetes nodes." |
| 317 | 317 |
+ }, |
| 318 |
-+ "cascadeDisk": {
|
|
| 318 |
++ "vkeDisk": {
|
|
| 319 | 319 |
+ "$ref": "v1.CascadeDiskVolumeSource", |
| 320 |
-+ "description": "CascadeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 320 |
++ "description": "vkeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 321 | 321 |
} |
| 322 | 322 |
} |
| 323 | 323 |
}, |
| ... | ... |
@@ -346,7 +348,7 @@ index 6d2e049..d0c687e 100644 |
| 346 | 346 |
"id": "v1.ProjectedVolumeSource", |
| 347 | 347 |
"description": "Represents a projected volume source", |
| 348 | 348 |
diff --git a/api/swagger-spec/settings.k8s.io_v1alpha1.json b/api/swagger-spec/settings.k8s.io_v1alpha1.json |
| 349 |
-index d4427ba..5fc467e 100644 |
|
| 349 |
+index d4427ba..6ad2a97 100644 |
|
| 350 | 350 |
--- a/api/swagger-spec/settings.k8s.io_v1alpha1.json |
| 351 | 351 |
+++ b/api/swagger-spec/settings.k8s.io_v1alpha1.json |
| 352 | 352 |
@@ -1676,6 +1676,10 @@ |
| ... | ... |
@@ -354,9 +356,9 @@ index d4427ba..5fc467e 100644 |
| 354 | 354 |
"$ref": "v1.StorageOSVolumeSource", |
| 355 | 355 |
"description": "StorageOS represents a StorageOS volume attached and mounted on Kubernetes nodes." |
| 356 | 356 |
+ }, |
| 357 |
-+ "cascadeDisk": {
|
|
| 357 |
++ "vkeDisk": {
|
|
| 358 | 358 |
+ "$ref": "v1.CascadeDiskVolumeSource", |
| 359 |
-+ "description": "CascadeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 359 |
++ "description": "vkeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 360 | 360 |
} |
| 361 | 361 |
} |
| 362 | 362 |
}, |
| ... | ... |
@@ -385,16 +387,16 @@ index d4427ba..5fc467e 100644 |
| 385 | 385 |
"id": "v1.ProjectedVolumeSource", |
| 386 | 386 |
"description": "Represents a projected volume source", |
| 387 | 387 |
diff --git a/api/swagger-spec/v1.json b/api/swagger-spec/v1.json |
| 388 |
-index 3f1198e..6eaf2fa 100644 |
|
| 388 |
+index 3f1198e..dbd57f0 100644 |
|
| 389 | 389 |
--- a/api/swagger-spec/v1.json |
| 390 | 390 |
+++ b/api/swagger-spec/v1.json |
| 391 | 391 |
@@ -19310,6 +19310,10 @@ |
| 392 | 392 |
"$ref": "v1.PhotonPersistentDiskVolumeSource", |
| 393 | 393 |
"description": "PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine" |
| 394 | 394 |
}, |
| 395 |
-+ "cascadeDisk": {
|
|
| 395 |
++ "vkeDisk": {
|
|
| 396 | 396 |
+ "$ref": "v1.CascadeDiskVolumeSource", |
| 397 |
-+ "description": "CascadeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 397 |
++ "description": "vkeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 398 | 398 |
+ }, |
| 399 | 399 |
"portworxVolume": {
|
| 400 | 400 |
"$ref": "v1.PortworxVolumeSource", |
| ... | ... |
@@ -428,9 +430,9 @@ index 3f1198e..6eaf2fa 100644 |
| 428 | 428 |
"$ref": "v1.StorageOSVolumeSource", |
| 429 | 429 |
"description": "StorageOS represents a StorageOS volume attached and mounted on Kubernetes nodes." |
| 430 | 430 |
+ }, |
| 431 |
-+ "cascadeDisk": {
|
|
| 431 |
++ "vkeDisk": {
|
|
| 432 | 432 |
+ "$ref": "v1.CascadeDiskVolumeSource", |
| 433 |
-+ "description": "CascadeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 433 |
++ "description": "vkeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine" |
|
| 434 | 434 |
} |
| 435 | 435 |
} |
| 436 | 436 |
}, |
| ... | ... |
@@ -655,10 +657,10 @@ index aeccfa1..4313576 100644 |
| 655 | 655 |
"//pkg/cloudprovider/providers/gce:all-srcs", |
| 656 | 656 |
diff --git a/pkg/cloudprovider/providers/cascade/BUILD b/pkg/cloudprovider/providers/cascade/BUILD |
| 657 | 657 |
new file mode 100644 |
| 658 |
-index 0000000..1ff2ad1 |
|
| 658 |
+index 0000000..4089166 |
|
| 659 | 659 |
--- /dev/null |
| 660 | 660 |
+++ b/pkg/cloudprovider/providers/cascade/BUILD |
| 661 |
-@@ -0,0 +1,44 @@ |
|
| 661 |
+@@ -0,0 +1,56 @@ |
|
| 662 | 662 |
+package(default_visibility = ["//visibility:public"]) |
| 663 | 663 |
+ |
| 664 | 664 |
+load( |
| ... | ... |
@@ -691,6 +693,18 @@ index 0000000..1ff2ad1 |
| 691 | 691 |
+ ], |
| 692 | 692 |
+) |
| 693 | 693 |
+ |
| 694 |
++go_test( |
|
| 695 |
++ name = "go_default_test", |
|
| 696 |
++ srcs = [ |
|
| 697 |
++ "cascade_instances_test.go", |
|
| 698 |
++ ], |
|
| 699 |
++ embed = [":go_default_library"], |
|
| 700 |
++ deps = [ |
|
| 701 |
++ "//vendor/k8s.io/api/core/v1:go_default_library", |
|
| 702 |
++ "//vendor/github.com/stretchr/testify/assert:go_default_library", |
|
| 703 |
++ ], |
|
| 704 |
++) |
|
| 705 |
++ |
|
| 694 | 706 |
+filegroup( |
| 695 | 707 |
+ name = "package-srcs", |
| 696 | 708 |
+ srcs = glob(["**"]), |
| ... | ... |
@@ -1099,10 +1113,10 @@ index 0000000..fc92377 |
| 1099 | 1099 |
\ No newline at end of file |
| 1100 | 1100 |
diff --git a/pkg/cloudprovider/providers/cascade/cascade.go b/pkg/cloudprovider/providers/cascade/cascade.go |
| 1101 | 1101 |
new file mode 100644 |
| 1102 |
-index 0000000..5901c58 |
|
| 1102 |
+index 0000000..e7cf2fc |
|
| 1103 | 1103 |
--- /dev/null |
| 1104 | 1104 |
+++ b/pkg/cloudprovider/providers/cascade/cascade.go |
| 1105 |
-@@ -0,0 +1,212 @@ |
|
| 1105 |
+@@ -0,0 +1,214 @@ |
|
| 1106 | 1106 |
+// The use of Cascade cloud provider requires the kubelet, kube-apiserver, and kube-controller-manager to be started |
| 1107 | 1107 |
+// with config flag: '--cloud-provider=cascade --cloud-config=[path_to_config_file]'. |
| 1108 | 1108 |
+package cascade |
| ... | ... |
@@ -1122,7 +1136,7 @@ index 0000000..5901c58 |
| 1122 | 1122 |
+) |
| 1123 | 1123 |
+ |
| 1124 | 1124 |
+const ( |
| 1125 |
-+ ProviderName = "cascade" |
|
| 1125 |
++ ProviderName = "vke" |
|
| 1126 | 1126 |
+ DiskSpecKind = "persistent-disk" |
| 1127 | 1127 |
+ MasterPrefix = "master" |
| 1128 | 1128 |
+) |
| ... | ... |
@@ -1159,6 +1173,8 @@ index 0000000..5901c58 |
| 1159 | 1159 |
+ Region string `gcfg:"region"` |
| 1160 | 1160 |
+ // Availability zone in which the cluster is in |
| 1161 | 1161 |
+ Zone string `gcfg:"zone"` |
| 1162 |
++ // IP address of the node. |
|
| 1163 |
++ IPAddress string `gcfg:"ipAddress"` |
|
| 1162 | 1164 |
+ } |
| 1163 | 1165 |
+} |
| 1164 | 1166 |
+ |
| ... | ... |
@@ -1550,10 +1566,10 @@ index 0000000..7e43846 |
| 1550 | 1550 |
+} |
| 1551 | 1551 |
diff --git a/pkg/cloudprovider/providers/cascade/cascade_instances.go b/pkg/cloudprovider/providers/cascade/cascade_instances.go |
| 1552 | 1552 |
new file mode 100644 |
| 1553 |
-index 0000000..58aa1b1 |
|
| 1553 |
+index 0000000..ee02e23 |
|
| 1554 | 1554 |
--- /dev/null |
| 1555 | 1555 |
+++ b/pkg/cloudprovider/providers/cascade/cascade_instances.go |
| 1556 |
-@@ -0,0 +1,91 @@ |
|
| 1556 |
+@@ -0,0 +1,92 @@ |
|
| 1557 | 1557 |
+package cascade |
| 1558 | 1558 |
+ |
| 1559 | 1559 |
+import ( |
| ... | ... |
@@ -1567,9 +1583,10 @@ index 0000000..58aa1b1 |
| 1567 | 1567 |
+// NodeAddresses is an implementation of Instances.NodeAddresses. In the future, private IP address, external IP, etc. |
| 1568 | 1568 |
+// will be added based on need. |
| 1569 | 1569 |
+func (cc *CascadeCloud) NodeAddresses(ctx context.Context, nodeName k8stypes.NodeName) ([]v1.NodeAddress, error) {
|
| 1570 |
-+ addresses := []v1.NodeAddress{}
|
|
| 1571 |
-+ addresses = append(addresses, v1.NodeAddress{Type: v1.NodeInternalDNS, Address: cc.cfg.Global.DNSName})
|
|
| 1572 |
-+ return addresses, nil |
|
| 1570 |
++ return []v1.NodeAddress{
|
|
| 1571 |
++ {Type: v1.NodeInternalIP, Address: cc.cfg.Global.IPAddress},
|
|
| 1572 |
++ {Type: v1.NodeInternalDNS, Address: cc.cfg.Global.DNSName},
|
|
| 1573 |
++ }, nil |
|
| 1573 | 1574 |
+} |
| 1574 | 1575 |
+ |
| 1575 | 1576 |
+// NodeAddressesByProviderID returns the node addresses of an instances with the specified unique providerID |
| ... | ... |
@@ -1645,6 +1662,56 @@ index 0000000..58aa1b1 |
| 1645 | 1645 |
+func (cc *CascadeCloud) InstanceType(ctx context.Context, nodeName k8stypes.NodeName) (string, error) {
|
| 1646 | 1646 |
+ return "", nil |
| 1647 | 1647 |
+} |
| 1648 |
+diff --git a/pkg/cloudprovider/providers/cascade/cascade_instances_test.go b/pkg/cloudprovider/providers/cascade/cascade_instances_test.go |
|
| 1649 |
+new file mode 100644 |
|
| 1650 |
+index 0000000..8fb314d |
|
| 1651 |
+--- /dev/null |
|
| 1652 |
+@@ -0,0 +1,44 @@ |
|
| 1653 |
++package cascade |
|
| 1654 |
++ |
|
| 1655 |
++import ( |
|
| 1656 |
++ "context" |
|
| 1657 |
++ "strings" |
|
| 1658 |
++ "testing" |
|
| 1659 |
++ |
|
| 1660 |
++ "github.com/stretchr/testify/assert" |
|
| 1661 |
++ "k8s.io/api/core/v1" |
|
| 1662 |
++) |
|
| 1663 |
++ |
|
| 1664 |
++const configFile = ` |
|
| 1665 |
++[Global] |
|
| 1666 |
++target = target |
|
| 1667 |
++tenantName = tenant |
|
| 1668 |
++clusterID = cluster-id |
|
| 1669 |
++authEndpoint = auth-endpoint |
|
| 1670 |
++domainName = domain.test |
|
| 1671 |
++dnsName = node.domain.test |
|
| 1672 |
++region = region |
|
| 1673 |
++zone = zone |
|
| 1674 |
++ipAddress = 1.1.1.1 |
|
| 1675 |
++` |
|
| 1676 |
++ |
|
| 1677 |
++func getCascadeInstance() (*CascadeCloud, error) {
|
|
| 1678 |
++ cfg, err := readConfig(strings.NewReader(configFile)) |
|
| 1679 |
++ return &CascadeCloud{
|
|
| 1680 |
++ cfg: cfg, |
|
| 1681 |
++ localHostname: "hostname", |
|
| 1682 |
++ localK8sHostname: "", |
|
| 1683 |
++ }, err |
|
| 1684 |
++} |
|
| 1685 |
++ |
|
| 1686 |
++func TestNodeAddresses(t *testing.T) {
|
|
| 1687 |
++ cc, err := getCascadeInstance() |
|
| 1688 |
++ assert.Nil(t, err) |
|
| 1689 |
++ expectedNodeAddresses := []v1.NodeAddress{
|
|
| 1690 |
++ {Type: v1.NodeInternalIP, Address: "1.1.1.1"},
|
|
| 1691 |
++ {Type: v1.NodeInternalDNS, Address: "node.domain.test"},
|
|
| 1692 |
++ } |
|
| 1693 |
++ actualNodeAddresses, err := cc.NodeAddresses(context.TODO(), "node") |
|
| 1694 |
++ assert.Nil(t, err) |
|
| 1695 |
++ assert.Equal(t, expectedNodeAddresses, actualNodeAddresses) |
|
| 1696 |
++} |
|
| 1648 | 1697 |
diff --git a/pkg/cloudprovider/providers/cascade/cascade_loadbalancer.go b/pkg/cloudprovider/providers/cascade/cascade_loadbalancer.go |
| 1649 | 1698 |
new file mode 100644 |
| 1650 | 1699 |
index 0000000..1038639 |
| ... | ... |
@@ -2991,7 +3058,7 @@ index 75095b2..0914847 100644 |
| 2991 | 2991 |
|
| 2992 | 2992 |
// DefaultOffAdmissionPlugins get admission plugins off by default for kube-apiserver. |
| 2993 | 2993 |
diff --git a/pkg/printers/internalversion/describe.go b/pkg/printers/internalversion/describe.go |
| 2994 |
-index 318148d..994f6ec 100644 |
|
| 2994 |
+index 318148d..bd26dc6 100644 |
|
| 2995 | 2995 |
--- a/pkg/printers/internalversion/describe.go |
| 2996 | 2996 |
+++ b/pkg/printers/internalversion/describe.go |
| 2997 | 2997 |
@@ -754,6 +754,8 @@ func describeVolumes(volumes []api.Volume, w PrefixWriter, space string) {
|
| ... | ... |
@@ -3008,7 +3075,7 @@ index 318148d..994f6ec 100644 |
| 3008 | 3008 |
} |
| 3009 | 3009 |
|
| 3010 | 3010 |
+func printCascadeDiskVolumeSource(cascade *api.CascadeDiskVolumeSource, w PrefixWriter) {
|
| 3011 |
-+ w.Write(LEVEL_2, "Type:\tCascadeDisk (a Persistent Disk resource in Cascade)\n"+ |
|
| 3011 |
++ w.Write(LEVEL_2, "Type:\tVKEDisk (a Persistent Disk resource in VKE)\n"+ |
|
| 3012 | 3012 |
+ " DiskID:\t%v\n"+ |
| 3013 | 3013 |
+ " FSType:\t%v\n", |
| 3014 | 3014 |
+ cascade.DiskID, cascade.FSType) |
| ... | ... |
@@ -3380,7 +3447,7 @@ index 0000000..80d8d3a |
| 3380 | 3380 |
+} |
| 3381 | 3381 |
diff --git a/pkg/volume/cascade_disk/cascade_disk.go b/pkg/volume/cascade_disk/cascade_disk.go |
| 3382 | 3382 |
new file mode 100644 |
| 3383 |
-index 0000000..769c876 |
|
| 3383 |
+index 0000000..3968060 |
|
| 3384 | 3384 |
--- /dev/null |
| 3385 | 3385 |
+++ b/pkg/volume/cascade_disk/cascade_disk.go |
| 3386 | 3386 |
@@ -0,0 +1,390 @@ |
| ... | ... |
@@ -3417,7 +3484,7 @@ index 0000000..769c876 |
| 3417 | 3417 |
+var _ volume.ProvisionableVolumePlugin = &cascadeDiskPlugin{}
|
| 3418 | 3418 |
+ |
| 3419 | 3419 |
+const ( |
| 3420 |
-+ cascadeDiskPluginName = "kubernetes.io/cascade-disk" |
|
| 3420 |
++ cascadeDiskPluginName = "kubernetes.io/vke-disk" |
|
| 3421 | 3421 |
+) |
| 3422 | 3422 |
+ |
| 3423 | 3423 |
+// Init initializes the Cascade volume plugin. |
| ... | ... |
@@ -3740,7 +3807,7 @@ index 0000000..769c876 |
| 3740 | 3740 |
+ Name: p.options.PVName, |
| 3741 | 3741 |
+ Labels: map[string]string{},
|
| 3742 | 3742 |
+ Annotations: map[string]string{
|
| 3743 |
-+ util.VolumeDynamicallyCreatedByKey: "cascade-volume-dynamic-provisioner", |
|
| 3743 |
++ util.VolumeDynamicallyCreatedByKey: "vke-volume-dynamic-provisioner", |
|
| 3744 | 3744 |
+ }, |
| 3745 | 3745 |
+ }, |
| 3746 | 3746 |
+ Spec: v1.PersistentVolumeSpec{
|
| ... | ... |
@@ -3888,7 +3955,7 @@ index 0000000..19ddb7f |
| 3888 | 3888 |
+ return cc, nil |
| 3889 | 3889 |
+} |
| 3890 | 3890 |
diff --git a/plugin/pkg/admission/persistentvolume/label/admission.go b/plugin/pkg/admission/persistentvolume/label/admission.go |
| 3891 |
-index 819adae..ef72cf5 100644 |
|
| 3891 |
+index 819adae..3d55589 100644 |
|
| 3892 | 3892 |
--- a/plugin/pkg/admission/persistentvolume/label/admission.go |
| 3893 | 3893 |
+++ b/plugin/pkg/admission/persistentvolume/label/admission.go |
| 3894 | 3894 |
@@ -27,6 +27,7 @@ import ( |
| ... | ... |
@@ -3957,7 +4024,7 @@ index 819adae..ef72cf5 100644 |
| 3957 | 3957 |
+ if len(l.cloudConfig) > 0 {
|
| 3958 | 3958 |
+ cloudConfigReader = bytes.NewReader(l.cloudConfig) |
| 3959 | 3959 |
+ } |
| 3960 |
-+ cloudProvider, err := cloudprovider.GetCloudProvider("cascade", cloudConfigReader)
|
|
| 3960 |
++ cloudProvider, err := cloudprovider.GetCloudProvider("vke", cloudConfigReader)
|
|
| 3961 | 3961 |
+ if err != nil || cloudProvider == nil {
|
| 3962 | 3962 |
+ return nil, err |
| 3963 | 3963 |
+ } |
| ... | ... |
@@ -4037,10 +4104,10 @@ index 0000000..b0a6026 |
| 4037 | 4037 |
\ No newline at end of file |
| 4038 | 4038 |
diff --git a/plugin/pkg/admission/vke/admission.go b/plugin/pkg/admission/vke/admission.go |
| 4039 | 4039 |
new file mode 100644 |
| 4040 |
-index 0000000..e029ce6 |
|
| 4040 |
+index 0000000..c1566ae |
|
| 4041 | 4041 |
--- /dev/null |
| 4042 | 4042 |
+++ b/plugin/pkg/admission/vke/admission.go |
| 4043 |
-@@ -0,0 +1,374 @@ |
|
| 4043 |
+@@ -0,0 +1,349 @@ |
|
| 4044 | 4044 |
+package vke |
| 4045 | 4045 |
+ |
| 4046 | 4046 |
+import ( |
| ... | ... |
@@ -4070,9 +4137,7 @@ index 0000000..e029ce6 |
| 4070 | 4070 |
+ privilegedServiceAccount = "system:serviceaccount:" + privilegedNamespace + ":" |
| 4071 | 4071 |
+ reservedPrefix = "vke" |
| 4072 | 4072 |
+ kubeletGroup = "system:nodes" |
| 4073 |
-+ kubeProxyGroup = "cascade:kube-proxies" |
|
| 4074 |
-+ dashboardPod = "vke-dashboard-0" |
|
| 4075 |
-+ kubeSystemNamespace = "kube-system" |
|
| 4073 |
++ kubeProxyGroup = "vke:kube-proxies" |
|
| 4076 | 4074 |
+) |
| 4077 | 4075 |
+ |
| 4078 | 4076 |
+// Register registers a plugin. |
| ... | ... |
@@ -4171,6 +4236,9 @@ index 0000000..e029ce6 |
| 4171 | 4171 |
+ HostIPC: false, |
| 4172 | 4172 |
+ HostPID: false, |
| 4173 | 4173 |
+ AllowPrivilegeEscalation: false, |
| 4174 |
++ HostPorts: []extensions.HostPortRange{
|
|
| 4175 |
++ {1, 65535},
|
|
| 4176 |
++ }, |
|
| 4174 | 4177 |
+ Volumes: []extensions.FSType{
|
| 4175 | 4178 |
+ "emptyDir", |
| 4176 | 4179 |
+ "secret", |
| ... | ... |
@@ -4307,20 +4375,13 @@ index 0000000..e029ce6 |
| 4307 | 4307 |
+ return nil |
| 4308 | 4308 |
+ } |
| 4309 | 4309 |
+ |
| 4310 |
-+ // If it is a Connect operation, allow it. We restrict access to connect to any pods in the vke-system namespace. |
|
| 4311 |
-+ // Also, DenyEscalatingExec admission controller denies access to connect to any privileged pod in general. So it is |
|
| 4312 |
-+ // OK to allow this. |
|
| 4313 |
-+ if a.GetOperation() == admission.Connect {
|
|
| 4310 |
++ // If it is a Connect or Delete operation, allow it. We restrict access to connect to any pods in the vke-system |
|
| 4311 |
++ // namespace. Also, DenyEscalatingExec admission controller denies access to connect to any privileged pod in |
|
| 4312 |
++ // general. So it is OK to allow this. |
|
| 4313 |
++ if a.GetOperation() == admission.Connect && a.GetOperation() == admission.Delete {
|
|
| 4314 | 4314 |
+ return nil |
| 4315 | 4315 |
+ } |
| 4316 | 4316 |
+ |
| 4317 |
-+ // If it is a Delete operation and it is not a pod with a reserved prefix, allow it. We restrict access to delete |
|
| 4318 |
-+ // any pods in the vke-system namespace. So it is OK to allow this. |
|
| 4319 |
-+ // TODO: Make sure we do not have a need to delete the dashboard stateful set. If we do then it will fail. |
|
| 4320 |
-+ if a.GetOperation() == admission.Delete {
|
|
| 4321 |
-+ return checkReservedPrefix(a.GetName(), a) |
|
| 4322 |
-+ } |
|
| 4323 |
-+ |
|
| 4324 | 4317 |
+ // If we cannot get the pod object, fail. |
| 4325 | 4318 |
+ if _, ok := a.GetObject().(*api.Pod); !ok {
|
| 4326 | 4319 |
+ return admission.NewForbidden(a, |
| ... | ... |
@@ -4338,25 +4399,6 @@ index 0000000..e029ce6 |
| 4338 | 4338 |
+ errs := field.ErrorList{}
|
| 4339 | 4339 |
+ originalPod := a.GetObject().(*api.Pod) |
| 4340 | 4340 |
+ |
| 4341 |
-+ // If the pod is our dashboard pod, its namespace is kube-system and it is created by the controller-manager then |
|
| 4342 |
-+ // skip validation. This pod is in kube-system namespace which is not privileged. But we need to allow the dashboard |
|
| 4343 |
-+ // pod to be privileged because it has the OIDC proxy container which requires hostPath volume mount. Just to make |
|
| 4344 |
-+ // sure we allow only this one pod, we make sure that it is created by the controller manager and name matches the |
|
| 4345 |
-+ // dashboard pod and it is in kube-system. |
|
| 4346 |
-+ if a.GetUserInfo().GetName() == systemUnsecuredUser && a.GetNamespace() == kubeSystemNamespace && |
|
| 4347 |
-+ (a.GetName() == dashboardPod || originalPod.Name == dashboardPod) {
|
|
| 4348 |
-+ return nil |
|
| 4349 |
-+ } |
|
| 4350 |
-+ |
|
| 4351 |
-+ // Check if the pod that needs to be created or updated has the reserved prefix. If it does, deny the request. |
|
| 4352 |
-+ podName := a.GetName() |
|
| 4353 |
-+ if podName == "" {
|
|
| 4354 |
-+ podName = originalPod.Name |
|
| 4355 |
-+ } |
|
| 4356 |
-+ if err := checkReservedPrefix(podName, a); err != nil {
|
|
| 4357 |
-+ return err |
|
| 4358 |
-+ } |
|
| 4359 |
-+ |
|
| 4360 | 4341 |
+ // Generate a copy of the pod object because we are not allowed to mutate the pod object. |
| 4361 | 4342 |
+ pod := originalPod.DeepCopy() |
| 4362 | 4343 |
+ |
| ... | ... |
@@ -4417,10 +4459,10 @@ index 0000000..e029ce6 |
| 4417 | 4417 |
+} |
| 4418 | 4418 |
diff --git a/plugin/pkg/admission/vke/admission_test.go b/plugin/pkg/admission/vke/admission_test.go |
| 4419 | 4419 |
new file mode 100644 |
| 4420 |
-index 0000000..779f412 |
|
| 4420 |
+index 0000000..596b7d4 |
|
| 4421 | 4421 |
--- /dev/null |
| 4422 | 4422 |
+++ b/plugin/pkg/admission/vke/admission_test.go |
| 4423 |
-@@ -0,0 +1,541 @@ |
|
| 4423 |
+@@ -0,0 +1,538 @@ |
|
| 4424 | 4424 |
+package vke |
| 4425 | 4425 |
+ |
| 4426 | 4426 |
+import ( |
| ... | ... |
@@ -4499,6 +4541,12 @@ index 0000000..779f412 |
| 4499 | 4499 |
+ userInfo: newTestUserBuilder().build(), |
| 4500 | 4500 |
+ shouldPassValidate: false, |
| 4501 | 4501 |
+ }, |
| 4502 |
++ "create pod with HostPort allowed": {
|
|
| 4503 |
++ operation: kadmission.Create, |
|
| 4504 |
++ pod: newTestPodBuilder().withHostPort().build(), |
|
| 4505 |
++ userInfo: newTestUserBuilder().build(), |
|
| 4506 |
++ shouldPassValidate: true, |
|
| 4507 |
++ }, |
|
| 4502 | 4508 |
+ "create pod with HostVolume denied": {
|
| 4503 | 4509 |
+ operation: kadmission.Create, |
| 4504 | 4510 |
+ pod: newTestPodBuilder().withHostVolume().build(), |
| ... | ... |
@@ -4517,20 +4565,6 @@ index 0000000..779f412 |
| 4517 | 4517 |
+ userInfo: newTestUserBuilder().build(), |
| 4518 | 4518 |
+ shouldPassValidate: false, |
| 4519 | 4519 |
+ }, |
| 4520 |
-+ "create pod with vke prefix denied": {
|
|
| 4521 |
-+ operation: kadmission.Create, |
|
| 4522 |
-+ pod: newTestPodBuilder().build(), |
|
| 4523 |
-+ name: "vke-dashboard", |
|
| 4524 |
-+ userInfo: newTestUserBuilder().build(), |
|
| 4525 |
-+ shouldPassValidate: false, |
|
| 4526 |
-+ }, |
|
| 4527 |
-+ "create dashboard pod with vke prefix by privileged user in kube-system allowed": {
|
|
| 4528 |
-+ operation: kadmission.Create, |
|
| 4529 |
-+ pod: newTestPodBuilder().withNamespace(kubeSystemNamespace).build(), |
|
| 4530 |
-+ name: "vke-dashboard-0", |
|
| 4531 |
-+ userInfo: newTestUserBuilder().withName(systemUnsecuredUser).build(), |
|
| 4532 |
-+ shouldPassValidate: true, |
|
| 4533 |
-+ }, |
|
| 4534 | 4520 |
+ "connect pod allowed": {
|
| 4535 | 4521 |
+ operation: kadmission.Connect, |
| 4536 | 4522 |
+ pod: newTestPodBuilder().build(), |
| ... | ... |
@@ -4543,13 +4577,6 @@ index 0000000..779f412 |
| 4543 | 4543 |
+ userInfo: newTestUserBuilder().build(), |
| 4544 | 4544 |
+ shouldPassValidate: true, |
| 4545 | 4545 |
+ }, |
| 4546 |
-+ "delete pod with vke prefix denied": {
|
|
| 4547 |
-+ operation: kadmission.Delete, |
|
| 4548 |
-+ pod: newTestPodBuilder().build(), |
|
| 4549 |
-+ name: "vke-dashboard", |
|
| 4550 |
-+ userInfo: newTestUserBuilder().build(), |
|
| 4551 |
-+ shouldPassValidate: false, |
|
| 4552 |
-+ }, |
|
| 4553 | 4546 |
+ } |
| 4554 | 4547 |
+ |
| 4555 | 4548 |
+ for k, v := range tests {
|
| ... | ... |
@@ -4705,7 +4732,7 @@ index 0000000..779f412 |
| 4705 | 4705 |
+ userInfo: newTestUserBuilder().build(), |
| 4706 | 4706 |
+ shouldPassValidate: false, |
| 4707 | 4707 |
+ }, |
| 4708 |
-+ "allowed: privileged user update clusterroles with vke: prefix": {
|
|
| 4708 |
++ "allowed: systemUnsecuredUser update clusterroles with vke: prefix": {
|
|
| 4709 | 4709 |
+ operation: kadmission.Update, |
| 4710 | 4710 |
+ resource: "clusterroles", |
| 4711 | 4711 |
+ name: "vke:clusterrole", |
| ... | ... |
@@ -4737,7 +4764,7 @@ index 0000000..779f412 |
| 4737 | 4737 |
+ userInfo: newTestUserBuilder().build(), |
| 4738 | 4738 |
+ shouldPassValidate: false, |
| 4739 | 4739 |
+ }, |
| 4740 |
-+ "allowed: privileged user update clusterrolebindings with vke: prefix": {
|
|
| 4740 |
++ "allowed: systemUnsecuredUser update clusterrolebindings with vke: prefix": {
|
|
| 4741 | 4741 |
+ operation: kadmission.Update, |
| 4742 | 4742 |
+ resource: "clusterrolebindings", |
| 4743 | 4743 |
+ name: "vke:clusterrolebinding", |
| ... | ... |
@@ -4752,7 +4779,7 @@ index 0000000..779f412 |
| 4752 | 4752 |
+ userInfo: newTestUserBuilder().build(), |
| 4753 | 4753 |
+ shouldPassValidate: false, |
| 4754 | 4754 |
+ }, |
| 4755 |
-+ "allowed: privileged user update nodes": {
|
|
| 4755 |
++ "allowed: systemUnsecuredUser update nodes": {
|
|
| 4756 | 4756 |
+ operation: kadmission.Update, |
| 4757 | 4757 |
+ resource: "nodes", |
| 4758 | 4758 |
+ namespace: "", |
| ... | ... |
@@ -4877,6 +4904,18 @@ index 0000000..779f412 |
| 4877 | 4877 |
+ return p |
| 4878 | 4878 |
+} |
| 4879 | 4879 |
+ |
| 4880 |
++func (p *testPodBuilder) withHostPort() *testPodBuilder {
|
|
| 4881 |
++ containerPorts := []kapi.ContainerPort{
|
|
| 4882 |
++ {
|
|
| 4883 |
++ HostPort: 3000, |
|
| 4884 |
++ ContainerPort: 80, |
|
| 4885 |
++ }, |
|
| 4886 |
++ } |
|
| 4887 |
++ |
|
| 4888 |
++ p.pod.Spec.Containers[0].Ports = containerPorts |
|
| 4889 |
++ return p |
|
| 4890 |
++} |
|
| 4891 |
++ |
|
| 4880 | 4892 |
+func (p *testPodBuilder) withHostVolume() *testPodBuilder {
|
| 4881 | 4893 |
+ volume := kapi.Volume{
|
| 4882 | 4894 |
+ Name: "host", |
| ... | ... |
@@ -5466,7 +5505,7 @@ index 85c7b63..b97b2f1 100644 |
| 5466 | 5466 |
iNdEx = preIndex |
| 5467 | 5467 |
skippy, err := skipGenerated(dAtA[iNdEx:]) |
| 5468 | 5468 |
diff --git a/staging/src/k8s.io/api/core/v1/types.go b/staging/src/k8s.io/api/core/v1/types.go |
| 5469 |
-index 08ef419..19184ed 100644 |
|
| 5469 |
+index 08ef419..6fb4d80 100644 |
|
| 5470 | 5470 |
--- a/staging/src/k8s.io/api/core/v1/types.go |
| 5471 | 5471 |
+++ b/staging/src/k8s.io/api/core/v1/types.go |
| 5472 | 5472 |
@@ -333,9 +333,9 @@ type VolumeSource struct {
|
| ... | ... |
@@ -5477,7 +5516,7 @@ index 08ef419..19184ed 100644 |
| 5477 | 5477 |
+ // CascadeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine |
| 5478 | 5478 |
// +optional |
| 5479 | 5479 |
- AzureDisk *AzureDiskVolumeSource `json:"azureDisk,omitempty" protobuf:"bytes,22,opt,name=azureDisk"` |
| 5480 |
-+ CascadeDisk *CascadeDiskVolumeSource `json:"cascadeDisk,omitempty" protobuf:"bytes,22,opt,name=cascadeDisk"` |
|
| 5480 |
++ CascadeDisk *CascadeDiskVolumeSource `json:"vkeDisk,omitempty" protobuf:"bytes,22,opt,name=cascadeDisk"` |
|
| 5481 | 5481 |
// PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine |
| 5482 | 5482 |
PhotonPersistentDisk *PhotonPersistentDiskVolumeSource `json:"photonPersistentDisk,omitempty" protobuf:"bytes,23,opt,name=photonPersistentDisk"` |
| 5483 | 5483 |
// Items for all in one resources secrets, configmaps, and downward API |
| ... | ... |
@@ -5499,7 +5538,7 @@ index 08ef419..19184ed 100644 |
| 5499 | 5499 |
+ // CascadeDisk represents a Cascade persistent disk attached and mounted on kubelets host machine |
| 5500 | 5500 |
// +optional |
| 5501 | 5501 |
- AzureDisk *AzureDiskVolumeSource `json:"azureDisk,omitempty" protobuf:"bytes,16,opt,name=azureDisk"` |
| 5502 |
-+ CascadeDisk *CascadeDiskVolumeSource `json:"cascadeDisk,omitempty" protobuf:"bytes,16,opt,name=cascadeDisk"` |
|
| 5502 |
++ CascadeDisk *CascadeDiskVolumeSource `json:"vkeDisk,omitempty" protobuf:"bytes,16,opt,name=cascadeDisk"` |
|
| 5503 | 5503 |
// PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine |
| 5504 | 5504 |
PhotonPersistentDisk *PhotonPersistentDiskVolumeSource `json:"photonPersistentDisk,omitempty" protobuf:"bytes,17,opt,name=photonPersistentDisk"` |
| 5505 | 5505 |
// PortworxVolume represents a portworx volume attached and mounted on kubelets host machine |
| ... | ... |
@@ -1,7 +1,7 @@ |
| 1 | 1 |
Summary: Kubernetes cluster management |
| 2 | 2 |
Name: kubernetes |
| 3 | 3 |
Version: 1.10.2 |
| 4 |
-Release: 4%{?dist}
|
|
| 4 |
+Release: 5%{?dist}
|
|
| 5 | 5 |
License: ASL 2.0 |
| 6 | 6 |
URL: https://github.com/kubernetes/kubernetes/archive/v%{version}.tar.gz
|
| 7 | 7 |
Source0: kubernetes-%{version}.tar.gz
|
| ... | ... |
@@ -207,6 +207,8 @@ fi |
| 207 | 207 |
/opt/vmware/kubernetes/windows/amd64/kubectl.exe |
| 208 | 208 |
|
| 209 | 209 |
%changelog |
| 210 |
+* Fri Jun 08 2018 Bo Gan <ganb@vmware.com> 1.10.2-5 |
|
| 211 |
+- Update vke patch (df346df) |
|
| 210 | 212 |
* Sat Jun 02 2018 Bo Gan <ganb@vmware.com> 1.10.2-4 |
| 211 | 213 |
- Update vke patch (7b1ec01) |
| 212 | 214 |
* Tue May 23 2018 A. Walton <waltona@vmware.com> 1.10.2-3 |
| ... | ... |
@@ -1,7 +1,7 @@ |
| 1 | 1 |
Summary: Kubernetes cluster management |
| 2 | 2 |
Name: kubernetes |
| 3 | 3 |
Version: 1.9.6 |
| 4 |
-Release: 3%{?dist}
|
|
| 4 |
+Release: 4%{?dist}
|
|
| 5 | 5 |
License: ASL 2.0 |
| 6 | 6 |
URL: https://github.com/kubernetes/kubernetes/archive/v%{version}.tar.gz
|
| 7 | 7 |
Source0: kubernetes-v%{version}.tar.gz
|
| ... | ... |
@@ -185,6 +185,8 @@ fi |
| 185 | 185 |
%{_bindir}/pause-amd64
|
| 186 | 186 |
|
| 187 | 187 |
%changelog |
| 188 |
+* Fri Jun 08 2018 Bo Gan <ganb@vmware.com> 1.9.6-4 |
|
| 189 |
+- Update vke patch (df346df) |
|
| 188 | 190 |
* Sat Jun 02 2018 Bo Gan <ganb@vmware.com> 1.9.6-3 |
| 189 | 191 |
- Update vke patch (8ef8da7) |
| 190 | 192 |
* Tue May 01 2018 Dheeraj Shetty <dheerajs@vmware.com> 1.9.6-2 |