Skip to content

Commit

Permalink
Replace last couple occurrences of subresource with parentResource.
Browse files Browse the repository at this point in the history
Signed-off-by: jchampne <jchampne@opendns.com>
  • Loading branch information
jchampne committed Jul 22, 2019
1 parent 1c26cb5 commit 38c0f5a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion openapi/openapi_spec_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type SpecResource interface {
shouldIgnoreResource() bool
getResourceOperations() specResourceOperations
getTimeouts() (*specTimeouts, error)
// getParentResourceInfo returns a struct populated with relevant subresource information if the resource is considered
// getParentResourceInfo returns a struct populated with relevant parentResourceInfo if the resource is considered
// a subresource; nil otherwise.
getParentResourceInfo() *parentResourceInfo
}
Expand Down
8 changes: 4 additions & 4 deletions openapi/openapi_v2_spec_analyser.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ func (specAnalyser *specV2Analyser) GetTerraformCompliantResources() ([]SpecReso
}

func (specAnalyser *specV2Analyser) validateSubResourceTerraformCompliance(r SpecV2Resource) error {
subResource := r.getParentResourceInfo()
if subResource != nil {
parentResourceInfo := r.getParentResourceInfo()
if parentResourceInfo != nil {
resourcePath := r.Path
for _, parentInstanceURIs := range subResource.parentInstanceURIs {
for _, parentInstanceURIs := range parentResourceInfo.parentInstanceURIs {
if pathExists, _ := specAnalyser.pathExists(parentInstanceURIs); !pathExists {
return fmt.Errorf("subresource with path '%s' is missing parent path instance definition '%s'", resourcePath, parentInstanceURIs)
}
}
for _, parentURI := range subResource.parentURIs {
for _, parentURI := range parentResourceInfo.parentURIs {
parentPathExists, parentPathItem := specAnalyser.pathExists(parentURI)
if !parentPathExists {
return fmt.Errorf("subresource with path '%s' is missing parent root path definition '%s'", resourcePath, parentURI)
Expand Down

0 comments on commit 38c0f5a

Please sign in to comment.