1

I am writing a secret to a file using Drone while deploying to Kubernates. How can read this file using java Springboot?

Drone commands

 commands:
   - touch naspvtkey.txt
   - ls -a
   - echo "$NASPVTKEY" > naspvtkey.txt

Drone outputs:

+ touch naspvtkey.txt -------> created the file
+ ls -a
.DS_Store
.drone.yml
.drone.yml.sig
.git
.gitignore
.mvn
Dockerfile
README.md
kubernetes
mvnw
naspvtkey.txt
pom.xml
src
+ echo "$NASPVTKEY" > naspvtkey.txt ---------> added my secret

I am trying to access the file using

  file = new File("/naspvtkey.txt");
Kara
  • 6,115
  • 16
  • 50
  • 57
Hearaman
  • 8,466
  • 13
  • 41
  • 58

1 Answers1

0

Ensure container user has permission to create file in root directory.

P Ekambaram
  • 15,499
  • 7
  • 34
  • 59