Skip to content

Commit

Permalink
- Refactor login/logout code
Browse files Browse the repository at this point in the history
- Bump up versions for tasks depending on docker-common (Use milestone versioning)
  • Loading branch information
ajinkya599 committed Mar 15, 2019
1 parent 9972b2f commit 7301a9e
Show file tree
Hide file tree
Showing 19 changed files with 180 additions and 143 deletions.
203 changes: 111 additions & 92 deletions Tasks/Common/docker-common/containerconnection.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,6 @@
"loc.messages.CantWriteDataToFile": "Can not write data to the file %s. Error: %s",
"loc.messages.NoDataWrittenOnFile": "No data was written into the file %s",
"loc.messages.FileContentSynced": "Synced the file content to the disk. The content is %s.",
"loc.messages.ImageNameWithoutTag": "Image name not specified with tag, pushing all tags of the image specified."
"loc.messages.ImageNameWithoutTag": "Image name not specified with tag, pushing all tags of the image specified.",
"loc.messages.WritingDockerConfigToTempFile": "Writing Docker config to temp file. File path: %s, Docker config: %s"
}
7 changes: 4 additions & 3 deletions Tasks/DockerComposeV0/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 4,
"Patch": 26
"Minor": 150,
"Patch": 0
},
"demands": [],
"preview": "false",
Expand Down Expand Up @@ -326,6 +326,7 @@
"CantWriteDataToFile": "Can not write data to the file %s. Error: %s",
"NoDataWrittenOnFile": "No data was written into the file %s",
"FileContentSynced": "Synced the file content to the disk. The content is %s.",
"ImageNameWithoutTag": "Image name not specified with tag, pushing all tags of the image specified."
"ImageNameWithoutTag": "Image name not specified with tag, pushing all tags of the image specified.",
"WritingDockerConfigToTempFile": "Writing Docker config to temp file. File path: %s, Docker config: %s"
}
}
7 changes: 4 additions & 3 deletions Tasks/DockerComposeV0/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 4,
"Patch": 26
"Minor": 150,
"Patch": 0
},
"demands": [],
"preview": "false",
Expand Down Expand Up @@ -326,6 +326,7 @@
"CantWriteDataToFile": "ms-resource:loc.messages.CantWriteDataToFile",
"NoDataWrittenOnFile": "ms-resource:loc.messages.NoDataWrittenOnFile",
"FileContentSynced": "ms-resource:loc.messages.FileContentSynced",
"ImageNameWithoutTag": "ms-resource:loc.messages.ImageNameWithoutTag"
"ImageNameWithoutTag": "ms-resource:loc.messages.ImageNameWithoutTag",
"WritingDockerConfigToTempFile": "ms-resource:loc.messages.WritingDockerConfigToTempFile"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,6 @@
"loc.messages.CantWriteDataToFile": "Can not write data to the file %s. Error: %s",
"loc.messages.NoDataWrittenOnFile": "No data was written into the file %s",
"loc.messages.FileContentSynced": "Synced the file content to the disk. The content is %s.",
"loc.messages.OutputVariableDataSizeExceeded": "Output variable not set as Docker command output exceeded the maximum supported length. Output length: %s, Maximum supported length: %s"
"loc.messages.OutputVariableDataSizeExceeded": "Output variable not set as Docker command output exceeded the maximum supported length. Output length: %s, Maximum supported length: %s",
"loc.messages.WritingDockerConfigToTempFile": "Writing Docker config to temp file. File path: %s, Docker config: %s"
}
7 changes: 4 additions & 3 deletions Tasks/DockerV0/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 3,
"Patch": 27
"Minor": 150,
"Patch": 0
},
"demands": [],
"preview": "false",
Expand Down Expand Up @@ -341,6 +341,7 @@
"CantWriteDataToFile": "Can not write data to the file %s. Error: %s",
"NoDataWrittenOnFile": "No data was written into the file %s",
"FileContentSynced": "Synced the file content to the disk. The content is %s.",
"OutputVariableDataSizeExceeded": "Output variable not set as Docker command output exceeded the maximum supported length. Output length: %s, Maximum supported length: %s"
"OutputVariableDataSizeExceeded": "Output variable not set as Docker command output exceeded the maximum supported length. Output length: %s, Maximum supported length: %s",
"WritingDockerConfigToTempFile": "Writing Docker config to temp file. File path: %s, Docker config: %s"
}
}
7 changes: 4 additions & 3 deletions Tasks/DockerV0/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 3,
"Patch": 27
"Minor": 150,
"Patch": 0
},
"demands": [],
"preview": "false",
Expand Down Expand Up @@ -341,6 +341,7 @@
"CantWriteDataToFile": "ms-resource:loc.messages.CantWriteDataToFile",
"NoDataWrittenOnFile": "ms-resource:loc.messages.NoDataWrittenOnFile",
"FileContentSynced": "ms-resource:loc.messages.FileContentSynced",
"OutputVariableDataSizeExceeded": "ms-resource:loc.messages.OutputVariableDataSizeExceeded"
"OutputVariableDataSizeExceeded": "ms-resource:loc.messages.OutputVariableDataSizeExceeded",
"WritingDockerConfigToTempFile": "ms-resource:loc.messages.WritingDockerConfigToTempFile"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,6 @@
"loc.messages.NoDataWrittenOnFile": "No data was written into the file %s",
"loc.messages.FileContentSynced": "Synced the file content to the disk. The content is %s.",
"loc.messages.DockerRegistryNotFound": "Docker registry service connection not specified.",
"loc.messages.OutputVariableDataSizeExceeded": "Output variable not set as Docker command output exceeded the maximum supported length. Output length: %s, Maximum supported length: %s"
"loc.messages.OutputVariableDataSizeExceeded": "Output variable not set as Docker command output exceeded the maximum supported length. Output length: %s, Maximum supported length: %s",
"loc.messages.WritingDockerConfigToTempFile": "Writing Docker config to temp file. File path: %s, Docker config: %s"
}
7 changes: 4 additions & 3 deletions Tasks/DockerV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 1,
"Minor": 1,
"Patch": 31
"Minor": 150,
"Patch": 0
},
"demands": [],
"releaseNotes": "Simplified the task by:<br/>&nbsp;- Providing an option to simply select or type a command.<br/>&nbsp;- Retaining the useful input fields and providing an option to pass the rest as an argument to the command.",
Expand Down Expand Up @@ -374,6 +374,7 @@
"NoDataWrittenOnFile": "No data was written into the file %s",
"FileContentSynced": "Synced the file content to the disk. The content is %s.",
"DockerRegistryNotFound": "Docker registry service connection not specified.",
"OutputVariableDataSizeExceeded": "Output variable not set as Docker command output exceeded the maximum supported length. Output length: %s, Maximum supported length: %s"
"OutputVariableDataSizeExceeded": "Output variable not set as Docker command output exceeded the maximum supported length. Output length: %s, Maximum supported length: %s",
"WritingDockerConfigToTempFile": "Writing Docker config to temp file. File path: %s, Docker config: %s"
}
}
7 changes: 4 additions & 3 deletions Tasks/DockerV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 1,
"Minor": 1,
"Patch": 31
"Minor": 150,
"Patch": 0
},
"demands": [],
"releaseNotes": "ms-resource:loc.releaseNotes",
Expand Down Expand Up @@ -374,6 +374,7 @@
"NoDataWrittenOnFile": "ms-resource:loc.messages.NoDataWrittenOnFile",
"FileContentSynced": "ms-resource:loc.messages.FileContentSynced",
"DockerRegistryNotFound": "ms-resource:loc.messages.DockerRegistryNotFound",
"OutputVariableDataSizeExceeded": "ms-resource:loc.messages.OutputVariableDataSizeExceeded"
"OutputVariableDataSizeExceeded": "ms-resource:loc.messages.OutputVariableDataSizeExceeded",
"WritingDockerConfigToTempFile": "ms-resource:loc.messages.WritingDockerConfigToTempFile"
}
}
15 changes: 8 additions & 7 deletions Tasks/DockerV2/Strings/resources.resjson/en-US/resources.resjson
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,30 @@
"loc.input.help.tags": "A list of tags in separate lines. These tags are used in build, push and buildAndPush commands. Ex:<br><br>beta1.1<br>latest",
"loc.input.label.arguments": "Arguments",
"loc.input.help.arguments": "Docker command options. Ex:<br> For build command,<br>--build-arg HTTP_PROXY=http://10.20.30.2:1234 --quiet",
"loc.messages.AddingAuthDataToDockerConfig": "Adding auth data for registry to Docker config file. Registry: %s, Docker config: %s",
"loc.messages.AddingNewAuthToExistingConfig": "Adding auth data for registry to Docker config file. Registry: %s.",
"loc.messages.ArgumentsNotSupportedWithBuildAndPush": "The input arguments is not supported when the command is buildAndPush",
"loc.messages.ContainerPatternFound": "Pattern found in Docker filepath parameter",
"loc.messages.ContainerPatternNotFound": "No pattern found in Docker filepath parameter",
"loc.messages.ContainerDockerFileNotFound": "No Dockerfile matching %s was found.",
"loc.messages.CantWriteDataToFile": "Can not write data to the file %s. Error: %s",
"loc.messages.CouldNotFindDockerConfig": "Could not find Docker Config. Either DOCKER_CONFIG variable is not set, or the config file is outside the temp directory, or the file does not exist. Docker config directory: %s, Docker config path: %s",
"loc.messages.CouldNotFindDockerConfig": "Could not find Docker Config. Either DOCKER_CONFIG variable is not set, or the config file is outside the temp directory, or the file does not exist. DOCKER_CONFIG: %s",
"loc.messages.DeletingDockerConfigDirectory": "Deleting Docker config directory. Path: %s",
"loc.messages.DeletingAuthDataFromDockerConfig": "Deleting auth data for registry from Docker config file. Registry: %s, New Docker config: %s",
"loc.messages.DockerRegistryNotFound": "Docker registry service connection not specified.",
"loc.messages.FileContentSynced": "Synced the file content to the disk. The content is %s.",
"loc.messages.FoundDockerConfigStoredInTempPath": "Found the Docker Config stored in the temp path. Docker config path: %s, Docker config: %s",
"loc.messages.FoundPreviousLogin": "Found a previous login for the registry. Trying to restore the previous login auth data. Registry: %s",
"loc.messages.FoundLoginsForOtherRegistries": "Found login info for other registry(s). Trying to remove auth from the Docker config for the registry: %s",
"loc.messages.FoundPreviousLoginForRegistry": "Found a previous login to the same registry. Saving old login data and continuing with the new login. Previous login auth: %s",
"loc.messages.OldDockerConfigContent": "Found an earlier login to the same registry. Saving old auth data and continuing with the new login. Old docker config: %s",
"loc.messages.LoggingOutFromRegistry": "Trying to logout from registry: %s",
"loc.messages.LoggingOutWithNoRegistrySpecified": "Logging out. Removing all auth data from temp docker config since no registry is specified.",
"loc.messages.LoggingOutWithNoRegistrySpecified": "Logging out. Removing all auth data from temp docker config, since no registry is specified.",
"loc.messages.NoAuthInfoFoundInDockerConfig": "No auths found in Docker config. Hence returning 0 registry url's. Docker config: %s",
"loc.messages.NoDataWrittenOnFile": "No data was written into the file %s",
"loc.messages.NoImagesInImageNamesFile": "At least one image name is expected in file '%s'.",
"loc.messages.NotAddingAnyTagsToBuild": "Not adding any container registry tags to the build image as no login information was found.",
"loc.messages.NotPushingAsNoLoginFound": "Not pushing to any registry as no login information was found.",
"loc.messages.OutputVariableDataSizeExceeded": "Output variable not set as Docker command output exceeded the maximum supported length. Output length: %s, Maximum supported length: %s",
"loc.messages.PathIsNotInTempDirectory": "The config path is not inside the temp directory. Config path: %s, Temp directory: %s",
"loc.messages.RegistryAuthNotPresentInConfig": "Could not find the auth data for registry in the Docker config file. Unable to logout. Registry: %s, Docker config: %s",
"loc.messages.RestoringPreviousLoginAuth": "Restoring the previous login auth. Docker config: %s"
"loc.messages.RegistryAuthNotPresentInConfig": "Could not find the auth data for registry in the Docker config file. Nothing to be done to logout. Registry: %s, Docker config: %s",
"loc.messages.RestoringOldLoginAuth": "Restoring the previous login auth data for the registry: %s",
"loc.messages.WritingDockerConfigToTempFile": "Writing Docker config to temp file. File path: %s, Docker config: %s"
}
17 changes: 9 additions & 8 deletions Tasks/DockerV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 2,
"Minor": 0,
"Minor": 150,
"Patch": 0
},
"demands": [],
Expand Down Expand Up @@ -126,30 +126,31 @@
}
},
"messages": {
"AddingAuthDataToDockerConfig": "Adding auth data for registry to Docker config file. Registry: %s, Docker config: %s",
"AddingNewAuthToExistingConfig": "Adding auth data for registry to Docker config file. Registry: %s.",
"ArgumentsNotSupportedWithBuildAndPush": "The input arguments is not supported when the command is buildAndPush",
"ContainerPatternFound": "Pattern found in Docker filepath parameter",
"ContainerPatternNotFound": "No pattern found in Docker filepath parameter",
"ContainerDockerFileNotFound": "No Dockerfile matching %s was found.",
"CantWriteDataToFile": "Can not write data to the file %s. Error: %s",
"CouldNotFindDockerConfig": "Could not find Docker Config. Either DOCKER_CONFIG variable is not set, or the config file is outside the temp directory, or the file does not exist. Docker config directory: %s, Docker config path: %s",
"CouldNotFindDockerConfig": "Could not find Docker Config. Either DOCKER_CONFIG variable is not set, or the config file is outside the temp directory, or the file does not exist. DOCKER_CONFIG: %s",
"DeletingDockerConfigDirectory": "Deleting Docker config directory. Path: %s",
"DeletingAuthDataFromDockerConfig": "Deleting auth data for registry from Docker config file. Registry: %s, New Docker config: %s",
"DockerRegistryNotFound": "Docker registry service connection not specified.",
"FileContentSynced": "Synced the file content to the disk. The content is %s.",
"FoundDockerConfigStoredInTempPath": "Found the Docker Config stored in the temp path. Docker config path: %s, Docker config: %s",
"FoundPreviousLogin": "Found a previous login for the registry. Trying to restore the previous login auth data. Registry: %s",
"FoundLoginsForOtherRegistries": "Found login info for other registry(s). Trying to remove auth from the Docker config for the registry: %s",
"FoundPreviousLoginForRegistry": "Found a previous login to the same registry. Saving old login data and continuing with the new login. Previous login auth: %s",
"OldDockerConfigContent": "Found an earlier login to the same registry. Saving old auth data and continuing with the new login. Old docker config: %s",
"LoggingOutFromRegistry": "Trying to logout from registry: %s",
"LoggingOutWithNoRegistrySpecified": "Logging out. Removing all auth data from temp docker config since no registry is specified.",
"LoggingOutWithNoRegistrySpecified": "Logging out. Removing all auth data from temp docker config, since no registry is specified.",
"NoAuthInfoFoundInDockerConfig": "No auths found in Docker config. Hence returning 0 registry url's. Docker config: %s",
"NoDataWrittenOnFile": "No data was written into the file %s",
"NoImagesInImageNamesFile": "At least one image name is expected in file '%s'.",
"NotAddingAnyTagsToBuild": "Not adding any container registry tags to the build image as no login information was found.",
"NotPushingAsNoLoginFound": "Not pushing to any registry as no login information was found.",
"OutputVariableDataSizeExceeded": "Output variable not set as Docker command output exceeded the maximum supported length. Output length: %s, Maximum supported length: %s",
"PathIsNotInTempDirectory": "The config path is not inside the temp directory. Config path: %s, Temp directory: %s",
"RegistryAuthNotPresentInConfig": "Could not find the auth data for registry in the Docker config file. Unable to logout. Registry: %s, Docker config: %s",
"RestoringPreviousLoginAuth": "Restoring the previous login auth. Docker config: %s"
"RegistryAuthNotPresentInConfig": "Could not find the auth data for registry in the Docker config file. Nothing to be done to logout. Registry: %s, Docker config: %s",
"RestoringOldLoginAuth": "Restoring the previous login auth data for the registry: %s",
"WritingDockerConfigToTempFile": "Writing Docker config to temp file. File path: %s, Docker config: %s"
}
}
11 changes: 6 additions & 5 deletions Tasks/DockerV2/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 2,
"Minor": 0,
"Minor": 150,
"Patch": 0
},
"demands": [],
Expand Down Expand Up @@ -125,7 +125,7 @@
}
},
"messages": {
"AddingAuthDataToDockerConfig": "ms-resource:loc.messages.AddingAuthDataToDockerConfig",
"AddingNewAuthToExistingConfig": "ms-resource:loc.messages.AddingNewAuthToExistingConfig",
"ArgumentsNotSupportedWithBuildAndPush": "ms-resource:loc.messages.ArgumentsNotSupportedWithBuildAndPush",
"ContainerPatternFound": "ms-resource:loc.messages.ContainerPatternFound",
"ContainerPatternNotFound": "ms-resource:loc.messages.ContainerPatternNotFound",
Expand All @@ -137,18 +137,19 @@
"DockerRegistryNotFound": "ms-resource:loc.messages.DockerRegistryNotFound",
"FileContentSynced": "ms-resource:loc.messages.FileContentSynced",
"FoundDockerConfigStoredInTempPath": "ms-resource:loc.messages.FoundDockerConfigStoredInTempPath",
"FoundPreviousLogin": "ms-resource:loc.messages.FoundPreviousLogin",
"FoundLoginsForOtherRegistries": "ms-resource:loc.messages.FoundLoginsForOtherRegistries",
"FoundPreviousLoginForRegistry": "ms-resource:loc.messages.FoundPreviousLoginForRegistry",
"OldDockerConfigContent": "ms-resource:loc.messages.OldDockerConfigContent",
"LoggingOutFromRegistry": "ms-resource:loc.messages.LoggingOutFromRegistry",
"LoggingOutWithNoRegistrySpecified": "ms-resource:loc.messages.LoggingOutWithNoRegistrySpecified",
"NoAuthInfoFoundInDockerConfig": "ms-resource:loc.messages.NoAuthInfoFoundInDockerConfig",
"NoDataWrittenOnFile": "ms-resource:loc.messages.NoDataWrittenOnFile",
"NoImagesInImageNamesFile": "ms-resource:loc.messages.NoImagesInImageNamesFile",
"NotAddingAnyTagsToBuild": "ms-resource:loc.messages.NotAddingAnyTagsToBuild",
"NotPushingAsNoLoginFound": "ms-resource:loc.messages.NotPushingAsNoLoginFound",
"OutputVariableDataSizeExceeded": "ms-resource:loc.messages.OutputVariableDataSizeExceeded",
"PathIsNotInTempDirectory": "ms-resource:loc.messages.PathIsNotInTempDirectory",
"RegistryAuthNotPresentInConfig": "ms-resource:loc.messages.RegistryAuthNotPresentInConfig",
"RestoringPreviousLoginAuth": "ms-resource:loc.messages.RestoringPreviousLoginAuth"
"RestoringOldLoginAuth": "ms-resource:loc.messages.RestoringOldLoginAuth",
"WritingDockerConfigToTempFile": "ms-resource:loc.messages.WritingDockerConfigToTempFile"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,6 @@
"loc.messages.DownloadStableVersionFailed": "Can not download kubernetes stable version file from %s. Falling back to %s",
"loc.messages.UsingLatestStableVersion": "Invalid version 1.7 specified in Version Spec input. Using latest stable version instead. Check for correct versions https://github.com/kubernetes/kubernetes/releases",
"loc.messages.ConfigurationFileNotFound": "No configuration file matching %s was found.",
"loc.messages.OutputVariableDataSizeExceeded": "Output variable not set as kubectl command output exceeded the maximum supported length. Output length: %s, Maximum supported length: %s"
"loc.messages.OutputVariableDataSizeExceeded": "Output variable not set as kubectl command output exceeded the maximum supported length. Output length: %s, Maximum supported length: %s",
"loc.messages.WritingDockerConfigToTempFile": "Writing Docker config to temp file. File path: %s, Docker config: %s"
}
Loading

0 comments on commit 7301a9e

Please sign in to comment.