Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: removing params from GetServer #237

Merged
merged 1 commit into from
Sep 24, 2019
Merged

Fix: removing params from GetServer #237

merged 1 commit into from
Sep 24, 2019

Conversation

melonrush13
Copy link
Contributor

What this PR does / why we need it:
Fixing error controllers/sqlserver_controller.go:58:15: undefined: instance controllers/sqlserver_controller.go:109:55: too many arguments in call to sdkClient.CheckNameAvailability

Switching (string) to ()

Special notes for your reviewer:

If applicable:

  • this PR contains documentation
  • this PR contains tests

Copy link
Contributor

@frodopwns frodopwns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgttm

@melonrush13 melonrush13 merged commit 8e21778 into Azure:azure-sql Sep 24, 2019
Porges added a commit that referenced this pull request May 11, 2021
We need to transform the resources to include the “base types” that are added in the deployment template. This is hard to do when the handlers for `allOf` and `oneOf` do type mangling inside the JSON type extractor. So, create `AllOfType` and `OneOfType` to preserve these types until later and then “lower” them to `ObjectType` later in the pipeline.

Next, greatly improve the way that `allOf` handling works by expanding the cases it works for. This is all under `intersectTypes` in the new pipeline file.

This will fix #211.

Changes made (in vaguely “pipeline order”):
1. Add an alternate entrypoint to `jsonast` (`GenerateDefinitionsFromDeploymentTemplate`) which knows specifically how to handle the deployment template schema and extract the resource types with their associated “base” types.
1. Promote `oneOf`/`allOf` to `Type`, and preserve them until later in the pipeline where they are converted to `ObjectType`.
    - `oneOf`/`allOf` have smart constructors which try to simplify the types a little (but not too much, they are handled fully later on)
1. Treat more things as resources in `jsonast`:
    1. Definitions in `unknown_resourceDefinitions` as well as `resourceDefinitions` (EventGrid has resources here)
    1. Any of the `*resourcebase*` types. This is needed to inherit “resourceness” for child resources (and maybe other embedded resources?)
       - This still feels a bit hacky, It was the simplest way to get child resources to be treated as resources but then the `*resourcebase*` “resources” need to be stripped out later. Any better ideas?
1. Add a pass to “lower” `anyOf`/`allOf` to `ObjectType` (`convertAllOfAndOneOfToObjects`). This handles many more cases for `allOf` to convert input schema to types that make more sense. We have good test coverage of this now.
1. Add a pass to “flatten” resources, which will take resources that have resources as spec/status and flatten that into a single resource. This is caused by some child resources and due to the new `resourcebase` modifications mentioned above. 

Extra:
1. Fix some output generation where types from other packages need qualification in ARM to/from conversions.
1. All `Type`s now implement `Stringer` to print something simple for debugging/logging purposes.
1. Remove struct-type check from resource factory function as the spec is no longer expected to be a struct (can be `oneOf`/`allOf`).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants