Skip to content

Commit

Permalink
Fixed variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
kochetovd committed Nov 27, 2024
1 parent 3e49dea commit 4b2ae3c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ARG MEMORY_LIMIT
ARG INSTANCE_TYPE
ARG AWS_REGION
ARG AWS_RDS_DB
ARG AWS_RDS_PARAMETR_GROUP
ARG AWS_RDS_PARAMETER_GROUP

ARG RELEEM_ENV
ARG RELEEM_DEBUG
Expand Down
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type Config struct {
InstanceType string `hcl:"instance_type"`
AwsRegion string `hcl:"aws_region"`
AwsRDSDB string `hcl:"aws_rds_db"`
AwsRDSParameterGroup string `hcl:"aws_rds_parametr_group"`
AwsRDSParameterGroup string `hcl:"aws_rds_parameter_group"`
QueryOptimization bool `hcl:"query_optimization"`
DatabasesQueryOptimization string `hcl:"databases_query_optimization"`
}
Expand Down
6 changes: 3 additions & 3 deletions docker/releem.conf.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ aws_region="${AWS_REGION:-us-east-1}"
# RDS database name.
aws_rds_db="${AWS_RDS_DB}"

# AWS_RDS_PARAMETR_GROUP string `hcl:"aws_rds_parametr_group"`
# RDS database parametr group name.
aws_rds_parametr_group="${AWS_RDS_PARAMETR_GROUP}"
# AWS_RDS_PARAMETER_GROUP string `hcl:"aws_rds_parameter_group"`
# RDS database parameter group name.
aws_rds_parameter_group="${AWS_RDS_PARAMETER_GROUP}"

# Env string `hcl:"env"`
# Releem Environment.
Expand Down
16 changes: 8 additions & 8 deletions tasks/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,19 +292,19 @@ func ApplyConfAwsRds(repeaters models.MetricsRepeater, gatherers []models.Metric
task_exit_code = 1
return task_exit_code, task_status, task_output
} else if configuration.AwsRDSParameterGroup == "" || aws.StringValue(paramGroup.DBParameterGroupName) != configuration.AwsRDSParameterGroup {
logger.Error("Parametr group '" + configuration.AwsRDSParameterGroup + "' not found or empty in DB Instance " + configuration.AwsRDSDB + "(" + aws.StringValue(paramGroup.DBParameterGroupName) + ")")
task_output = task_output + "Parametr group '" + configuration.AwsRDSParameterGroup + "' not found or empty in DB Instance " + configuration.AwsRDSDB + "(" + aws.StringValue(paramGroup.DBParameterGroupName) + ")\n"
logger.Error("Parameter group '" + configuration.AwsRDSParameterGroup + "' not found or empty in DB Instance " + configuration.AwsRDSDB + "(" + aws.StringValue(paramGroup.DBParameterGroupName) + ")")
task_output = task_output + "Parameter group '" + configuration.AwsRDSParameterGroup + "' not found or empty in DB Instance " + configuration.AwsRDSDB + "(" + aws.StringValue(paramGroup.DBParameterGroupName) + ")\n"
task_status = 4
task_exit_code = 3
return task_exit_code, task_status, task_output
} else if aws.StringValue(paramGroup.ParameterApplyStatus) != "in-sync" {
logger.Error("Parametr group status '" + configuration.AwsRDSParameterGroup + "' not in-sync(" + aws.StringValue(paramGroup.ParameterApplyStatus) + ")")
task_output = task_output + "Parametr group status '" + configuration.AwsRDSParameterGroup + "' not in-sync(" + aws.StringValue(paramGroup.ParameterApplyStatus) + ")\n"
logger.Error("Parameter group status '" + configuration.AwsRDSParameterGroup + "' not in-sync(" + aws.StringValue(paramGroup.ParameterApplyStatus) + ")")
task_output = task_output + "Parameter group status '" + configuration.AwsRDSParameterGroup + "' not in-sync(" + aws.StringValue(paramGroup.ParameterApplyStatus) + ")\n"
task_status = 4
task_exit_code = 2
return task_exit_code, task_status, task_output
}
DbParametrsType := make(models.MetricGroupValue)
DbParametersType := make(models.MetricGroupValue)

if apply_method == types.ApplyMethodImmediate {
// Вызов DescribeDBParameters для получения параметров группы
Expand All @@ -321,7 +321,7 @@ func ApplyConfAwsRds(repeaters models.MetricsRepeater, gatherers []models.Metric
task_output = task_output + err.Error()
}
for _, param := range page.Parameters {
DbParametrsType[*param.ParameterName] = *param.ApplyType
DbParametersType[*param.ParameterName] = *param.ApplyType
}
}
}
Expand Down Expand Up @@ -350,7 +350,7 @@ func ApplyConfAwsRds(repeaters models.MetricsRepeater, gatherers []models.Metric
}

if apply_method == types.ApplyMethodImmediate {
val, ok := DbParametrsType[key]
val, ok := DbParametersType[key]
if ok && val != "dynamic" {
continue
}
Expand Down Expand Up @@ -448,7 +448,7 @@ func ApplyConfAwsRds(repeaters models.MetricsRepeater, gatherers []models.Metric
task_exit_code = 10
task_status = 4
} else if aws.StringValue(dbInstance.DBInstanceStatus) == "available" && aws.StringValue(paramGroup.ParameterApplyStatus) == "in-sync" {
logger.Println("DB Instance Status available, Parametr Group Status in-sync, No pending modifications")
logger.Println("DB Instance Status available, Parameter Group Status in-sync, No pending modifications")
} else {
task_exit_code = 7
task_status = 4
Expand Down

0 comments on commit 4b2ae3c

Please sign in to comment.