Skip to content

Commit

Permalink
deps(deps): update module github.com/validator-labs/validator-plugin-…
Browse files Browse the repository at this point in the history
…vsphere to v0.0.27 (#80)

[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[github.com/validator-labs/validator-plugin-vsphere](https://togithub.com/validator-labs/validator-plugin-vsphere)
| `v0.0.26` -> `v0.0.27` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fvalidator-labs%2fvalidator-plugin-vsphere/v0.0.27?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fvalidator-labs%2fvalidator-plugin-vsphere/v0.0.27?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fvalidator-labs%2fvalidator-plugin-vsphere/v0.0.26/v0.0.27?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fvalidator-labs%2fvalidator-plugin-vsphere/v0.0.26/v0.0.27?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>validator-labs/validator-plugin-vsphere
(github.com/validator-labs/validator-plugin-vsphere)</summary>

###
[`v0.0.27`](https://togithub.com/validator-labs/validator-plugin-vsphere/releases/tag/v0.0.27)

[Compare
Source](https://togithub.com/validator-labs/validator-plugin-vsphere/compare/v0.0.26...v0.0.27)

##### Bug Fixes

- always return a ValidationResult from
ReconcileComputeResourceValidationRule
([#&#8203;297](https://togithub.com/validator-labs/validator-plugin-vsphere/issues/297))
([1a53fc6](https://togithub.com/validator-labs/validator-plugin-vsphere/commit/1a53fc6b733e82a28dce809122048e0f2adf50c9))

##### Dependency Updates

- **deps:** update golang.org/x/exp digest to
[`7f521ea`](https://togithub.com/validator-labs/validator-plugin-vsphere/commit/7f521ea)
([#&#8203;285](https://togithub.com/validator-labs/validator-plugin-vsphere/issues/285))
([598a86f](https://togithub.com/validator-labs/validator-plugin-vsphere/commit/598a86fc33e4784225661204a7df7ba3d39ddc9a))
- **deps:** update module github.com/validator-labs/validator to v0.0.43
([#&#8203;287](https://togithub.com/validator-labs/validator-plugin-vsphere/issues/287))
([49e45e9](https://togithub.com/validator-labs/validator-plugin-vsphere/commit/49e45e9a790b27d115ca11721897c1e7bb716d35))
- **deps:** update module github.com/vmware/govmomi to v0.38.0
([#&#8203;288](https://togithub.com/validator-labs/validator-plugin-vsphere/issues/288))
([8a98b24](https://togithub.com/validator-labs/validator-plugin-vsphere/commit/8a98b24c208576517a4c0cde129a1c3bc5a34686))
- **deps:** update dependency go to v1.22.5
([#&#8203;291](https://togithub.com/validator-labs/validator-plugin-vsphere/issues/291))
([e5d6717](https://togithub.com/validator-labs/validator-plugin-vsphere/commit/e5d671708c338b7c9e3c65391b60817e3c4751a5))
- **deps:** update golang.org/x/exp digest to
[`46b0784`](https://togithub.com/validator-labs/validator-plugin-vsphere/commit/46b0784)
([#&#8203;292](https://togithub.com/validator-labs/validator-plugin-vsphere/issues/292))
([fe35643](https://togithub.com/validator-labs/validator-plugin-vsphere/commit/fe35643ca8026cc8b9853f575dbe4c7c53ca5046))
- **deps:** update module github.com/validator-labs/validator to v0.0.44
([#&#8203;295](https://togithub.com/validator-labs/validator-plugin-vsphere/issues/295))
([c5ba9e0](https://togithub.com/validator-labs/validator-plugin-vsphere/commit/c5ba9e0dd75ad6076e4655e44832c76f9a4cb290))
- **deps:** update module github.com/validator-labs/validator to v0.0.46
([#&#8203;296](https://togithub.com/validator-labs/validator-plugin-vsphere/issues/296))
([704c063](https://togithub.com/validator-labs/validator-plugin-vsphere/commit/704c06367924f874a81aa805a8249bc436985262))
- **deps:** update module sigs.k8s.io/cluster-api to v1.7.4
([#&#8203;294](https://togithub.com/validator-labs/validator-plugin-vsphere/issues/294))
([2019561](https://togithub.com/validator-labs/validator-plugin-vsphere/commit/20195613d6189e60076d9d4b4060c8bd197dd0c2))

##### Refactoring

- enable revive and address all lints
([#&#8203;293](https://togithub.com/validator-labs/validator-plugin-vsphere/issues/293))
([3d019e2](https://togithub.com/validator-labs/validator-plugin-vsphere/commit/3d019e27f865fc46d73326ad419a36c2613f176c))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View the
[repository job
log](https://developer.mend.io/github/validator-labs/validatorctl).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MzEuNCIsInVwZGF0ZWRJblZlciI6IjM3LjQzOC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJnbyJdfQ==-->

---------

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Tyler Gillson <tyler.gillson@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tyler Gillson <tyler.gillson@gmail.com>
  • Loading branch information
renovate[bot] and TylerGillson authored Jul 22, 2024
1 parent 8c359e1 commit feb6360
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 67 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require (
github.com/L30Bola/aws-policy v0.0.0-20230126045340-5e6118545ac1
github.com/Masterminds/sprig/v3 v3.2.3
github.com/fsnotify/fsnotify v1.7.0
github.com/go-logr/logr v1.4.2
github.com/google/uuid v1.6.0
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826
github.com/pkg/errors v0.9.1
Expand All @@ -20,7 +21,7 @@ require (
github.com/validator-labs/validator-plugin-azure v0.0.13
github.com/validator-labs/validator-plugin-network v0.0.18
github.com/validator-labs/validator-plugin-oci v0.0.11
github.com/validator-labs/validator-plugin-vsphere v0.0.26
github.com/validator-labs/validator-plugin-vsphere v0.0.27
github.com/vmware/govmomi v0.38.0
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56
gopkg.in/yaml.v2 v2.4.0
Expand Down Expand Up @@ -104,7 +105,6 @@ require (
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-chi/chi v4.1.2+incompatible // indirect
github.com/go-jose/go-jose/v4 v4.0.2 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/analysis v0.23.0 // indirect
github.com/go-openapi/errors v0.22.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -698,8 +698,8 @@ github.com/validator-labs/validator-plugin-network v0.0.18 h1:UTcDM4afREb/phFxQl
github.com/validator-labs/validator-plugin-network v0.0.18/go.mod h1:rLVE0TU8FnrHlLg+G0LQ4TQ2I2hyVxG/pwic4mqhRdY=
github.com/validator-labs/validator-plugin-oci v0.0.11 h1:1eRpQNbmXntK//kYj+CsapseDqYX6tCn1csCdDKczKE=
github.com/validator-labs/validator-plugin-oci v0.0.11/go.mod h1:nGwq7xPETEitU33oGyrGA6WgC5+fQeojPIo3ifG/RbA=
github.com/validator-labs/validator-plugin-vsphere v0.0.26 h1:Zoe75nhRo9duPAvptKotWnNDAukYHgPP+fMdVI8axz8=
github.com/validator-labs/validator-plugin-vsphere v0.0.26/go.mod h1:wZFC9Td8AinrqFZA4mVUwmnWhe1ZG++B5zJ4OYAB3xw=
github.com/validator-labs/validator-plugin-vsphere v0.0.27 h1:B1XAEzdxI9An3y//cF4zyS1fFjDorERuEASKXopUdEY=
github.com/validator-labs/validator-plugin-vsphere v0.0.27/go.mod h1:y2VFZJTnnR8dlAWra9kbIyFulcIq60AxSTfSbtWObuU=
github.com/vbatts/tar-split v0.11.5 h1:3bHCTIheBm1qFTcgh9oPu+nNBtX+XJIupG/vacinCts=
github.com/vbatts/tar-split v0.11.5/go.mod h1:yZbwRsSeGjusneWgA781EKej9HF8vme8okylkAeNKLk=
github.com/vmware/govmomi v0.38.0 h1:UvQpLAOjDpO0JUxoPCXnEzOlEa/9kejO6K58qOFr6cM=
Expand Down
34 changes: 17 additions & 17 deletions pkg/components/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
azure "github.com/validator-labs/validator-plugin-azure/api/v1alpha1"
network "github.com/validator-labs/validator-plugin-network/api/v1alpha1"
oci "github.com/validator-labs/validator-plugin-oci/api/v1alpha1"
vsphere "github.com/validator-labs/validator-plugin-vsphere/api/v1alpha1"
vsphere_cloud "github.com/validator-labs/validator-plugin-vsphere/pkg/vsphere"
vsphereapi "github.com/validator-labs/validator-plugin-vsphere/api/v1alpha1"
"github.com/validator-labs/validator-plugin-vsphere/pkg/vsphere"
validator "github.com/validator-labs/validator/api/v1alpha1"

cfg "github.com/validator-labs/validatorctl/pkg/config"
Expand Down Expand Up @@ -108,8 +108,8 @@ func NewValidatorConfig() *ValidatorConfig {
BasicAuth: &BasicAuth{},
Data: make(map[string]string),
},
Validator: &vsphere.VsphereValidatorSpec{},
Account: &vsphere_cloud.VsphereCloudAccount{},
Validator: &vsphereapi.VsphereValidatorSpec{},
Account: &vsphere.CloudAccount{},
},
}
}
Expand Down Expand Up @@ -456,14 +456,14 @@ func (c *OCIPluginConfig) decrypt() error {

// VspherePluginConfig represents the vSphere plugin configuration.
type VspherePluginConfig struct {
Enabled bool `yaml:"enabled"`
Release *validator.HelmRelease `yaml:"helmRelease"`
ReleaseSecret *Secret `yaml:"helmReleaseSecret"`
Account *vsphere_cloud.VsphereCloudAccount `yaml:"account"`
Validator *vsphere.VsphereValidatorSpec `yaml:"validator"`
VsphereEntityPrivilegeRules []VsphereEntityPrivilegeRule `yaml:"vsphereEntityPrivilegeRules"`
VsphereRolePrivilegeRules []VsphereRolePrivilegeRule `yaml:"vsphereRolePrivilegeRules"`
VsphereTagRules []VsphereTagRule `yaml:"vsphereTagRules"`
Enabled bool `yaml:"enabled"`
Release *validator.HelmRelease `yaml:"helmRelease"`
ReleaseSecret *Secret `yaml:"helmReleaseSecret"`
Account *vsphere.CloudAccount `yaml:"account"`
Validator *vsphereapi.VsphereValidatorSpec `yaml:"validator"`
VsphereEntityPrivilegeRules []VsphereEntityPrivilegeRule `yaml:"vsphereEntityPrivilegeRules"`
VsphereRolePrivilegeRules []VsphereRolePrivilegeRule `yaml:"vsphereRolePrivilegeRules"`
VsphereTagRules []VsphereTagRule `yaml:"vsphereTagRules"`
}

func (c *VspherePluginConfig) encrypt() error {
Expand Down Expand Up @@ -500,19 +500,19 @@ func (c *VspherePluginConfig) decrypt() error {

// VsphereEntityPrivilegeRule represents a vSphere entity privilege rule.
type VsphereEntityPrivilegeRule struct {
vsphere.EntityPrivilegeValidationRule `yaml:",inline"`
ClusterScoped bool `yaml:"clusterScoped"`
vsphereapi.EntityPrivilegeValidationRule `yaml:",inline"`
ClusterScoped bool `yaml:"clusterScoped"`
}

// VsphereRolePrivilegeRule represents a vSphere role privilege rule.
type VsphereRolePrivilegeRule struct {
vsphere.GenericRolePrivilegeValidationRule `yaml:",inline"`
Name string `yaml:"name"`
vsphereapi.GenericRolePrivilegeValidationRule `yaml:",inline"`
Name string `yaml:"name"`
}

// VsphereTagRule represents a vSphere tag rule.
type VsphereTagRule struct {
vsphere.TagValidationRule `yaml:",inline"`
vsphereapi.TagValidationRule `yaml:",inline"`
}

// PublicKeySecret represents a public key secret.
Expand Down
18 changes: 9 additions & 9 deletions pkg/components/vsphere.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package components
import (
"fmt"

vsphere_api "github.com/validator-labs/validator-plugin-vsphere/api/v1alpha1"
vsphereapi "github.com/validator-labs/validator-plugin-vsphere/api/v1alpha1"
"github.com/validator-labs/validator-plugin-vsphere/pkg/vsphere"
vapi "github.com/validator-labs/validator/api/v1alpha1"

Expand All @@ -18,8 +18,8 @@ type VsphereConfig struct {
Datacenter string
ClusterName string
ImageTemplateFolder string
NodePoolResourceRequirements []vsphere_api.NodepoolResourceRequirement
TagValidationRules []vsphere_api.TagValidationRule
NodePoolResourceRequirements []vsphereapi.NodepoolResourceRequirement
TagValidationRules []vsphereapi.TagValidationRule
Privileges []string
}

Expand All @@ -39,18 +39,18 @@ func ConfigureVspherePlugin(vc *ValidatorConfig, config VsphereConfig) {
ReleaseSecret: &Secret{
Name: fmt.Sprintf("validator-helm-release-%s", cfg.ValidatorPluginVsphere),
},
Account: &vsphere.VsphereCloudAccount{
Account: &vsphere.CloudAccount{
Insecure: true,
Username: config.Username,
Password: config.Password,
VcenterServer: config.VcenterServer,
},
Validator: &vsphere_api.VsphereValidatorSpec{
Auth: vsphere_api.VsphereAuth{
Validator: &vsphereapi.VsphereValidatorSpec{
Auth: vsphereapi.VsphereAuth{
SecretName: "vsphere-creds",
},
Datacenter: config.Datacenter,
ComputeResourceRules: []vsphere_api.ComputeResourceRule{
ComputeResourceRules: []vsphereapi.ComputeResourceRule{
{
Name: "Cluster Compute Resource Availability",
ClusterName: config.ClusterName,
Expand All @@ -59,7 +59,7 @@ func ConfigureVspherePlugin(vc *ValidatorConfig, config VsphereConfig) {
NodepoolResourceRequirements: config.NodePoolResourceRequirements,
},
},
EntityPrivilegeValidationRules: []vsphere_api.EntityPrivilegeValidationRule{
EntityPrivilegeValidationRules: []vsphereapi.EntityPrivilegeValidationRule{
{
Name: "Create folder: image template folder",
Username: config.Username,
Expand All @@ -68,7 +68,7 @@ func ConfigureVspherePlugin(vc *ValidatorConfig, config VsphereConfig) {
Privileges: []string{"Folder.Create"},
},
},
RolePrivilegeValidationRules: []vsphere_api.GenericRolePrivilegeValidationRule{
RolePrivilegeValidationRules: []vsphereapi.GenericRolePrivilegeValidationRule{
{
Username: config.Username,
Privileges: config.Privileges,
Expand Down
11 changes: 6 additions & 5 deletions pkg/services/clouds/vmware_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"os"

"github.com/go-logr/logr"
"github.com/pkg/errors"
"github.com/spectrocloud-labs/prompts-tui/prompts"

Expand All @@ -18,7 +19,7 @@ import (
var GetVSphereDriver = getVSphereDriver

// ReadVsphereAccountProps prompts the user to configure vSphere account properties
func ReadVsphereAccountProps(account *vsphere.VsphereCloudAccount) error {
func ReadVsphereAccountProps(account *vsphere.CloudAccount) error {
vcenterServer := account.VcenterServer
username := account.Username
password := account.Password
Expand Down Expand Up @@ -72,12 +73,12 @@ func ReadVsphereAccountProps(account *vsphere.VsphereCloudAccount) error {
return nil
}

func getVSphereDriver(account *vsphere.VsphereCloudAccount) (vsphere.VsphereDriver, error) {
return vsphere.NewVSphereDriver(account.VcenterServer, account.Username, account.Password, "")
func getVSphereDriver(account *vsphere.CloudAccount) (vsphere.Driver, error) {
return vsphere.NewVSphereDriver(account.VcenterServer, account.Username, account.Password, "", logr.Logger{})
}

// ValidateCloudAccountVsphere validates that the provided vSphere cloud account is valid
func ValidateCloudAccountVsphere(account *vsphere.VsphereCloudAccount) error {
func ValidateCloudAccountVsphere(account *vsphere.CloudAccount) error {
driver, err := GetVSphereDriver(account)
if err != nil {
return err
Expand All @@ -86,7 +87,7 @@ func ValidateCloudAccountVsphere(account *vsphere.VsphereCloudAccount) error {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

isValid, err := driver.IsValidVSphereCredentials(ctx)
isValid, err := driver.IsValidVSphereCredentials()
if err != nil {
return err
}
Expand Down
Loading

0 comments on commit feb6360

Please sign in to comment.