{"action":"closed","issue":{"url":"https://api.github.com/repos/Azure/acs-engine/issues/3369","repository_url":"https://api.github.com/repos/Azure/acs-engine","labels_url":"https://api.github.com/repos/Azure/acs-engine/issues/3369/labels{/name}","comments_url":"https://api.github.com/repos/Azure/acs-engine/issues/3369/comments","events_url":"https://api.github.com/repos/Azure/acs-engine/issues/3369/events","html_url":"https://github.com/Azure/acs-engine/issues/3369","id":335786527,"node_id":"MDU6SXNzdWUzMzU3ODY1Mjc=","number":3369,"title":"Command line arguments not properly handled - equal signs truncated","user":{"login":"raycrawford","id":8979818,"node_id":"MDQ6VXNlcjg5Nzk4MTg=","avatar_url":"https://avatars1.githubusercontent.com/u/8979818?v=4","gravatar_id":"","url":"https://api.github.com/users/raycrawford","html_url":"https://github.com/raycrawford","followers_url":"https://api.github.com/users/raycrawford/followers","following_url":"https://api.github.com/users/raycrawford/following{/other_user}","gists_url":"https://api.github.com/users/raycrawford/gists{/gist_id}","starred_url":"https://api.github.com/users/raycrawford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raycrawford/subscriptions","organizations_url":"https://api.github.com/users/raycrawford/orgs","repos_url":"https://api.github.com/users/raycrawford/repos","events_url":"https://api.github.com/users/raycrawford/events{/privacy}","received_events_url":"https://api.github.com/users/raycrawford/received_events","type":"User","site_admin":false},"labels":[{"id":616225832,"node_id":"MDU6TGFiZWw2MTYyMjU4MzI=","url":"https://api.github.com/repos/Azure/acs-engine/labels/in%20progress","name":"in progress","color":"b8ddf9","default":false}],"state":"closed","locked":false,"assignee":{"login":"jcorioland","id":4435138,"node_id":"MDQ6VXNlcjQ0MzUxMzg=","avatar_url":"https://avatars1.githubusercontent.com/u/4435138?v=4","gravatar_id":"","url":"https://api.github.com/users/jcorioland","html_url":"https://github.com/jcorioland","followers_url":"https://api.github.com/users/jcorioland/followers","following_url":"https://api.github.com/users/jcorioland/following{/other_user}","gists_url":"https://api.github.com/users/jcorioland/gists{/gist_id}","starred_url":"https://api.github.com/users/jcorioland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcorioland/subscriptions","organizations_url":"https://api.github.com/users/jcorioland/orgs","repos_url":"https://api.github.com/users/jcorioland/repos","events_url":"https://api.github.com/users/jcorioland/events{/privacy}","received_events_url":"https://api.github.com/users/jcorioland/received_events","type":"User","site_admin":false},"assignees":[{"login":"jcorioland","id":4435138,"node_id":"MDQ6VXNlcjQ0MzUxMzg=","avatar_url":"https://avatars1.githubusercontent.com/u/4435138?v=4","gravatar_id":"","url":"https://api.github.com/users/jcorioland","html_url":"https://github.com/jcorioland","followers_url":"https://api.github.com/users/jcorioland/followers","following_url":"https://api.github.com/users/jcorioland/following{/other_user}","gists_url":"https://api.github.com/users/jcorioland/gists{/gist_id}","starred_url":"https://api.github.com/users/jcorioland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcorioland/subscriptions","organizations_url":"https://api.github.com/users/jcorioland/orgs","repos_url":"https://api.github.com/users/jcorioland/repos","events_url":"https://api.github.com/users/jcorioland/events{/privacy}","received_events_url":"https://api.github.com/users/jcorioland/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2018-06-26T12:02:19Z","updated_at":"2018-08-20T21:33:25Z","closed_at":"2018-08-20T21:33:25Z","author_association":"NONE","body":"**Is this a request for help?**: NO\r\n\r\n**Is this an ISSUE or FEATURE REQUEST?** ISSUE\r\n\r\n**What version of acs-engine?**: 0.17.1 => 0.18.9 (both specifically tested)\r\n\r\n**Orchestrator and version (e.g. Kubernetes, DC/OS, Swarm)**\r\nACS-Engine 0.18.9 with Kubernetes\r\n\r\n**What happened**:\r\nSecrets were removed from the API file and passed from command line; extract example below:\r\n```\r\n      \"servicePrincipalProfile\": {\r\n        \"clientId\": \"\",\r\n        \"secret\": \"\"   \r\n      }\r\n    }\r\n````\r\n```\r\nacs-engine generate --output-directory \"./_output/rack8s\" --set servicePrincipalProfile.clientId='123a4321-c6eb-4b61-9d6f-7db123e14a7a',servicePrincipalProfile.secret='#msRock5!t=' ./clusterBuild-ACS_config-cardk8s.json\r\n```\r\n\r\nWhen this was done, the servicePrincipalClientSecret value in the generated azuredeploy.parameters.json has the '=' truncated out of it, failing without error.  If the value has a leading '=', the following exception is thrown:\r\n```\r\nINFO[0000] Error returned by LoadContainerService: json: cannot unmarshal number into Go struct field ServicePrincipalProfile.secret of type string\r\nFATA[0000] error loading API model in generateCmd: error parsing the api model: json: cannot unmarshal number into Go struct field ServicePrincipalProfile.secret of type string\r\n```\r\n\r\nIf, on the other hand, the same values are placed in the API config JSON (with or without a leading '='), the correct value shows up in the ARM template parameters file.\r\n\r\n**What you expected to happen**:\r\nI expected the command line parameters and those used in the API JSON to behave in the same manner.\r\n\r\n**How to reproduce it** (as minimally and precisely as possible):\r\nExample API JSON:\r\n```\r\n{\r\n    \"apiVersion\": \"vlabs\",\r\n    \"properties\": {\r\n      \"orchestratorProfile\": {\r\n        \"orchestratorType\": \"Kubernetes\",\r\n        \"orchestratorRelease\": \"1.10\",\r\n          \"kubernetesConfig\": {\r\n            \"networkPlugin\": \"kubenet\",\r\n            \"networkPolicy\": \"calico\",\r\n            \"privateCluster\": {\r\n\t\t\t  \"enabled\": true          \r\n\t\t\t},\r\n            \"enableRbac\": true,\r\n            \"maxPods\": 80,\r\n            \"addons\": [\r\n              {\r\n                \"name\": \"tiller\",\r\n                \"enabled\": false\r\n              },\r\n              {\r\n                \"name\": \"kubernetes-dashboard\",\r\n                \"enabled\": false\r\n              }\r\n            ]\r\n          }\r\n        },\r\n      \"masterProfile\": {\r\n        \"count\": 1,\r\n        \"dnsPrefix\": \"rack8s\",\r\n        \"vmSize\": \"Standard_D2_v2\",\r\n        \"osDiskSizeGB\": 200,\r\n        \"vnetSubnetId\": \"/subscriptions/123412341234/resourceGroups/cardinalsolutionsgroup-network/providers/Microsoft.Network/virtualNetworks/k8s-vnet/subnets/k8s-subnet\",\r\n        \"firstConsecutiveStaticIP\": \"10.1.0.100\",\r\n        \"vnetCidr\": \"10.1.0.0/16\"    \r\n      },\r\n      \"agentPoolProfiles\": [\r\n        {\r\n          \"name\": \"linuxpool1\",\r\n          \"count\": 2,\r\n          \"vmSize\": \"Standard_D2_v2\",\r\n          \"availabilityProfile\": \"AvailabilitySet\",\r\n          \"osDiskSizeGB\": 200,\r\n          \"vnetSubnetId\": \"/subscriptions/123412341234/resourceGroups/jbh-network/providers/Microsoft.Network/virtualNetworks/k8s-vnet/subnets/k8s-subnet\"\r\n        }\r\n      ],\r\n      \"linuxProfile\": {\r\n        \"adminUsername\": \"\",\r\n        \"ssh\": {\r\n          \"publicKeys\": [\r\n            {\r\n              \"keyData\": \"\"\r\n            }\r\n          ]\r\n        }\r\n      },\r\n      \"servicePrincipalProfile\": {\r\n        \"clientId\": \"\",\r\n        \"secret\": \"\"   \r\n      }\r\n    }\r\n  }\r\n```\r\nExample command line input:\r\n```\r\n acs-engine generate --output-directory \"./_output/rack8s\" --set servicePrincipalProfile.clientId='123a1238-c6eb-4b61-9d6f-7db6f1e14123',servicePrincipalProfile.secret='=MsR0ck5!t=',aadProfile.serverAppID='123a1238-c6eb-4b61-9d6f-7db6f1e14123',aadProfile.clientAppID='123a1238-c6eb-4b61-9d6f-7db6f1e14123',aadProfile.tenantID='123a1238-c6eb-4b61-9d6f-7db6f1e14123',linuxProfile.adminUsername='cardinal',linuxProfile.ssh.publicKeys[0].keyData='ssh-rsa AAAAB3N123412341234123412341234123412341213412341234rElF9/uV2/+S6itZ' ./clusterBuild-ACS_config-cardk8s.json \r\n```\r\nWhen the above command is run, it bombs on unmarshalling (due to the leading '=').  If the leading '=' is removed, the resulting servicePrincipalClientSecret will be `MsR0ck5!t` not `MsR0ck5!t=` as expected.  If these values are removed from the command line and placed in the API JSON, both `=MsR0ck5!t=` and `MsR0ck5!t=` work as expected.\r\n\r\n**Anything else we need to know**: This is relevant because service principal secrets, as generated by the Azure Portal, often have trailing '=' signs.\r\n\r\n"}}
{"actor":{"display_login":"CecileRobertMichon"}}