Skip to content

Commit

Permalink
Fix typos (#996)
Browse files Browse the repository at this point in the history
  • Loading branch information
szepeviktor authored Dec 19, 2024
1 parent 1afd699 commit 1b40f38
Show file tree
Hide file tree
Showing 31 changed files with 68 additions and 68 deletions.
6 changes: 3 additions & 3 deletions client/cloud_credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "strings"
type AwsCredentialsType string
type GcpCredentialsType string
type AzureCredentialsType string
type VaultCrednetialsType string
type VaultCredentialsType string

type Credentials struct {
Id string `json:"id"`
Expand Down Expand Up @@ -92,7 +92,7 @@ type VaultCredentialsValuePayload struct {
type VaultCredentialsCreatePayload struct {
Name string `json:"name,omitempty"`
OrganizationId string `json:"organizationId,omitempty"`
Type VaultCrednetialsType `json:"type"`
Type VaultCredentialsType `json:"type"`
Value VaultCredentialsValuePayload `json:"value"`
}

Expand Down Expand Up @@ -127,7 +127,7 @@ const (
AzureCostCredentialsType AzureCredentialsType = "AZURE_CREDENTIALS"
AzureServicePrincipalCredentialsType AzureCredentialsType = "AZURE_SERVICE_PRINCIPAL_FOR_DEPLOYMENT"
AzureOidcCredentialsType AzureCredentialsType = "AZURE_OIDC"
VaultOidcCredentialsType VaultCrednetialsType = "VAULT_OIDC"
VaultOidcCredentialsType VaultCredentialsType = "VAULT_OIDC"
)

func (client *ApiClient) CloudCredentials(id string) (Credentials, error) {
Expand Down
2 changes: 1 addition & 1 deletion client/cloud_credentials_project_assignment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var _ = Describe("Credentials Project Assignment", func() {

Describe("AssignCloudCredentialsToProject", func() {
expectedResponse := CloudCredentialsProjectAssignment{
Id: "assigment id",
Id: "assignment id",
CredentialId: "credentialId",
ProjectId: projectId,
}
Expand Down
6 changes: 3 additions & 3 deletions client/cost_credentials_project_assignment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var _ = Describe(" Cost Credentials Project Assignment", func() {

Describe("AssignCostCredentialsToProject", func() {
expectedResponse := CostCredentialProjectAssignment{
ProjectId: "assigment id",
ProjectId: "assignment id",
CredentialsId: "credentialId",
CredentialsType: "GCP_CREDENTIALS",
}
Expand Down Expand Up @@ -79,13 +79,13 @@ var _ = Describe(" Cost Credentials Project Assignment", func() {
var actualResult []CostCredentialProjectAssignment

firstResulteResponse := CostCredentialProjectAssignment{
ProjectId: "assigment id",
ProjectId: "assignment id",
CredentialsId: "credentialId",
CredentialsType: "GCP_CREDENTIALS",
}

secondResulteResponse := CostCredentialProjectAssignment{
ProjectId: "assigment id",
ProjectId: "assignment id",
CredentialsId: "credentialId-2",
CredentialsType: "GCP_CREDENTIALS",
}
Expand Down
4 changes: 2 additions & 2 deletions client/custom_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (client *ApiClient) CustomFlowCreate(payload CustomFlowCreatePayload) (*Cus
return nil, err
}

payloadWithOrganzationId := struct {
payloadWithOrganizationId := struct {
OrganizationId string `json:"organizationId"`
CustomFlowCreatePayload
}{
Expand All @@ -63,7 +63,7 @@ func (client *ApiClient) CustomFlowCreate(payload CustomFlowCreatePayload) (*Cus
}

var result CustomFlow
if err := client.http.Post("/custom-flow", &payloadWithOrganzationId, &result); err != nil {
if err := client.http.Post("/custom-flow", &payloadWithOrganizationId, &result); err != nil {
return nil, err
}

Expand Down
4 changes: 2 additions & 2 deletions client/gpg_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (client *ApiClient) GpgKeyCreate(payload *GpgKeyCreatePayload) (*GpgKey, er
return nil, err
}

payloadWithOrganzationId := struct {
payloadWithOrganizationId := struct {
OrganizationId string `json:"organizationId"`
GpgKeyCreatePayload
}{
Expand All @@ -30,7 +30,7 @@ func (client *ApiClient) GpgKeyCreate(payload *GpgKeyCreatePayload) (*GpgKey, er
}

var result GpgKey
if err := client.http.Post("/gpg-keys", payloadWithOrganzationId, &result); err != nil {
if err := client.http.Post("/gpg-keys", payloadWithOrganizationId, &result); err != nil {
return nil, err
}

Expand Down
14 changes: 7 additions & 7 deletions client/kubernetes_credentials.go
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
package client

type KubernetesCrednetialsType string
type KubernetesCredentialsType string

const (
KubeconfigCredentialsType KubernetesCrednetialsType = "K8S_KUBECONFIG_FILE"
AwsEksCredentialsType KubernetesCrednetialsType = "K8S_EKS_AUTH"
AzureAksCredentialsType KubernetesCrednetialsType = "K8S_AZURE_AKS_AUTH"
GcpGkeCredentialsType KubernetesCrednetialsType = "K8S_GCP_GKE_AUTH"
KubeconfigCredentialsType KubernetesCredentialsType = "K8S_KUBECONFIG_FILE"
AwsEksCredentialsType KubernetesCredentialsType = "K8S_EKS_AUTH"
AzureAksCredentialsType KubernetesCredentialsType = "K8S_AZURE_AKS_AUTH"
GcpGkeCredentialsType KubernetesCredentialsType = "K8S_GCP_GKE_AUTH"
)

type KubernetesCredentialsCreatePayload struct {
Name string `json:"name"`
Type KubernetesCrednetialsType `json:"type"`
Type KubernetesCredentialsType `json:"type"`
Value interface{} `json:"value"`
}

type KubernetesCredentialsUpdatePayload struct {
Type KubernetesCrednetialsType `json:"type"`
Type KubernetesCredentialsType `json:"type"`
Value interface{} `json:"value"`
}

Expand Down
2 changes: 1 addition & 1 deletion client/sshkey_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ var _ = Describe("SshKey", func() {
})
})

Describe("SshKetUpdate", func() {
Describe("SshKeyUpdate", func() {
Describe("Success", func() {
updateMockSshKey := mockSshKey
updateMockSshKey.Value = "new-value"
Expand Down
4 changes: 2 additions & 2 deletions docs/data-sources/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ data "env0_project" "default_project" {
data "env0_project" "with_parent_name_filter" {
name = "Default Organization Project"
parent_project_name = "parent projet name"
parent_project_name = "parent project name"
}
data "env0_project" "with_parent_id_filter" {
name = "Default Organization Project"
parent_project_id = "parent-projet-id"
parent_project_id = "parent-project-id"
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/user.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ data "env0_user" "user_by_email_example" {
}
output "user_id" {
value = data.env0_user.user_by_email_exmple.id
value = data.env0_user.user_by_email_example.id
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/agent_project_assignment.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ resource "env0_agent_project_assignment" "example" {
Import is supported using the following syntax:

```shell
terraform import env0_agent_project_assigment.example project_id
terraform import env0_agent_project_assignment.example project_id
```
2 changes: 1 addition & 1 deletion docs/resources/custom_role.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ Import is supported using the following syntax:

```shell
terraform import env0_custom_role.by_id ddda7b30-6789-4d24-937c-22322754934e
terraform import env0_cusom_role.by_name "custom-role-name"
terraform import env0_custom_role.by_name "custom-role-name"
```
2 changes: 1 addition & 1 deletion docs/resources/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ Optional:

- `approve_plan_automatically` (Boolean) when 'true' (default) plans are approved automatically, otherwise ('false') deployment require manual approval
- `configuration` (Block List) sub environment configuration variables. Note: do not use with 'env0_configuration_variable' resource (see [below for nested schema](#nestedblock--sub_environment_configuration--configuration))
- `workspace` (String) sub environment workspace (overrides the configurtion in the yml file)
- `workspace` (String) sub environment workspace (overrides the configuration in the yml file)

Read-Only:

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/user_team_assignment.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ resource "env0_team" "team_example" {
name = "team-example"
}
resource "env0_user_team_assignment" "assginment_example" {
resource "env0_user_team_assignment" "assignment_example" {
user_id = data.env0_user.user_example.id
team_id = env0_team.team_example.id
}
Expand Down
2 changes: 1 addition & 1 deletion env0/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func getCredentialsById(id string, prefixList []string, meta interface{}) (clien
}

if !credentials.HasPrefix(prefixList) {
return client.Credentials{}, fmt.Errorf("credentials type mistmatch %s", credentials.Type)
return client.Credentials{}, fmt.Errorf("credentials type mismatch %s", credentials.Type)
}

return credentials, nil
Expand Down
4 changes: 2 additions & 2 deletions env0/data_kubernetes_credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

func dataKubernetesCredentials(credentialsType CloudType) *schema.Resource {
return &schema.Resource{
ReadContext: dataKuberentesCredentialsRead(credentialsType),
ReadContext: dataKubernetesCredentialsRead(credentialsType),

Schema: map[string]*schema.Schema{
"name": {
Expand All @@ -30,7 +30,7 @@ func dataKubernetesCredentials(credentialsType CloudType) *schema.Resource {
}
}

func dataKuberentesCredentialsRead(credentialsType CloudType) func(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
func dataKubernetesCredentialsRead(credentialsType CloudType) func(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
return func(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
var credentials client.Credentials

Expand Down
2 changes: 1 addition & 1 deletion env0/resource_aws_credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func resourceAwsCredentialsCreate(ctx context.Context, d *schema.ResourceData, m
_, arnExist := d.GetOk("arn")

if !accessKeyExist && !arnExist {
// Due to "import" must be inforced here and not in the schema level.
// Due to "import" must be enforced here and not in the schema level.
// This fields are only available during creation (will not be returned in read or import).
return diag.Errorf("one of `access_key_id,arn` must be specified")
}
Expand Down
20 changes: 10 additions & 10 deletions env0/resource_configuration_variable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func TestUnitConfigurationVariableResource(t *testing.T) {
})

t.Run("Create sensitive", func(t *testing.T) {
createSenstiveConfig := client.ConfigurationVariableCreateParams{
createSensitiveConfig := client.ConfigurationVariableCreateParams{
Name: "name",
Value: "value",
IsSensitive: true,
Expand All @@ -86,7 +86,7 @@ func TestUnitConfigurationVariableResource(t *testing.T) {

sensitiveConfig := client.ConfigurationVariable{
Id: uuid.NewString(),
Name: createSenstiveConfig.Name,
Name: createSensitiveConfig.Name,
Value: "*",
IsSensitive: boolPtr(true),
Scope: client.ScopeGlobal,
Expand All @@ -96,22 +96,22 @@ func TestUnitConfigurationVariableResource(t *testing.T) {
Steps: []resource.TestStep{
{
Config: resourceConfigCreate(resourceType, resourceName, map[string]interface{}{
"name": createSenstiveConfig.Name,
"value": createSenstiveConfig.Value,
"name": createSensitiveConfig.Name,
"value": createSensitiveConfig.Value,
"is_sensitive": true,
}),
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttr(accessor, "id", sensitiveConfig.Id),
resource.TestCheckResourceAttr(accessor, "name", createSenstiveConfig.Name),
resource.TestCheckResourceAttr(accessor, "value", createSenstiveConfig.Value),
resource.TestCheckResourceAttr(accessor, "name", createSensitiveConfig.Name),
resource.TestCheckResourceAttr(accessor, "value", createSensitiveConfig.Value),
resource.TestCheckResourceAttr(accessor, "is_sensitive", strconv.FormatBool(true)),
),
},
},
}

runUnitTest(t, createTestCase, func(mock *client.MockApiClientInterface) {
mock.EXPECT().ConfigurationVariableCreate(createSenstiveConfig).Times(1).Return(sensitiveConfig, nil)
mock.EXPECT().ConfigurationVariableCreate(createSensitiveConfig).Times(1).Return(sensitiveConfig, nil)
mock.EXPECT().ConfigurationVariablesById(sensitiveConfig.Id).Times(1).Return(sensitiveConfig, nil)
mock.EXPECT().ConfigurationVariableDelete(sensitiveConfig.Id).Times(1).Return(nil)
})
Expand Down Expand Up @@ -648,7 +648,7 @@ resource "%s" "test" {
IsRequired: &isRequired,
Scope: "BLUEPRINT",
}
stepConfirImport := resourceConfigCreate(resourceType, resourceName, map[string]interface{}{
stepConfigImport := resourceConfigCreate(resourceType, resourceName, map[string]interface{}{

"name": configVarImport.Name,
"description": configVarImport.Description,
Expand Down Expand Up @@ -676,7 +676,7 @@ resource "%s" "test" {
createTestCaseForImport := resource.TestCase{
Steps: []resource.TestStep{
{
Config: stepConfirImport,
Config: stepConfigImport,
},
{
ResourceName: ResourceNameImport,
Expand All @@ -700,7 +700,7 @@ resource "%s" "test" {
createTestCaseForImport := resource.TestCase{
Steps: []resource.TestStep{
{
Config: stepConfirImport,
Config: stepConfigImport,
},
{
ResourceName: ResourceNameImport,
Expand Down
8 changes: 4 additions & 4 deletions env0/resource_environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ func resourceEnvironment() *schema.Resource {
},
"workspace": {
Type: schema.TypeString,
Description: "sub environment workspace (overrides the configurtion in the yml file)",
Description: "sub environment workspace (overrides the configuration in the yml file)",
Optional: true,
},
"configuration": {
Expand Down Expand Up @@ -922,15 +922,15 @@ func resourceEnvironmentDelete(ctx context.Context, d *schema.ResourceData, meta
}

func waitForEnvironmentDestroy(ctx context.Context, apiClient client.ApiClientInterface, deploymentId string) error {
waitInteval := time.Second * 10
waitInterval := time.Second * 10
timeout := time.Minute * 30

if os.Getenv("TF_ACC") == "1" { // For acceptance tests reducing interval to 1 second and timeout to 10 seconds.
waitInteval = time.Second
waitInterval = time.Second
timeout = time.Second * 10
}

ticker := time.NewTicker(waitInteval) // When invoked - check the status.
ticker := time.NewTicker(waitInterval) // When invoked - check the status.
timer := time.NewTimer(timeout) // When invoked - timeout.
results := make(chan error)

Expand Down
6 changes: 3 additions & 3 deletions env0/resource_environment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3069,8 +3069,8 @@ func TestUnitEnvironmentWithSubEnvironment(t *testing.T) {

updatedSubEnvironment.Workspace = "workspace2"

subEnvrionmentWithId := subEnvironment
subEnvrionmentWithId.Id = workflowSubEnvironment.EnvironmentId
subEnvironmentWithId := subEnvironment
subEnvironmentWithId.Id = workflowSubEnvironment.EnvironmentId

environment := client.Environment{
Id: "id",
Expand Down Expand Up @@ -3290,7 +3290,7 @@ func TestUnitEnvironmentWithSubEnvironment(t *testing.T) {
mock.EXPECT().ConfigurationVariablesByScope(client.ScopeWorkflow, environment.Id).Times(1).Return(client.ConfigurationChanges{configurationVariable}, nil),
mock.EXPECT().ConfigurationSetsAssignments("ENVIRONMENT", environment.Id).Times(1).Return(nil, nil),
mock.EXPECT().ConfigurationSetsAssignments("ENVIRONMENT", environment.Id).Times(1).Return(nil, nil),
mock.EXPECT().ConfigurationVariablesByScope(client.ScopeEnvironment, subEnvrionmentWithId.Id).Times(1).Return(subEnvironment.Configuration, nil),
mock.EXPECT().ConfigurationVariablesByScope(client.ScopeEnvironment, subEnvironmentWithId.Id).Times(1).Return(subEnvironment.Configuration, nil),
mock.EXPECT().EnvironmentDeploy(environment.Id, deployRequest).Times(1).Return(client.EnvironmentDeployResponse{
Id: environment.Id,
}, nil),
Expand Down
8 changes: 4 additions & 4 deletions env0/resource_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

func resourceModule() *schema.Resource {
vcsExcatlyOneOf := []string{
vcsExactlyOneOf := []string{
"token_id",
"github_installation_id",
"bitbucket_client_key",
Expand Down Expand Up @@ -53,7 +53,7 @@ func resourceModule() *schema.Resource {
Type: schema.TypeString,
Description: "the git token id to be used",
Optional: true,
ExactlyOneOf: vcsExcatlyOneOf,
ExactlyOneOf: vcsExactlyOneOf,
},
"token_name": {
Type: schema.TypeString,
Expand All @@ -65,13 +65,13 @@ func resourceModule() *schema.Resource {
Type: schema.TypeInt,
Description: "the env0 application installation id on the relevant Github repository",
Optional: true,
ExactlyOneOf: vcsExcatlyOneOf,
ExactlyOneOf: vcsExactlyOneOf,
},
"bitbucket_client_key": {
Type: schema.TypeString,
Description: "the client key used for integration with Bitbucket",
Optional: true,
ExactlyOneOf: vcsExcatlyOneOf,
ExactlyOneOf: vcsExactlyOneOf,
},
"ssh_keys": {
Type: schema.TypeList,
Expand Down
4 changes: 2 additions & 2 deletions env0/resource_notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,11 @@ func resourceNotificationDelete(ctx context.Context, d *schema.ResourceData, met
func getNotification(ctx context.Context, id string, meta interface{}) (*client.Notification, error) {
_, err := uuid.Parse(id)
if err == nil {
tflog.Info(ctx, "Resolving notifcation by id", map[string]interface{}{"id": id})
tflog.Info(ctx, "Resolving notification by id", map[string]interface{}{"id": id})

return getNotificationById(id, meta)
} else {
tflog.Info(ctx, "Resolving notifcation by name", map[string]interface{}{"name ": id})
tflog.Info(ctx, "Resolving notification by name", map[string]interface{}{"name ": id})

return getNotificationByName(id, meta)
}
Expand Down
Loading

0 comments on commit 1b40f38

Please sign in to comment.