Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add methods to support CRUD operations on CSE Kubernetes clusters #645

Merged
merged 119 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from 116 commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
95a1ac9
Add get storage profile method by ID
Jan 9, 2024
dfd4388
Merge
Jan 16, 2024
55999bf
Add CSE methods
Jan 26, 2024
90d2a77
Add CSE methods
Jan 26, 2024
259cde4
Start testing create
Jan 26, 2024
301fbc1
Add delete method
Jan 26, 2024
3d6a255
Init update method
Jan 26, 2024
60d259b
Fix issues and run tests
Jan 30, 2024
ef01d7b
Refactor and update methods
Jan 30, 2024
ca58e69
Add unit tests
Jan 31, 2024
93ff0c6
Fix bug
Jan 31, 2024
65a145e
Add more unit tests for worker pool update
Jan 31, 2024
c4774cd
Continue with update, but Reads need a revisit
Jan 31, 2024
c4a5c28
Change YAML library
Feb 1, 2024
2279a20
Add update MHC
Feb 1, 2024
eaf2846
Update OVA fixed
Feb 1, 2024
bc524cf
Refactor
Feb 1, 2024
2c5014d
Refactoring and trying to complete Reads
Feb 2, 2024
b2d7dce
Checkpoint, not tested. Read finished but may be unstable
Feb 5, 2024
124cd62
Fixes, read works, get kubeconfig works
Feb 5, 2024
ff26daa
Refactoring
Feb 6, 2024
883e678
Refactor and add unit tests
Feb 6, 2024
8401bc6
Add unit test for capiyaml, but it fails
Feb 6, 2024
3e24eb2
Add more tests, change any with interface
Feb 6, 2024
bf80795
Add more tests, change any with interface
Feb 6, 2024
3cf8fc3
Implement cseAddWorkerPoolsInYaml, not teste
Feb 6, 2024
e113aaa
Fix unit test
Feb 7, 2024
d997ced
Fix unit test
Feb 7, 2024
7907bb9
Refactor traverseMap
Feb 8, 2024
5cead14
check
Feb 9, 2024
5e3728a
Add upgrade constraints
Feb 9, 2024
e3dcf72
Fix getTkgVersionBundleFromVAppTemplate
Feb 9, 2024
4c70cad
Fix getTkgVersionBundleFromVAppTemplate
Feb 9, 2024
cfec8da
Fixes
Feb 9, 2024
40b4f0a
Add TKG bundle version comparisons, not tested
Feb 9, 2024
ad3e9d5
Improvements
Feb 12, 2024
7c2c7a2
Improvements
Feb 12, 2024
2b23330
Improvements
Feb 12, 2024
9c74b18
Improvements
Feb 12, 2024
288cec1
Add get by name method
Feb 12, 2024
f9f5418
Refactor
Feb 12, 2024
b9066b4
Fix delete
Feb 13, 2024
385e518
Make auto-repair-on-errors non updatable
Feb 13, 2024
94ab65d
Make auto-repair-on-errors non updatable since 4.1.1
Feb 13, 2024
1c84371
Add events
Feb 13, 2024
60d7a78
Fixes
Feb 14, 2024
f7a7fa6
Fixes
Feb 14, 2024
382a8d1
Attempt to fix Kubeconfig override
Feb 14, 2024
3a97f3e
Worker pools unique names
Feb 14, 2024
7ca3fed
#
Feb 14, 2024
57560c7
Refactor
Feb 14, 2024
c33dab3
Refactor
Feb 14, 2024
73c7ac5
Fixes
Feb 14, 2024
8a03156
Refactor
Feb 14, 2024
021a859
Fix bug/unit test
Feb 15, 2024
8bea6c7
Fix bug/unit test
Feb 15, 2024
ad77b6e
Fix MHC
Feb 16, 2024
b890ca6
Fix MHC update
Feb 16, 2024
08dd631
Fix MHC templates
Feb 16, 2024
0b917b3
Revert
Feb 16, 2024
d6dbb6f
revert
Feb 16, 2024
74301cf
revert
Feb 16, 2024
d2e7f48
Fixes
Feb 16, 2024
2eadf7b
Fixes
Feb 16, 2024
859bca0
Changelog
Feb 16, 2024
31038d4
Fix wrong replace
Feb 16, 2024
3f21260
Fix wrong replace
Feb 16, 2024
beaa5b9
#
Feb 16, 2024
7b77a92
#
Feb 16, 2024
5878f65
Add projector events
Feb 20, 2024
4422a7a
Add projector events
Feb 20, 2024
7befc69
test
Feb 20, 2024
a980542
Fix delete
Feb 21, 2024
58d3e89
Improve tests and fix tiny bug
Feb 22, 2024
a0f2b67
Fix tests
Feb 22, 2024
3964804
Fix test
Feb 22, 2024
8f06a67
Improve test checks
Feb 22, 2024
b716d7c
Improve test checks
Feb 22, 2024
f49d341
Improve RDE creation
Feb 22, 2024
3bd2203
Improve RDE creation
Feb 22, 2024
da27836
Self-review
Feb 22, 2024
53740a0
Self-review
Feb 22, 2024
38da9d1
self-review
Feb 22, 2024
905ac8b
Self-review and fix tests
Feb 22, 2024
941bef1
Self-review and fix tests
Feb 22, 2024
fc3ce74
Self-review and fix tests
Feb 22, 2024
62291e9
Fix RDE get
Feb 22, 2024
8887f6e
Fix test
Feb 22, 2024
5e59d29
Merge
Feb 26, 2024
cba5468
Fix unit
Feb 26, 2024
e13fdaf
Fix unit
Feb 26, 2024
bd9c75e
Fix unit
Feb 26, 2024
c8ad117
self-review
Feb 26, 2024
b23f13c
self-review
Feb 26, 2024
a28f014
self-review
Feb 26, 2024
6ff4f3c
self-review
Feb 26, 2024
ebc292e
Add more unit tests
Feb 26, 2024
eb239a3
Remove minutes from timeouts
Feb 26, 2024
5202f9d
Fix changelog
Feb 26, 2024
036fad2
Remove built-in YAML library
Feb 26, 2024
bdcafd6
Add unit tests for getCseComponentsVersions
Feb 27, 2024
ad16187
Add unit tests for getCseComponentsVersions
Feb 27, 2024
58edf9a
Remove API Token from YAML
Feb 28, 2024
21284a9
Address some suggestions
Feb 28, 2024
8b1a5fa
Apply suggestion
Feb 28, 2024
d6820a6
Fix unit tests
Feb 28, 2024
02609cc
Remove comment
Feb 28, 2024
80deaea
Change t.Fatalf to t.Fatal on trivial returns
Feb 28, 2024
6a9e1c3
Set cluster creation timeout in test
Feb 28, 2024
c2bcfe8
Fix previous commit/timeout
Feb 28, 2024
5018bed
Fixes and add a new test
Mar 1, 2024
d1f9747
Revert YAML library changes
Mar 4, 2024
39b8d85
Fix replace
Mar 4, 2024
81c3a60
Revert changes by suggestion
Mar 5, 2024
7b02278
Fix dumb AutoRepairOnErrors error message when settings dont change
Mar 6, 2024
bf94572
Add 4.2.1
Mar 6, 2024
45b7864
Fix suggestions
Mar 7, 2024
945d727
Merge
Mar 7, 2024
95cd3aa
Fix typos and hide API token in logs
Mar 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .changes/v2.23.0/645-features.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
* Added the type `CseKubernetesCluster` to manage Container Service Extension Kubernetes clusters for versions 4.1.0, 4.1.1,
4.2.0 and 4.2.1 [GH-645]
* Added methods `Org.CseCreateKubernetesCluster` and `Org.CseCreateKubernetesClusterAsync` to create Kubernetes clusters
in a VCD appliance with Container Service Extension installed [GH-645]
* Added methods `VCDClient.CseGetKubernetesClusterById` and `Org.CseGetKubernetesClustersByName` to retrieve a
Container Service Extension Kubernetes cluster [GH-645]
* Added the method `CseKubernetesCluster.GetKubeconfig` to retrieve the *kubeconfig* of a provisioned Container Service
Extension Kubernetes cluster [GH-645]
* Added the method `CseKubernetesCluster.Refresh` to refresh the information and properties of an existing Container
Service Extension Kubernetes cluster [GH-645]
* Added methods to update a Container Service Extension Kubernetes cluster: `CseKubernetesCluster.UpdateWorkerPools`,
`CseKubernetesCluster.AddWorkerPools`, `CseKubernetesCluster.UpdateControlPlane`, `CseKubernetesCluster.UpgradeCluster`,
`CseKubernetesCluster.SetNodeHealthCheck` and `CseKubernetesCluster.SetAutoRepairOnErrors` [GH-645]
* Added the method `CseKubernetesCluster.GetSupportedUpgrades` to retrieve all the valid TKGm OVAs that a given Container
Service Extension Kubernetes cluster can use to be upgraded [GH-645]
* Added the method `CseKubernetesCluster.Delete` to delete a cluster [GH-645]
* Added types `CseClusterSettings`, `CseControlPlaneSettings`, `CseWorkerPoolSettings` and `CseDefaultStorageClassSettings`
to configure the Container Service Extension Kubernetes clusters creation process [GH-645]
* Added types `CseClusterUpdateInput`, `CseControlPlaneUpdateInput` and `CseWorkerPoolUpdateInput` to configure the
Container Service Extension Kubernetes clusters update process [GH-645]
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ require (
github.com/peterhellberg/link v1.1.0
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127
gopkg.in/yaml.v2 v2.4.0
sigs.k8s.io/yaml v1.4.0
)

