Skip to content

Commit f3d3dfe

Browse files
Copilotmatthchr
andauthored
Bump Microsoft.ContainerService/managedclusters to 2025-08-01 API version (#4951)
* Add AKS 2025-08-01 API version * Handle renames when creating compatibility types * Add tests * Add samples * Add conversion helpers * Fix tests --------- Co-authored-by: Matthew Christopher <[email protected]>
1 parent cbefb93 commit f3d3dfe

File tree

184 files changed

+105556
-144219
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+105556
-144219
lines changed

docs/hugo/content/design/ADR-2023-09-Skipping-Properties/_index.md

Lines changed: 49 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ Consider a CRM system containing details of people. In v3 of the system, we capt
2424

2525
<img src="./conversion-v3-v4-class.png" alt="Conversion from v3 to v4" />
2626

27-
28-
2927
When we convert from v3 to v4 (v3 -> v4) the `ResidentialAddress` property gets serialized into the `PropertyBag` on the v4 Person. Note that the bag contains a v3 `Address` in a serialized form.
3028

3129
To illustrate, consider this concrete example:
@@ -83,7 +81,7 @@ In v5, the `ResidentialAddress` is reintroduced, but with a different shape. Ins
8381

8482
<img src="./conversion-v4-v5-class.png" alt="Conversion from v4 to v5" />
8583

86-
When we convert from v5 to v4, again the `ResidentialAddress` property gets serialized into the `PropertyBag` on the v4 Person.
84+
When we convert from v5 to v4, again the `ResidentialAddress` property gets serialized into the `PropertyBag` on the v4 Person.
8785

8886
Again, it's useful to see a concrete example:
8987

@@ -116,7 +114,7 @@ Conversion back and forward between versions v4 and v5 works fine.
116114

117115
### The Problem
118116

119-
Observe how we can end up with two different variants of v4 `Person`.
117+
Observe how we can end up with two different variants of v4 `Person`.
120118

121119
In one case, we have a v4 `Person` where the property bag contains a v3 `Address`.
122120
In the other case, we have a v4 `Person` the property bag contains a v5 `Address`:
@@ -147,8 +145,7 @@ While round trips between _adjacent_ versions work fine, we run into problems wh
147145

148146
<img src="./conversion-v3-v4-v5-class.png" alt="Conversion from v3 to v4 to v5" />
149147

150-
151-
Compare the two different kinds of v4 Person we end up with for Mickey.
148+
Compare the two different kinds of v4 Person we end up with for Mickey.
152149

153150
First when we start from v3:
154151

@@ -170,15 +167,15 @@ propertyBag:
170167
residentialAddress: "street:1313 S. Harbor Blvd;suburb:;city:Anaheim, CA 92803;country:USA"
171168
```
172169

173-
If we have a v4 `Person` that contains a v3 `Address` in the property bag, conversion to the v5 `Person` will fail when we try to deserialize a v5 `Address` from the v3 item.
170+
If we have a v4 `Person` that contains a v3 `Address` in the property bag, conversion to the v5 `Person` will fail when we try to deserialize a v5 `Address` from the v3 item.
174171

175-
This will cause the operator to fail at runtime.
172+
This will cause the operator to fail at runtime.
176173

177174
Similarly f we end up with a v4 `Person` that contains a v5 `Address` in the property bag, we can't deserialize a v3 `Address` and again the operator will fail at runtime.
178175

179176
### Constraint: Serialization format
180177

181-
For each resource type, there's a specific hub version that's used for serialization - this is the version that's persisted within a cluster. All other versions are created on-the-fly by conversion from the hub version. By convention in ASO, this hub version is based on the the latest stable version of the resource, or the latest preview version if no stable version is available.
178+
For each resource type, there's a specific hub version that's used for serialization - this is the version that's persisted within a cluster. All other versions are created on-the-fly by conversion from the hub version. By convention in ASO, this hub version is based on the the latest stable version of the resource, or the latest preview version if no stable version is available.
182179

183180
In most cases, the hub version will be the version affected by changes to solve the skipping-property problem, so we have to assume that there are extant resources of that version.
184181

@@ -217,11 +214,13 @@ In our example here, we would add a new `ResidentialAddress` property to the v4
217214
The shape of `Address` when reintroduced will always match the shape of `Address` when removed, so we can always serialize the same shape in-to or out-of the property bag, ensuring any `Address` has the a consistent shape.
218215

219216
Pros:
217+
220218
* Works the way existing conversions do.
221219
* We have an existing contract for augmenting conversions with custom code, allowing us to handcode the conversion between v4 and v5 to handle the mismatch in the shapes of `Address`.
222220
* Addresses the central inconsistency problem, ensuring we always serialize the same shape into intermediate property bags
223221

224222
Cons:
223+
225224
* Changes the serialization format for existing v4 resources. This is a breaking change for existing resources.
226225
* Changes the object model of released resources, a breaking change for code consumers of ASO `api` packages.
227226
* When there are multi-generational skips, other questions arise: Do we introduce the new type into every intermediate version, only the last, or both first and last? Each approach has advantages and drawbacks.
@@ -280,7 +279,6 @@ We're already generating support to allow augmentation of the generated conversi
280279

281280
It's highly desirable that we leverage this existing functionality for skipping properties, rather than building something new.
282281

283-
284282
### Proposed Solution
285283

286284
Given that any existing resources will have property bags containing instances in the earlier shape, standardize on using that shape - and only that shape - when storing the instance in the property bag.
@@ -307,7 +305,7 @@ if source.ResidentialAddress != nil {
307305
} else {
308306
propertyBag.Remove("ResidentialAddress")
309307
}
310-
```
308+
```
311309

312310
Reading the value from the property bag will also need to change. Instead of:
313311

@@ -325,6 +323,7 @@ if propertyBag.Contains("ResidentialAddress") {
325323
destination.ResidentialAddress = nil
326324
}
327325
```
326+
328327
We will read the earlier shape and convert it as required.
329328

330329
```go
@@ -371,8 +370,8 @@ To avoid problems with circular dependencies (as noted above), we will clone the
371370

372371
Our existing conversion framework supports writing hand-crafted conversions between shapes, migrating data between the two shapes. By introducing a new type and leveraging the existing framework for the conversion, we gain support for writing these hand-crafted conversions between shapes.
373372

374-
375373
Pros:
374+
376375
* Addresses the central inconsistency problem, ensuring we always serialize the same shape into intermediate property bags
377376
* Conversions are still driven by the earlier version, avoiding any issues with circular dependencies or needing to move conversion code elsewhere (e.g. to the later version).
378377
* Isolates the compatibility type in a dedicated subpackage, where it won't inadvertently be picked up by documentation tools or other code consumers. (If this is not important, we can instead target the main v4 package.)
@@ -381,9 +380,9 @@ Pros:
381380
* Serialization format of v4 remains unchanged, ensuring compatibility with existing releases of ASO.
382381

383382
Cons:
384-
* Requires modification of the conversion-graph, which to this point has been immutable once constructed (we can't delay construction until after we inject the compatibility package as we need it to identify skipping properties).
385-
* When code generating for property conversions using a property bag, we'll need to detect and use the `compat` subpackage.
386383

384+
* Requires modification of the conversion-graph, which to this point has been immutable once constructed (we can't delay construction until after we inject the compatibility package as we need it to identify skipping properties).
385+
* When code generating for property conversions using a property bag, we'll need to detect and use the `compat` subpackage.
387386

388387
## Decision
389388

@@ -399,9 +398,43 @@ TBC
399398

400399
## Experience Report
401400

402-
TBC
401+
As implemented by [PR#3614](https://github.com/Azure/azure-service-operator/pull/3614), we can successfully handle most situations without requiring any manual intervention.
402+
403+
There's an edge case, however, when the _type_ of the property changes between removal and reintroduction, as discovered with `containerservice.ManagedCluster`.
404+
405+
The property `ManagedClusterAgentPoolProfile.GPUProfile` had the type `AgentPoolGPUProfile` in version `2024-04-02-preview`, but when it was reintroduced in `2025-08-01`, the type had been renamed to `GPUProfile`.
406+
407+
This resulted in testing failures when the shape persisted in the property bag was inconsistent between directions, as predicted above.
408+
409+
```
410+
Round trip from ManagedClustersAgentPool to hub returns original: Falsified after 1 passed tests.
411+
Labels of failing property:
412+
converting from destination to hub:
413+
converting from destination to hub:
414+
converting from destination to hub:
415+
calling AssignProperties_To_ManagedClustersAgentPool_Spec() to populate field Spec:
416+
pulling'GpuProfile' from propertyBag:
417+
pulling "GpuProfile" from PropertyBag: json:
418+
unknown field "installGPUDriver"
419+
```
420+
421+
Automatic repair of the skipping property failed in this case because the code was unaware that the type had been renamed from `AgentPoolGPUProfile` to `GPUProfile`.
422+
423+
A code fix has been implemented, but requires additional configuration to activate if this edge case recurs, as follows:
424+
425+
On the version where the property is last seen, add `$nameInNextVersion: NewName` to the objectModelConfiguration section for each property type that's been renamed. Remember to do both the spec and status variants if applicable.
426+
427+
```yaml
428+
containerservice:
429+
...
430+
2024-04-02-preview:
431+
AgentPoolGPUProfile:
432+
$nameInNextVersion: GPUProfile
433+
AgentPoolGPUProfile_STATUS:
434+
$nameInNextVersion: GPUProfile_STATUS
435+
...
436+
```
403437

404438
## References
405439

406440
TBC
407-
``

docs/hugo/content/reference/_index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,10 @@ Development of these new resources is complete and they will be available in the
322322
| [FleetsMember]({{< relref "/reference/containerservice/v1api20250301#FleetsMember" >}}) | 2025-03-01 | v1api20250301 | v2.16.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/containerservice/v1api20250301/v1api20250301_fleetsmember.yaml) |
323323
| [FleetsUpdateRun]({{< relref "/reference/containerservice/v1api20250301#FleetsUpdateRun" >}}) | 2025-03-01 | v1api20250301 | v2.16.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/containerservice/v1api20250301/v1api20250301_fleetsupdaterun.yaml) |
324324
| [FleetsUpdateStrategy]({{< relref "/reference/containerservice/v1api20250301#FleetsUpdateStrategy" >}}) | 2025-03-01 | v1api20250301 | v2.16.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/containerservice/v1api20250301/v1api20250301_fleetsupdatestrategy.yaml) |
325+
| MaintenanceConfiguration | 2025-08-01 | v1api20250801 | v2.16.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/containerservice/v1api20250801/v1api20250801_maintenanceconfiguration.yaml) |
326+
| ManagedCluster | 2025-08-01 | v1api20250801 | v2.16.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/containerservice/v1api20250801/v1api20250801_managedcluster.yaml) |
327+
| ManagedClustersAgentPool | 2025-08-01 | v1api20250801 | v2.16.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/containerservice/v1api20250801/v1api20250801_managedclustersagentpool.yaml) |
328+
| TrustedAccessRoleBinding | 2025-08-01 | v1api20250801 | v2.16.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/containerservice/v1api20250801/v1api20250801_trustedaccessrolebinding.yaml) |
325329

326330
### Latest Released Versions
327331

@@ -342,15 +346,11 @@ These are older versions of resources still available for use in the current rel
342346
| Resource | ARM Version | CRD Version | Supported From | Sample |
343347
|------------------------------------------------------------------------------------------------------------------------|--------------------|----------------------|----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
344348
| [ManagedCluster]({{< relref "/reference/containerservice/v1api20240402preview#ManagedCluster" >}}) | 2024-04-02-preview | v1api20240402preview | v2.8.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/containerservice/v1api20240402preview/v1api20240402preview_managedcluster.yaml) |
345-
| [ManagedCluster]({{< relref "/reference/containerservice/v1api20231102preview#ManagedCluster" >}}) | 2023-11-02-preview | v1api20231102preview | v2.6.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/containerservice/v1api20231102preview/v1api20231102preview_managedcluster.yaml) |
346349
| [ManagedCluster]({{< relref "/reference/containerservice/v1api20231001#ManagedCluster" >}}) | 2023-10-01 | v1api20231001 | v2.5.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/containerservice/v1api20231001/v1api20231001_managedcluster.yaml) |
347350
| [ManagedCluster]({{< relref "/reference/containerservice/v1api20230201#ManagedCluster" >}}) | 2023-02-01 | v1api20230201 | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/containerservice/v1api20230201/v1api20230201_managedcluster.yaml) |
348-
| [ManagedCluster]({{< relref "/reference/containerservice/v1api20210501#ManagedCluster" >}}) | 2021-05-01 | v1api20210501 | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/containerservice/v1api20210501/v1api20210501_managedcluster.yaml) |
349351
| [ManagedClustersAgentPool]({{< relref "/reference/containerservice/v1api20240402preview#ManagedClustersAgentPool" >}}) | 2024-04-02-preview | v1api20240402preview | v2.8.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/containerservice/v1api20240402preview/v1api20240402preview_managedclustersagentpool.yaml) |
350-
| [ManagedClustersAgentPool]({{< relref "/reference/containerservice/v1api20231102preview#ManagedClustersAgentPool" >}}) | 2023-11-02-preview | v1api20231102preview | v2.6.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/containerservice/v1api20231102preview/v1api20231102preview_managedclustersagentpool.yaml) |
351352
| [ManagedClustersAgentPool]({{< relref "/reference/containerservice/v1api20231001#ManagedClustersAgentPool" >}}) | 2023-10-01 | v1api20231001 | v2.5.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/containerservice/v1api20231001/v1api20231001_managedclustersagentpool.yaml) |
352353
| [ManagedClustersAgentPool]({{< relref "/reference/containerservice/v1api20230201#ManagedClustersAgentPool" >}}) | 2023-02-01 | v1api20230201 | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/containerservice/v1api20230201/v1api20230201_managedclustersagentpool.yaml) |
353-
| [ManagedClustersAgentPool]({{< relref "/reference/containerservice/v1api20210501#ManagedClustersAgentPool" >}}) | 2021-05-01 | v1api20210501 | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/containerservice/v1api20210501/v1api20210501_managedclustersagentpool.yaml) |
354354
| [TrustedAccessRoleBinding]({{< relref "/reference/containerservice/v1api20240402preview#TrustedAccessRoleBinding" >}}) | 2024-04-02-preview | v1api20240402preview | v2.8.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/containerservice/v1api20240402preview/v1api20240402preview_trustedaccessrolebinding.yaml) |
355355
| [TrustedAccessRoleBinding]({{< relref "/reference/containerservice/v1api20231001#TrustedAccessRoleBinding" >}}) | 2023-10-01 | v1api20231001 | v2.8.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/containerservice/v1api20231001/v1api20231001_trustedaccessrolebinding.yaml) |
356356

0 commit comments

Comments
 (0)