Skip to content

Commit

Permalink
Provider core define empty generate_iam_policy method
Browse files Browse the repository at this point in the history
  • Loading branch information
slevenick committed Jul 2, 2019
1 parent 91aaef8 commit dd409a0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions provider/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -423,5 +423,7 @@ def effective_copyright_year(out_file)
end
Time.now.year
end

def generate_iam_policy(data) end
end
end
10 changes: 7 additions & 3 deletions provider/terraform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ def generate_operation(output_folder, _types, version_name)
self)
end


# Generate the IAM policy for this object. This is used to query and test
# IAM policies separately from the resource itself
def generate_iam_policy(data)
Expand All @@ -209,8 +208,13 @@ def generate_iam_policy(data)

data.generate('templates/terraform/iam_policy.go.erb', filepath, self)

filepath = File.join(target_folder, "resource_#{product_name}_#{name}_iam_policy_generated_test.go")
data.generate('templates/terraform/examples/base_configs/iam_test_file.go.erb', filepath, self)
generated_test_name = "resource_#{product_name}_#{name}_iam_policy_generated_test.go"
filepath = File.join(target_folder, generated_test_name)
data.generate(
'templates/terraform/examples/base_configs/iam_test_file.go.erb',
filepath,
self
)
end

def build_object_data(object, output_folder, version)
Expand Down
4 changes: 2 additions & 2 deletions provider/terraform/examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def config_test
body = config_test_body
lines(compile_file(
{
content: body,
content: body
},
'templates/terraform/examples/base_configs/test_body.go.erb'
))
Expand All @@ -138,7 +138,7 @@ def config_test_body
"templates/terraform/examples/#{name}.tf.erb"
))

return substitute_test_paths body
substitute_test_paths body
end

def config_example
Expand Down

0 comments on commit dd409a0

Please sign in to comment.