Skip to content

Commit

Permalink
Clean hardcoded endpoints (#652)
Browse files Browse the repository at this point in the history
* Implement Provider endpoints version for ovh

* Implement provider endpoint version for flexibleengine

* Implement provider endpoint version for outscale

* Implement provider endpoint version for gcp

* Implement provider endpoint version for cloudferro

* Update doc with new provider endpoint version fields

* chores: changed workflows

* chores: updated dependencies

* bug: wrong error message

* bug: wrong error message

* feat: introducing clientType for classic and terraform drivers

* bug: removed duplicated code

* feat: added driver type

* clean: remove dead code

---------

Co-authored-by: Matthieu Robert <[email protected]>
  • Loading branch information
oscarpicas and mrobert-cs authored Mar 10, 2023
1 parent 6543aa4 commit 0797fb1
Show file tree
Hide file tree
Showing 23 changed files with 405 additions and 210 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/bugs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ on:
push:
branches:
- 'bug/**'
- 'bugs/**'
- 'task/**'
- 'tasks/**'
pull_request:
branches:
- 'bug/**'
- 'bugs/**'
- 'task/**'
- 'tasks/**'

env:
PROTOCVERSION: 3.17.3
Expand Down
145 changes: 85 additions & 60 deletions doc/TENANTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,76 +157,81 @@ Combinations are possible :

The valid keywords in this section are :

> | keyword | presence | client |
> |---------------------------------|-------------------|---------------------------------------|
> | `AccessKey` | MANDATORY, CLIENT | outscale |
> | `ApplicationKey` | MANDATORY, CLIENT | ovh |
> | `OpenstackID` | MANDATORY, CLIENT | ovh |
> | `OpenstackPassword` | MANDATORY, CLIENT | ovh |
> | `Password` | MANDATORY, CLIENT | all providers except ooutscal and ovh |
> | `SecretKey` | MANDATORY, CLIENT | outscale |
> | `Username` | MANDATORY, CLIENT | all providers except ooutscal and ovh |
> | `AlternateApiApplicationKey` | OPTIONAL, CLIENT | ovh |
> | `AlternateApiApplicationSecret` | OPTIONAL, CLIENT | ovh |
> | `AlternateApiConsumerKey` | OPTIONAL, CLIENT | ovh |
> | `UserID` | MANDATORY, CLIENT | outscale |
> | `AccessKeyID` | MANDATORY, CLIENT | aws |
> | `SecretAccessKey` | MANDATORY, CLIENT | aws |
> | `IdentityEndpoint` | MANDATORY, CLIENT | openstack |
> | `auth_uri` | MANDATORY, CLIENT | gcp |
> | `DomainNAme` | MANDATORY, CLIENT | cloudferro, flexibleengine |
> | `Endpoint` | MANDATORY, CLIENT | flexibleengine |
> | `project_id` | MANDATORY, CLIENT | gcp |
> | `private_key_id` | MANDATORY, CLIENT | gcp |
> | `private_key` | MANDATORY, CLIENT | gcp |
> | `client_email` | MANDATORY, CLIENT | gcp |
> | `toekn_uri` | MANDATORY, CLIENT | gcp |
> | `auth_provider_x509_cert_url` | MANDATORY, CLIENT | gcp |
> | `client_x509_cert_url` | MANDATORY, CLIENT | gcp |
> | keyword | presence | client |
> |---------------------------------|-------------------|-------------------------------------------|
> | `AccessKey` | MANDATORY, CLIENT | outscale |
> | `ApplicationKey` | MANDATORY, CLIENT | ovh |
> | `OpenstackID` | MANDATORY, CLIENT | ovh |
> | `OpenstackPassword` | MANDATORY, CLIENT | ovh |
> | `Password` | MANDATORY, CLIENT | all providers except ooutscal and ovh |
> | `SecretKey` | MANDATORY, CLIENT | outscale |
> | `Username` | MANDATORY, CLIENT | all providers except ooutscal and ovh |
> | `AlternateApiApplicationKey` | OPTIONAL, CLIENT | ovh |
> | `AlternateApiApplicationSecret` | OPTIONAL, CLIENT | ovh |
> | `AlternateApiConsumerKey` | OPTIONAL, CLIENT | ovh |
> | `UserID` | MANDATORY, CLIENT | outscale |
> | `AccessKeyID` | MANDATORY, CLIENT | aws |
> | `SecretAccessKey` | MANDATORY, CLIENT | aws |
> | `IdentityEndpoint` | MANDATORY, CLIENT | openstack |
> | `auth_uri` | MANDATORY, CLIENT | gcp |
> | `DomainNAme` | MANDATORY, CLIENT | cloudferro, flexibleengine |
> | `Endpoint` | MANDATORY, CLIENT | flexibleengine |
> | `project_id` | MANDATORY, CLIENT | gcp |
> | `private_key_id` | MANDATORY, CLIENT | gcp |
> | `private_key` | MANDATORY, CLIENT | gcp |
> | `client_email` | MANDATORY, CLIENT | gcp |
> | `toekn_uri` | MANDATORY, CLIENT | gcp |
> | `auth_provider_x509_cert_url` | MANDATORY, CLIENT | gcp |
> | `client_x509_cert_url` | MANDATORY, CLIENT | gcp |
> | `IdentityEndpointVersion` | OPTIONAL, CLIENT | ovh, flexibleengine, outscale, cloudferro |

### Section ``[tenants.compute]``

The valid keywords in this section are :

> | keyword | presence | client |
> |----------------------------------|-------------------|--------------------------------|
> | `DefaultImage` | OPTIONAL, CLIENT | all except ovh |
> | `ProjectName` | OPTIONAL, CLIENT | aws, cloudferro, gcp, ovh |
> | `ProjectID` | OPTIONAL, CLIENT | aws, flexibleengine, gcp |
> | `Region` | MANDATORY | all |
> | `AvailabilityZone` | MANDATORY, CLIENT | flexibleengine, openstack, ovh |
> | `DNS` | OPTIONAL | all |
> | `Scannable` | OPTIONAL, CLIENT | ovh |
> | `OperatorUsername` | OPTIONAL | all |
> | `Owners` | OPTIONAL, CLIENT | aws |
> | `MaxLiftimeInHours` | OPTIONAL | all |
> | `ConcurrentMachineCreationLimit` | OPTIONAL | all |
> | `Safe` | OPTIONAL | all |
> | `Zone` | MANDATORY, CLIENT | gcp, aws |
> | `TenantName` | OPTIONAL, CLIENT | openstack |
> | `TenantID` | OPTIONAL, CLIENT | openstack |
> | `URL` | OPTIONAL, CLIENT | outscale |
> | `Service` | MANDATORY, CLIENT | outscale |
> | `Subregion` | MANDATORY, CLIENT | outscale |
> | `DefaultTenancy` | OPTIONAL, CLIENT | outscale |
> | `DefaultVolumeSpeed` | OPTIONAL, CLIENT | outscale |
> | `S3` | OPTIONAL, CLIENT | aws |
> | `EC2` | OPTIONAL, CLIENT | aws |
> | `SSM` | OPTIONAL, CLIENT | aws |
> | keyword | presence | client |
> |----------------------------------|-------------------|--------------------------------------|
> | `DefaultImage` | OPTIONAL, CLIENT | all except ovh |
> | `ProjectName` | OPTIONAL, CLIENT | aws, cloudferro, gcp, ovh |
> | `ProjectID` | OPTIONAL, CLIENT | aws, flexibleengine, gcp |
> | `Region` | MANDATORY | all |
> | `AvailabilityZone` | MANDATORY, CLIENT | flexibleengine, openstack, ovh |
> | `DNS` | OPTIONAL | all |
> | `Scannable` | OPTIONAL, CLIENT | ovh |
> | `OperatorUsername` | OPTIONAL | all |
> | `Owners` | OPTIONAL, CLIENT | aws |
> | `MaxLiftimeInHours` | OPTIONAL | all |
> | `ConcurrentMachineCreationLimit` | OPTIONAL | all |
> | `Safe` | OPTIONAL | all |
> | `Zone` | MANDATORY, CLIENT | gcp, aws |
> | `TenantName` | OPTIONAL, CLIENT | openstack |
> | `TenantID` | OPTIONAL, CLIENT | openstack |
> | `URL` | OPTIONAL, CLIENT | outscale |
> | `Service` | MANDATORY, CLIENT | outscale |
> | `Subregion` | MANDATORY, CLIENT | outscale |
> | `DefaultTenancy` | OPTIONAL, CLIENT | outscale |
> | `DefaultVolumeSpeed` | OPTIONAL, CLIENT | outscale |
> | `S3` | OPTIONAL, CLIENT | aws |
> | `EC2` | OPTIONAL, CLIENT | aws |
> | `SSM` | OPTIONAL, CLIENT | aws |
> | `ComputeEndpointVersion` | OPTIONAL, CLIENT | ovh, flexibleengine, gcp, cloudferro |
> | `VolumeEndpointVersion` |  OPTIONAL, CLIENT | ovh, flexibleengine, cloudferro |

### Section ``[tenants.network]``

The valid keywords in this section are :

> | keyword | presence | client |
> |----------------------|------------------|-------------------------------|
> | `ProviderNetwork` | OPTIONAL, CLIENT | cloudferro, gcp, ovh |
> | `VPCCIDR` | OPTIONAL, CLIENT | flexibleengine, gcp, outscale |
> | `VPCName` | OPTIONAL, CLIENT | flexibleengine, gcp, outscale |
> | `FloatingIPPool` | OPTIONAL, CLIENT | cloudferro, openstack |
> | `DefaultNetworkName` | OPTIONAL, CLIENT | flexibleengine, outscale |
> | `DefaultNetworkCIDR` | OPTIONAL, CLIENT | flexibleengine, outscale |
> | `ExternalNetwork` | OPTIONAL, CLIENT | openstack |
> | keyword | presence | client |
> |---------------------------|------------------|---------------------------------|
> | `ProviderNetwork` | OPTIONAL, CLIENT | cloudferro, gcp, ovh |
> | `VPCCIDR` | OPTIONAL, CLIENT | flexibleengine, gcp, outscale |
> | `VPCName` | OPTIONAL, CLIENT | flexibleengine, gcp, outscale |
> | `FloatingIPPool` | OPTIONAL, CLIENT | cloudferro, openstack |
> | `DefaultNetworkName` | OPTIONAL, CLIENT | flexibleengine, outscale |
> | `DefaultNetworkCIDR` | OPTIONAL, CLIENT | flexibleengine, outscale |
> | `ExternalNetwork` | OPTIONAL, CLIENT | openstack |
> |  `NetworkEndpointVersion` | OPTIONAL, CLIENT | ovh, flexibleengine, cloudferro |
> | `NetworkClientEndpoint` | OPTIONAL, CLIENT |  flexibleengine |

### Section ``[tenants.objectstorage]``

Expand Down Expand Up @@ -324,6 +329,10 @@ Contain the name of the bucket to use to store metadata.

Contains the maximum number of machines that can be created concurrently.

### `ComputeEndpointVersion`

Constains the version of the provider compute endpoint (ex : v1; v3.1)

### `CryptKey`

Contains the key used to encrypt the metadata.
Expand Down Expand Up @@ -379,10 +388,22 @@ Contains the name of the floating IP pool to use.

Contains the URL of the Identity backend to use.

### `IdentityEndpointVersion`

Constains the version of the provider identity endpoint (ex : v1; v3.1)

### `MaxLifeTimeInHours` (integer)

Contains the maximum lifetime of a machine in hours.

### `NetworkClientEndpointVersion`

Constains the version of the provider network client endpoint (ex : v1; v3.1)

### `NetworkEndpointVersion`

Constains the version of the provider network endpoint (ex : v1; v3.1)

### `OpenstackID`: alias, see [`Username`](#Username)

### `OperatorUsername`
Expand Down Expand Up @@ -486,6 +507,10 @@ Valid values are:
> | `"azure"` | Azure protocol (not tested) |
> | `"gce"` | Google GCE protocol |

### `VolumeEndpointVersion`

Constains the version of the provider volume endpoint (ex : v1; v3.1)

### `VPCCIDR`

Contains the name of the VPC where networks will be created. If the VPC doesn't exist, will be created.
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ require (
github.com/stretchr/testify v1.8.2
github.com/urfave/cli v1.22.10
github.com/zserge/metric v0.1.0
golang.org/x/crypto v0.6.0
golang.org/x/net v0.7.0
golang.org/x/crypto v0.7.0
golang.org/x/net v0.8.0
golang.org/x/oauth2 v0.5.0
golang.org/x/sync v0.1.0
golang.org/x/sys v0.5.0
golang.org/x/term v0.5.0
golang.org/x/text v0.7.0
golang.org/x/sys v0.6.0
golang.org/x/term v0.6.0
golang.org/x/text v0.8.0
gomodules.xyz/stow v0.2.4
google.golang.org/api v0.110.0
google.golang.org/grpc v1.53.0
Expand Down
20 changes: 10 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -742,8 +742,8 @@ golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5y
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc=
golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A=
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
Expand Down Expand Up @@ -836,8 +836,8 @@ golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down Expand Up @@ -941,15 +941,15 @@ golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ=
golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw=
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand All @@ -961,8 +961,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68=
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down
Loading

0 comments on commit 0797fb1

Please sign in to comment.