Skip to content

Commit

Permalink
bump sdk version (#365)
Browse files Browse the repository at this point in the history
* bump sdk version

* update mocks-test

* change git repo

* fix tests
  • Loading branch information
pggb25 committed Apr 23, 2024
1 parent 9f1c716 commit 5a46c45
Show file tree
Hide file tree
Showing 16 changed files with 31 additions and 23 deletions.
10 changes: 5 additions & 5 deletions client/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,10 +415,10 @@ func (c *Client) fetchVariablesForAliasesAndOverrides(ctx context.Context, app *
variablesByNameForAliases := make(map[string]qovery.EnvironmentVariable)
variablesByNameForOverrides := make(map[string]qovery.EnvironmentVariable)
for _, result := range applicationVariables.Results {
if *result.VariableType == qovery.APIVARIABLETYPEENUM_VALUE || *result.VariableType == qovery.APIVARIABLETYPEENUM_BUILT_IN {
if result.VariableType == qovery.APIVARIABLETYPEENUM_VALUE || result.VariableType == qovery.APIVARIABLETYPEENUM_BUILT_IN {
variablesByNameForAliases[result.Key] = result
}
if *result.VariableType == qovery.APIVARIABLETYPEENUM_VALUE && (result.Scope == qovery.APIVARIABLESCOPEENUM_ENVIRONMENT || result.Scope == qovery.APIVARIABLESCOPEENUM_PROJECT) {
if result.VariableType == qovery.APIVARIABLETYPEENUM_VALUE && (result.Scope == qovery.APIVARIABLESCOPEENUM_ENVIRONMENT || result.Scope == qovery.APIVARIABLESCOPEENUM_PROJECT) {
variablesByNameForOverrides[result.Key] = result
}
}
Expand Down Expand Up @@ -467,13 +467,13 @@ func computeAliasOverrideValueVariablesAndSecrets(
var variableOverrides []*qovery.EnvironmentVariable

for _, variable := range environmentVariables {
if *variable.VariableType == qovery.APIVARIABLETYPEENUM_VALUE || *variable.VariableType == qovery.APIVARIABLETYPEENUM_BUILT_IN {
if variable.VariableType == qovery.APIVARIABLETYPEENUM_VALUE || variable.VariableType == qovery.APIVARIABLETYPEENUM_BUILT_IN {
variableValues = append(variableValues, variable)
}
if *variable.VariableType == qovery.APIVARIABLETYPEENUM_ALIAS {
if variable.VariableType == qovery.APIVARIABLETYPEENUM_ALIAS {
variableAliases = append(variableAliases, variable)
}
if *variable.VariableType == qovery.APIVARIABLETYPEENUM_OVERRIDE {
if variable.VariableType == qovery.APIVARIABLETYPEENUM_OVERRIDE {
variableOverrides = append(variableOverrides, variable)
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ data "qovery_cluster" "my_cluster" {
### Read-Only

- `cloud_provider` (String) Cloud provider of the cluster.
- Can be: `AWS`, `GCP`, `SCW`.
- Can be: `AWS`, `GCP`, `ON_PREMISE`, `SCW`.
- `credentials_id` (String) Id of the credentials.
- `instance_type` (String) Instance type of the cluster. I.e: For Aws `t3a.xlarge`, for Scaleway `DEV-L`
- `name` (String) Name of the cluster.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ You can find complete examples within these repositories:
### Required

- `cloud_provider` (String) Cloud provider of the cluster.
- Can be: `AWS`, `GCP`, `SCW`.
- Can be: `AWS`, `GCP`, `ON_PREMISE`, `SCW`.
- `credentials_id` (String) Id of the credentials.
- `instance_type` (String) Instance type of the cluster. I.e: For Aws `t3a.xlarge`, for Scaleway `DEV-L`
- `name` (String) Name of the cluster.
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ require (
github.com/hashicorp/terraform-plugin-log v0.9.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.29.0
github.com/pkg/errors v0.9.1
github.com/qovery/qovery-client-go v0.0.0-20240215160333-8424923c00e9
github.com/qovery/qovery-client-go v0.0.0-20240422162248-1a51e133ad7d
github.com/schollz/progressbar/v3 v3.13.0
github.com/sethvargo/go-envconfig v0.9.0
github.com/stretchr/testify v1.8.4
github.com/stretchr/testify v1.9.0
golang.org/x/exp v0.0.0-20220706164943-b4a6d9510983
)

Expand Down Expand Up @@ -75,7 +75,7 @@ require (
github.com/russross/blackfriday v1.6.0 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
Expand Down
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,8 @@ github.com/qovery/qovery-client-go v0.0.0-20240212165349-98d0b37a2c8e h1:G8r1BQv
github.com/qovery/qovery-client-go v0.0.0-20240212165349-98d0b37a2c8e/go.mod h1:5QD7sC1Z6XCCYd31c4XKVwGdEOjvtgG0NDcaVDoWb+o=
github.com/qovery/qovery-client-go v0.0.0-20240215160333-8424923c00e9 h1:kbN+bPGCiDWCzvqjzhk1/g89nbe/FoFJbBJyqYBktl4=
github.com/qovery/qovery-client-go v0.0.0-20240215160333-8424923c00e9/go.mod h1:5QD7sC1Z6XCCYd31c4XKVwGdEOjvtgG0NDcaVDoWb+o=
github.com/qovery/qovery-client-go v0.0.0-20240422162248-1a51e133ad7d h1:5BV09IY06+bhqVcXuFwJjjBUKc1wSYA/LyoGxcgw6js=
github.com/qovery/qovery-client-go v0.0.0-20240422162248-1a51e133ad7d/go.mod h1:9eHj5a4EtXGIyfbvVL3HVYW9k7Xmiwi00OqHrP4dc10=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.3 h1:utMvzDsuh3suAEnhH0RdHmoPbU648o6CvXxTx4SBMOw=
github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
Expand All @@ -431,6 +433,8 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
Expand All @@ -444,6 +448,8 @@ github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKs
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI=
github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
Expand Down
2 changes: 2 additions & 0 deletions internal/domain/status/status_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const (
StateRestarted State = "RESTARTED"
StateRestartError State = "RESTART_ERROR"
StateRestartQueued State = "RESTART_QUEUED"
StateRecap State = "RECAP"
)

// AllowedStateValues contains all the valid values of a State.
Expand All @@ -58,6 +59,7 @@ var AllowedStateValues = []State{
StateRestarted,
StateRestartError,
StateRestartQueued,
StateRecap,
}

var AllowedDesiredStateValues = []State{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func newDomainEnvSecretFromQovery(v *qovery.VariableResponse) (*secret.Secret, e
SecretID: v.GetId(),
Scope: string(v.Scope),
Key: v.GetKey(),
Type: string(*v.VariableType),
Type: string(v.VariableType),
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func newDomainEnvVariableFromQovery(v *qovery.VariableResponse) (*variable.Varia
Scope: string(v.Scope),
Key: v.Key,
Value: value,
Type: string(*v.VariableType),
Type: string(v.VariableType),
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (c newNewDeploymentQoveryAPI) Stop(ctx context.Context, newDeployment newde
}

func (c newNewDeploymentQoveryAPI) Restart(ctx context.Context, newDeployment newdeployment.Deployment) (*newdeployment.Deployment, error) {
_, resp, err := c.client.EnvironmentActionsAPI.RestartEnvironment(ctx, newDeployment.EnvironmentID.String()).Execute()
_, resp, err := c.client.EnvironmentActionsAPI.RedeployEnvironment(ctx, newDeployment.EnvironmentID.String()).Execute()
if err != nil || resp.StatusCode >= 400 {
return nil, apierrors.NewCreateAPIError(apierrors.APIResourceDeployment, newDeployment.EnvironmentID.String(), resp, err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func newDomainVariableFromQovery(v *qovery.EnvironmentVariable) (*variable.Varia
Scope: string(v.Scope),
Key: v.Key,
Value: value,
Type: string(*v.VariableType),
Type: string(v.VariableType),
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestNewDomainVariablesFromQovery(t *testing.T) {
v := gofakeit.Word()
return &v
}(),
VariableType: &variableType,
VariableType: variableType,
},
{
Id: gofakeit.UUID(),
Expand All @@ -44,7 +44,7 @@ func TestNewDomainVariablesFromQovery(t *testing.T) {
v := gofakeit.Word()
return &v
}(),
VariableType: &variableType,
VariableType: variableType,
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions qovery/environment_variable_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func fromEnvironmentVariable(v *qovery.EnvironmentVariable) EnvironmentVariable
func fromEnvironmentVariableList(vars []*qovery.EnvironmentVariable, scope qovery.APIVariableScopeEnum, variableType string) EnvironmentVariableList {
list := make([]EnvironmentVariable, 0, len(vars))
for _, v := range vars {
if v.Scope != scope || string(*v.VariableType) != variableType {
if v.Scope != scope || string(v.VariableType) != variableType {
continue
}
list = append(list, fromEnvironmentVariable(v))
Expand All @@ -203,7 +203,7 @@ func fromEnvironmentVariableList(vars []*qovery.EnvironmentVariable, scope qover
func fromEnvironmentVariableListWithNullableInitialState(initialState types.Set, vars []*qovery.EnvironmentVariable, scope qovery.APIVariableScopeEnum, variableType string) EnvironmentVariableList {
list := make([]EnvironmentVariable, 0, len(vars))
for _, v := range vars {
if v.Scope != scope || string(*v.VariableType) != variableType {
if v.Scope != scope || string(v.VariableType) != variableType {
continue
}
list = append(list, fromEnvironmentVariable(v))
Expand Down
2 changes: 1 addition & 1 deletion qovery/resource_application_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func (app Application) toUpdateApplicationRequest(state Application) (*client.Ap
applicationEditRequest := qovery.ApplicationEditRequest{
Name: ToStringPointer(app.Name),
BuildMode: buildMode,
DockerfilePath: ToStringPointer(app.DockerfilePath),
DockerfilePath: ToNullableString(app.DockerfilePath),
BuildpackLanguage: ToNullableNullableBuildPackLanguageEnum(app.BuildpackLanguage),
Cpu: ToInt32Pointer(app.CPU),
Memory: ToInt32Pointer(app.Memory),
Expand Down
2 changes: 1 addition & 1 deletion qovery/resource_application_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
)

const (
applicationRepositoryURL = "https://github.com/Qovery/test_http_server.git"
applicationRepositoryURL = "https://github.com/erebe/test_http_server.git"
applicationBranch = "master"
)

Expand Down
2 changes: 1 addition & 1 deletion qovery/resource_deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ resource "qovery_application" "application_test" {
build_mode = "DOCKER"
dockerfile_path = "Dockerfile"
git_repository = {
url = "https://github.com/Qovery/test_http_server.git"
url = "https://github.com/erebe/test_http_server.git"
}
deployment_stage_id = qovery_deployment_stage.deployment_stage_1.id
healthchecks = {}
Expand Down
4 changes: 2 additions & 2 deletions qovery/resource_job_git_token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestAcc_JobGitToken(t *testing.T) {
Source: &qovery.JobSource{
Docker: &qovery.Docker{
GitRepository: qovery.GitRepository{
Url: qovery.FromString("https://github.com/Qovery/test_http_server.git"),
Url: qovery.FromString("https://github.com/erebe/test_http_server.git"),
Branch: qovery.FromString("master"),
RootPath: qovery.FromString("/"),
GitTokenId: qovery.FromString(getTestQoverySandboxGitTokenID()),
Expand Down Expand Up @@ -71,7 +71,7 @@ func TestAcc_JobGitToken(t *testing.T) {
resource.TestCheckResourceAttr("qovery_job.test", "max_nb_restart", "0"),
resource.TestCheckNoResourceAttr("qovery_job.test", "port"),
resource.TestCheckResourceAttr("qovery_job.test", "source.docker.dockerfile_path", "./Dockerfile"),
resource.TestCheckResourceAttr("qovery_job.test", "source.docker.git_repository.url", "https://github.com/Qovery/test_http_server.git"),
resource.TestCheckResourceAttr("qovery_job.test", "source.docker.git_repository.url", "https://github.com/erebe/test_http_server.git"),
resource.TestCheckResourceAttr("qovery_job.test", "source.docker.git_repository.branch", "master"),
resource.TestCheckResourceAttr("qovery_job.test", "source.docker.git_repository.root_path", "/"),
resource.TestCheckResourceAttr("qovery_job.test", "source.docker.git_repository.git_token_id", getTestQoverySandboxGitTokenID()),
Expand Down

0 comments on commit 5a46c45

Please sign in to comment.