Merge pull request #753 from docker/secrets-remove-inline

Remove inline secrets option
This commit is contained in:
Guillaume Tardif 2020-10-09 16:03:38 +02:00 committed by GitHub
commit a6ef06f131
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 10 deletions

View File

@ -49,7 +49,6 @@ const (
volumeDriveroptsShareNameKey = "share_name"
volumeDriveroptsAccountNameKey = "storage_account_name"
volumeReadOnly = "read_only"
secretInlineMark = "inline:"
)
// ToContainerGroup converts a compose project into a ACI container group
@ -190,15 +189,9 @@ type projectAciHelper types.Project
func (p projectAciHelper) getAciSecretVolumes() ([]containerinstance.Volume, error) {
var secretVolumes []containerinstance.Volume
for secretName, filepathToRead := range p.Secrets {
var data []byte
if strings.HasPrefix(filepathToRead.File, secretInlineMark) {
data = []byte(filepathToRead.File[len(secretInlineMark):])
} else {
var err error
data, err = ioutil.ReadFile(filepathToRead.File)
if err != nil {
return secretVolumes, err
}
data, err := ioutil.ReadFile(filepathToRead.File)
if err != nil {
return secretVolumes, err
}
if len(data) == 0 {
continue