Update DockerSecretsProcessor.java
This commit is contained in:
		
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							fbc904e5e8
						
					
				
				
					commit
					3b79604af2
				
			| @@ -17,14 +17,15 @@ public class DockerSecretsProcessor implements EnvironmentPostProcessor { | ||||
|  | ||||
| 	@Override | ||||
| 	public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) { | ||||
| 		Resource resource = new FileSystemResource("/run/secrets/db-password"); | ||||
| 		if (resource.exists() && System.getProperty("MYSQL_PASSWORD") == null) { | ||||
| 			try { | ||||
| 				String dbPassword = StreamUtils.copyToString(resource.getInputStream(), Charset.defaultCharset()); | ||||
| 				System.setProperty("MYSQL_PASSWORD", dbPassword); | ||||
| 			} catch (IOException e) { | ||||
| 				throw new RuntimeException(e); | ||||
| 			} | ||||
| 		} | ||||
| // 		Resource resource = new FileSystemResource("/run/secrets/db-password"); | ||||
| // 		if (resource.exists() && System.getProperty("MYSQL_PASSWORD") == null) { | ||||
| // 			try { | ||||
| // 				String dbPassword = StreamUtils.copyToString(resource.getInputStream(), Charset.defaultCharset()); | ||||
| // 				System.setProperty("MYSQL_PASSWORD", dbPassword); | ||||
| // 			} catch (IOException e) { | ||||
| // 				throw new RuntimeException(e); | ||||
| // 			} | ||||
| // 		} | ||||
| 		System.setProperty("MYSQL_PASSWORD", "db-57xsl"); | ||||
| 	} | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user