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

Migrate CustomLocation from generation to main #24889

Merged
merged 4 commits into from
May 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/CustomLocation/CustomLocation.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ input-file:
module-version: 0.1.0
title: CustomLocation
subject-prefix: $(service-name)
disable-transform-identity-type: true
flatten-userassignedidentity: false

identity-correction-for-post: true

Expand All @@ -62,7 +60,6 @@ directive:
}
}
}

- from: swagger-document
where: $.definitions.customLocationProperties.properties.provisioningState
transform: >-
Expand All @@ -88,8 +85,16 @@ directive:
where: $
transform: return $.replace(/\{resourceName\}\/enabledResourceTypes/g, "{resourceName}/enabledresourcetypes")

- from: swagger-document
where: $.definitions.customLocation
transform: $['required'] = ['properties']

- from: swagger-document
where: $.definitions.customLocationProperties
transform: $['required'] = ['clusterExtensionIds', 'hostResourceId', 'namespace']

- where:
variant: ^(Create|Update).*(?<!Expanded|JsonFilePath|JsonString)$
variant: ^(Create|Update)(?!.*?(Expanded|JsonFilePath|JsonString))
remove: true
- where:
subject: CustomLocation
Expand All @@ -115,11 +120,6 @@ directive:
subject: CustomLocationOperation
hide: true

- where:
verb: New|Update
subject: CustomLocation
hide: true

- where:
subject: ^CustomLocation$|^CustomLocationEnabledResourceType$
parameter-name: ResourceName
Expand Down
12 changes: 11 additions & 1 deletion src/CustomLocation/CustomLocation.Autorest/build-module.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
# is regenerated.
# ----------------------------------------------------------------------------------
param([switch]$NotIsolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [switch]$UX)
param([switch]$NotIsolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [switch]$UX, [Switch]$DisableAfterBuildTasks)
$ErrorActionPreference = 'Stop'

if($PSEdition -ne 'Core') {
Expand Down Expand Up @@ -177,4 +177,14 @@ if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1'))
. (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')
}

if (-not $DisableAfterBuildTasks){
$afterBuildTasksPath = Join-Path $PSScriptRoot ''
$afterBuildTasksArgs = ConvertFrom-Json 'true' -AsHashtable
if(Test-Path -Path $afterBuildTasksPath -PathType leaf){
Write-Host -ForegroundColor Green 'Running after build tasks...'
. $afterBuildTasksPath @afterBuildTasksArgs
}
}


Write-Host -ForegroundColor Green '-------------Done-------------'

This file was deleted.

Loading