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

Add support for 20240401 AML resources #4237

Merged
merged 13 commits into from
Oct 2, 2024
Merged

Conversation

super-harsh
Copy link
Collaborator

@super-harsh super-harsh commented Sep 2, 2024

What this PR does / why we need it:

This PR includes latest version of AML resources. Consider this as a starting point to support further AML resources in next iteration.

Special notes for your reviewer:

This PR includes breaking changes for WorkspacesCompute 20210701 API version below:

  • SslConfiguration.Key - marked as secret
  • SslConfiguration.Cert - marked as secret
  • VirtualMachineSshCredentials.PrivateKeyData - marked as secret
  • VirtualMachineSshCredentials.PublicKeyData - marked as secret
  • DatabricksProperties.DatabricksAccessToken - marked as secret

If applicable:

  • this PR contains documentation
  • this PR contains tests
  • this PR contains YAML Samples

@theunrepentantgeek theunrepentantgeek added the breaking A change which likely be breaking label Sep 2, 2024
@@ -2442,6 +2442,7 @@ objectModelConfiguration:
UserAssignedIdentity:
$armReference: false # Actually, this *IS* a resource id, but we want to avoid breaking changes so we're fibbing here
KeyVaultProperties:
$nameInNextVersion: EncryptionKeyVaultProperties
KeyVaultArmId:
$armReference: false # Actually, this *IS* a resource id, but we want to avoid breaking changes so we're fibbing here
Copy link
Member

Choose a reason for hiding this comment

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

Since we're already taking breaking changes here for PrivateKeyData and PublicKeyData, should we fix this up too? @matthchr, what do you think?

Copy link
Member

Choose a reason for hiding this comment

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

I think we should avoid gratuitous breaking change unless there's a security reason behind it (like for the other properties).

For this one, ideally we fix this in a new API version - if we can do that here then yes that would be good to do.

Copy link
Member

@theunrepentantgeek theunrepentantgeek left a comment

Choose a reason for hiding this comment

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

A few things that might need to be configurable - or maybe secrets? Otherwise looks really good.

Copy link
Member

@matthchr matthchr left a comment

Choose a reason for hiding this comment

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

Found some things that look like they might be secret fields?

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

package controllers_test
Copy link
Member

Choose a reason for hiding this comment

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

I think we've been naming these files following the new naming pattern which is _test.go - so in this case machinelearning_workspaces_20240401_test.go.

I don't think changing this file name impacts the test recordings at all so it should be easy to change.

v2/api/machinelearningservices/v1api20240401/structure.txt Outdated Show resolved Hide resolved
v2/api/machinelearningservices/v1api20240401/structure.txt Outdated Show resolved Hide resolved
v2/api/machinelearningservices/v1api20240401/structure.txt Outdated Show resolved Hide resolved
v2/api/machinelearningservices/v1api20240401/structure.txt Outdated Show resolved Hide resolved
v2/api/machinelearningservices/v1api20240401/structure.txt Outdated Show resolved Hide resolved
v2/api/machinelearningservices/v1api20240401/structure.txt Outdated Show resolved Hide resolved
v2/api/machinelearningservices/v1api20240401/structure.txt Outdated Show resolved Hide resolved
│ │ │ │ │ ├── "DenseProd"
│ │ │ │ │ ├── "DevTest"
│ │ │ │ │ └── "FastProd"
│ │ │ │ ├── LoadBalancerSubnetReference: *genruntime.ResourceReference
Copy link
Member

Choose a reason for hiding this comment

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

I think we need a conversion for this, between the old value (which was a string) and the new value (which is a Reference). D owe have one?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point! I didn't add one, doesn't generator handle this case?
If not, since we're taking the breaking change anyway on this resource, should we mark this property as a ResourceReference in the previous version as well or write a custom conversion? WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

My 2c is we should do custom conversion for anything that we can, to reduce the breakages between versions for folks

Copy link
Member

Choose a reason for hiding this comment

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

Agreed. In the past we've handled this by leaving the old version with *string, using *genruntime.ResourceReference in the new version, and hand-crafting the conversion between the two.

This is done by implementing one of the augment* interfaces to customize the conversion.

You can search for existing examples with

$ cd v2/api
$ git grep -in augment -- '*.go' ':(exclude)*_gen.go'

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done!

@super-harsh super-harsh added this pull request to the merge queue Oct 2, 2024
Merged via the queue into main with commit 9703dc5 Oct 2, 2024
8 checks passed
@super-harsh super-harsh deleted the feature/support-latest-aml branch October 2, 2024 04:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking A change which likely be breaking
Projects
Development

Successfully merging this pull request may close these issues.

3 participants