require (
github.com/howeyc/crc16 v0.0.0-20171223171357-2b2a61e366a6
github.com/kr/text v0.1.0 // indirect
github.com/stretchr/testify v1.5.1 // indirect
golang.org/x/exp v0.0.0-20240119083558-1b970713d09a
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ github.com/go-check/check v0.0.0-20201130134442-10cb98267c6c h1:3LdnoQiW6yLkxRIw
github.com/go-check/check v0.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
github.com/go-yaml/yaml/v2 v2.2.2 h1:uw2m9KuKRscWGAkuyoBGQcZSdibhmuXKSJ3+9Tj3zXc=
github.com/go-yaml/yaml/v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/hashicorp/go-version v1.2.0 h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+dIzX/E=
github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/howeyc/crc16 v0.0.0-20171223171357-2b2a61e366a6 h1:IIVxLyDUYErC950b8kecjoqDet8P5S4lcVRUOM6rdkU=
github.com/howeyc/crc16 v0.0.0-20171223171357-2b2a61e366a6/go.mod h1:JslaLRrzGsOKJgFEPBP65Whn+rdwDQSk0I0MCRFe2Zw=
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
Expand All @@ -26,3 +26,5 @@ golang.org/x/exp v0.0.0-20240119083558-1b970713d09a h1:Q8/wZp0KX97QFTc2ywcOE0YRj
golang.org/x/exp v0.0.0-20240119083558-1b970713d09a/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
15 changes: 13 additions & 2 deletions govcd/api_vcd_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build api || openapi || functional || catalog || vapp || gateway || network || org || query || extnetwork || task || vm || vdc || system || disk || lb || lbAppRule || lbAppProfile || lbServerPool || lbServiceMonitor || lbVirtualServer || user || search || nsxv || nsxt || auth || affinity || role || alb || certificate || vdcGroup || metadata || providervdc || rde || vsphere || uiPlugin || ALL
//go:build api || openapi || functional || catalog || vapp || gateway || network || org || query || extnetwork || task || vm || vdc || system || disk || lb || lbAppRule || lbAppProfile || lbServerPool || lbServiceMonitor || lbVirtualServer || user || search || nsxv || nsxt || auth || affinity || role || alb || certificate || vdcGroup || metadata || providervdc || rde || vsphere || uiPlugin || cse || ALL

/*
* Copyright 2022 VMware, Inc. All rights reserved. Licensed under the Apache v2 License.
Expand All @@ -11,6 +11,7 @@ import (
"encoding/json"
"flag"
"fmt"
"gopkg.in/yaml.v2"
"net/http"
"net/url"
"os"
Expand All @@ -23,7 +24,6 @@ import (
"time"

. "gopkg.in/check.v1"
"gopkg.in/yaml.v2"

"github.com/vmware/go-vcloud-director/v2/types/v56"
"github.com/vmware/go-vcloud-director/v2/util"
Expand Down Expand Up @@ -239,6 +239,17 @@ type TestConfig struct {
MediaUdfTypePath string `yaml:"mediaUdfTypePath,omitempty"`
UiPluginPath string `yaml:"uiPluginPath,omitempty"`
} `yaml:"media"`
Cse struct {
Version string `yaml:"version,omitempty"`
SolutionsOrg string `yaml:"solutionsOrg,omitempty"`
TenantOrg string `yaml:"tenantOrg,omitempty"`
TenantVdc string `yaml:"tenantVdc,omitempty"`
RoutedNetwork string `yaml:"routedNetwork,omitempty"`
EdgeGateway string `yaml:"edgeGateway,omitempty"`
StorageProfile string `yaml:"storageProfile,omitempty"`
OvaCatalog string `yaml:"ovaCatalog,omitempty"`
OvaName string `yaml:"ovaName,omitempty"`
} `yaml:"cse,omitempty"`
}

// Test struct for vcloud-director.
Expand Down
5 changes: 4 additions & 1 deletion govcd/catalogitem.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,12 @@ func queryVappTemplateListWithFilter(client *Client, filter map[string]string) (
for k, v := range filter {
filterEncoded += fmt.Sprintf("%s==%s;", url.QueryEscape(k), url.QueryEscape(v))
}
if len(filterEncoded) > 0 {
filterEncoded = filterEncoded[:len(filterEncoded)-1] // Removes the trailing ';'
}
results, err := client.cumulativeQuery(vappTemplateType, nil, map[string]string{
"type": vappTemplateType,
"filter": filterEncoded[:len(filterEncoded)-1], // Removes the trailing ';'
"filter": filterEncoded,
})
if err != nil {
return nil, fmt.Errorf("error querying vApp templates %s", err)
Expand Down
2 changes: 1 addition & 1 deletion govcd/common_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build api || auth || functional || catalog || vapp || gateway || network || org || query || extnetwork || task || vm || vdc || system || disk || lb || lbAppRule || lbAppProfile || lbServerPool || lbServiceMonitor || lbVirtualServer || user || role || nsxv || nsxt || openapi || affinity || search || alb || certificate || vdcGroup || metadata || providervdc || rde || uiPlugin || vsphere || ALL
//go:build api || auth || functional || catalog || vapp || gateway || network || org || query || extnetwork || task || vm || vdc || system || disk || lb || lbAppRule || lbAppProfile || lbServerPool || lbServiceMonitor || lbVirtualServer || user || role || nsxv || nsxt || openapi || affinity || search || alb || certificate || vdcGroup || metadata || providervdc || rde || uiPlugin || vsphere || cse || ALL

/*
* Copyright 2021 VMware, Inc. All rights reserved. Licensed under the Apache v2 License.
Expand Down
Loading
Loading