Skip to content

Commit

Permalink
importer-rest-api-specs: disable check for non-default Resource Provi…
Browse files Browse the repository at this point in the history
…der when parsing operations, as this was never utilised and leads to skipping resources/operations
  • Loading branch information
manicminer authored and stephybun committed Oct 9, 2024
1 parent a5c820f commit 1da6920
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
parserModels "github.com/hashicorp/pandora/tools/importer-rest-api-specs/internal/components/apidefinitions/parser/models"
"github.com/hashicorp/pandora/tools/importer-rest-api-specs/internal/components/apidefinitions/parser/parsingcontext"
"github.com/hashicorp/pandora/tools/importer-rest-api-specs/internal/components/apidefinitions/parser/resourceids"
"github.com/hashicorp/pandora/tools/importer-rest-api-specs/internal/logging"
)

func parseOperation(parsingContext *parsingcontext.Context, operation parsedOperation, resourceProvider *string, operationIdsToParsedOperations map[string]resourceids.ParsedOperation) (*sdkModels.SDKOperation, *parserModels.ParseResult, error) {
Expand Down Expand Up @@ -58,7 +59,11 @@ func parseOperation(parsingContext *parsingcontext.Context, operation parsedOper
return nil, nil, err
}
if usesADifferentResourceProvider != nil && *usesADifferentResourceProvider {
return nil, nil, nil
// this check currently disabled as we want to import all resources defined for a service, even when
// the ResourceProvider may be different across those resources. prior to refactoring the importer to use
// Data API SDK types, this check never worked, but now it does, and we don't need it.
logging.Tracef("Skipping default ResourceProvider check for %q (%q)", *resourceId.ResourceIdName, *resourceProvider)
//return nil, nil, nil
}

operationData := sdkModels.SDKOperation{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ package discovery

import (
"fmt"
"github.com/hashicorp/go-azure-helpers/lang/pointer"
"path/filepath"
"sort"
"strings"

"github.com/hashicorp/go-azure-helpers/lang/pointer"
"github.com/hashicorp/pandora/tools/importer-rest-api-specs/internal/logging"
)

Expand Down

0 comments on commit 1da6920

Please sign in to comment.