Skip to content

Commit

Permalink
[FAB-678] Further refinements to dockerfile creation
Browse files Browse the repository at this point in the history
Change-Id: Iedc4cb64f616adea1f1c4957aedf57429442b66f
Signed-off-by: Greg Haskins <gregory.haskins@gmail.com>
  • Loading branch information
ghaskins committed Feb 8, 2017
1 parent 0db4b6c commit 8d2701a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions core/chaincode/platforms/platforms.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,14 @@ func GetDeploymentPayload(spec *pb.ChaincodeSpec) ([]byte, error) {

func getPeerTLSCert() ([]byte, error) {
path := viper.GetString("peer.tls.cert.file")
if _, err := os.Stat(path); os.IsNotExist(err) {
// It's not an error if the file doesn't exist, we simply do not have a cert
return nil, nil
if _, err := os.Stat(path); err != nil {

if os.IsNotExist(err) && viper.GetBool("peer.tls.enabled") == false {
// It's not an error if the file doesn't exist but TLS is disabled anyway
return nil, nil
}

return nil, err
}

// FIXME: FAB-2037 - ensure we sanely resolve relative paths specified in the yaml
Expand Down Expand Up @@ -127,7 +132,7 @@ func generateDockerBuild(platform Platform, cds *pb.ChaincodeDeploymentSpec, inp
for name, data := range inputFiles {
err = cutil.WriteBytesToPackage(name, data, tw)
if err != nil {
return fmt.Errorf("Failed to inject Dockerfile: %s", err)
return fmt.Errorf("Failed to inject \"%s\": %s", name, err)
}
}

Expand Down

0 comments on commit 8d2701a

Please sign in to comment.