From ab6e7fbe44a6f65c6a71e48a8428b430b3a233e3 Mon Sep 17 00:00:00 2001 From: Nan Jiang Date: Thu, 29 Sep 2022 17:17:10 +0800 Subject: [PATCH 1/4] add default value to containerAPP model --- .../stable/2022-03-01/ContainerApps.json | 11 ++++++++--- .../stable/2022-03-01/DaprComponents.json | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/specification/app/resource-manager/Microsoft.App/stable/2022-03-01/ContainerApps.json b/specification/app/resource-manager/Microsoft.App/stable/2022-03-01/ContainerApps.json index 420a8777c640..b6ba187c5de6 100644 --- a/specification/app/resource-manager/Microsoft.App/stable/2022-03-01/ContainerApps.json +++ b/specification/app/resource-manager/Microsoft.App/stable/2022-03-01/ContainerApps.json @@ -432,6 +432,7 @@ "Single" ], "type": "string", + "default": "Single", "x-ms-enum": { "name": "ActiveRevisionsMode", "modelAsString": true @@ -561,7 +562,8 @@ "properties": { "enabled": { "description": "Boolean indicating if the Dapr side car is enabled", - "type": "boolean" + "type": "boolean", + "default": false }, "appId": { "description": "Dapr application identifier", @@ -574,6 +576,7 @@ "grpc" ], "type": "string", + "default": "http", "x-ms-enum": { "name": "appProtocol", "modelAsString": true @@ -616,7 +619,8 @@ "x-ms-enum": { "name": "IngressTransportMethod", "modelAsString": true - } + }, + "default": "auto" }, "traffic": { "description": "Traffic weights for app's revisions", @@ -640,7 +644,8 @@ }, "allowInsecure": { "description": "Bool indicating if HTTP connections to is allowed. If set to false HTTP connections are automatically redirected to HTTPS connections", - "type": "boolean" + "type": "boolean", + "default": "false" } } }, diff --git a/specification/app/resource-manager/Microsoft.App/stable/2022-03-01/DaprComponents.json b/specification/app/resource-manager/Microsoft.App/stable/2022-03-01/DaprComponents.json index ecf44dc771a9..fb9692f27b01 100644 --- a/specification/app/resource-manager/Microsoft.App/stable/2022-03-01/DaprComponents.json +++ b/specification/app/resource-manager/Microsoft.App/stable/2022-03-01/DaprComponents.json @@ -331,6 +331,7 @@ }, "ignoreErrors": { "description": "Boolean describing if the component errors are ignores", + "default": false, "type": "boolean" }, "initTimeout": { From e60d790c29a75093c771cf57951a6a4d9e991915 Mon Sep 17 00:00:00 2001 From: Nan Jiang Date: Thu, 29 Sep 2022 19:58:21 +0800 Subject: [PATCH 2/4] add default value for 2022-06-01-preview --- .../2022-06-01-preview/CommonDefinitions.json | 3 ++- .../preview/2022-06-01-preview/ContainerApps.json | 15 ++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/CommonDefinitions.json b/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/CommonDefinitions.json index e5578818b9d3..5e49b6bfb127 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/CommonDefinitions.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/CommonDefinitions.json @@ -686,7 +686,8 @@ }, "ignoreErrors": { "description": "Boolean describing if the component errors are ignores", - "type": "boolean" + "type": "boolean", + "default": false }, "initTimeout": { "description": "Initialization timeout", diff --git a/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/ContainerApps.json b/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/ContainerApps.json index 37aa8de2cfde..9f2560edcd60 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/ContainerApps.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/ContainerApps.json @@ -485,7 +485,8 @@ "x-ms-enum": { "name": "ActiveRevisionsMode", "modelAsString": true - } + }, + "default": "Single" }, "ingress": { "$ref": "#/definitions/Ingress", @@ -636,7 +637,8 @@ "properties": { "enabled": { "description": "Boolean indicating if the Dapr side car is enabled", - "type": "boolean" + "type": "boolean", + "default": false }, "appId": { "description": "Dapr application identifier", @@ -652,7 +654,8 @@ "x-ms-enum": { "name": "appProtocol", "modelAsString": true - } + }, + "default": "http" }, "appPort": { "format": "int32", @@ -725,7 +728,8 @@ "x-ms-enum": { "name": "IngressTransportMethod", "modelAsString": true - } + }, + "default": "auto" }, "traffic": { "description": "Traffic weights for app's revisions", @@ -749,7 +753,8 @@ }, "allowInsecure": { "description": "Bool indicating if HTTP connections to is allowed. If set to false HTTP connections are automatically redirected to HTTPS connections", - "type": "boolean" + "type": "boolean", + "default": "false" }, "ipSecurityRestrictions": { "description": "Rules to restrict incoming IP address.", From 93f24556c062cdeacb573468a9f1ab61e70a012a Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Mon, 10 Oct 2022 09:54:19 +0800 Subject: [PATCH 3/4] python fix --- .../app/resource-manager/readme.python.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/specification/app/resource-manager/readme.python.md b/specification/app/resource-manager/readme.python.md index 5b0cd54ef5a0..13d736085ec9 100644 --- a/specification/app/resource-manager/readme.python.md +++ b/specification/app/resource-manager/readme.python.md @@ -16,3 +16,22 @@ clear-output-folder: true no-namespace-folders: true output-folder: $(python-sdks-folder)/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers ``` + +``` yaml $(python) +directive: + - from: CommonDefinitions.json + where: $.definitions.DaprComponent.properties.ignoreErrors + transform: $['default'] = 'False' + + - from: ContainerApps.json + where: $.definitions.Dapr.properties.enabled + transform: $['default'] = 'False' + + - from: ContainerApps.json + where: $.definitions.Ingress.properties.external + transform: $['default'] = 'False' + + - from: ContainerApps.json + where: $.definitions.TrafficWeight.properties.latestRevision + transform: $['default'] = 'False' +``` \ No newline at end of file From 06266f070bc71dda8c179c0dd02a4a42ffd86c72 Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Mon, 10 Oct 2022 13:30:42 +0800 Subject: [PATCH 4/4] python fix --- specification/app/resource-manager/readme.python.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/specification/app/resource-manager/readme.python.md b/specification/app/resource-manager/readme.python.md index 13d736085ec9..0e3cee2b0602 100644 --- a/specification/app/resource-manager/readme.python.md +++ b/specification/app/resource-manager/readme.python.md @@ -34,4 +34,8 @@ directive: - from: ContainerApps.json where: $.definitions.TrafficWeight.properties.latestRevision transform: $['default'] = 'False' + + - from: ContainerApps.json + where: $.definitions.Ingress.properties.allowInsecure + transform: $['default'] = 'False' ``` \ No newline at end of file