-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PAYARA-2297 Support Kubernetes Secret Volumes as Config Source #2203
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b81a40c
PAYARA-2297 introduce secrets files as a config source for use with K…
smillidge 7c095df
PAYARA-2297 Make Concurrent HashMaps
smillidge f83c309
PAYARA-2297 removed unused imports
smillidge 0c3fef1
PAYARA-2297 added correct license header and removed some unused imports
smillidge 68aa6ca
PAYARA-2297 Set correct license headers
smillidge e4b06a7
PAYARA-2297 add correct license header
smillidge File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
...rc/main/java/fish/payara/nucleus/microprofile/config/admin/GetConfigSecretsDirectory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package fish.payara.nucleus.microprofile.config.admin; | ||
|
||
import com.sun.enterprise.config.serverbeans.Config; | ||
import fish.payara.nucleus.microprofile.config.spi.MicroprofileConfigConfiguration; | ||
import javax.inject.Inject; | ||
import org.glassfish.api.Param; | ||
import org.glassfish.api.admin.AdminCommand; | ||
import org.glassfish.api.admin.AdminCommandContext; | ||
import org.glassfish.api.admin.ExecuteOn; | ||
import org.glassfish.api.admin.RestEndpoint; | ||
import org.glassfish.api.admin.RestEndpoints; | ||
import org.glassfish.config.support.TargetType; | ||
import org.glassfish.hk2.api.PerLookup; | ||
import org.glassfish.internal.api.Target; | ||
import org.jvnet.hk2.annotations.Service; | ||
|
||
/** | ||
* asAdmin command to the set the directory for the Secrets Dir Config Source | ||
* | ||
* @since 4.1.2.181 | ||
* @author Steve Millidge (Payara Foundation) | ||
*/ | ||
@Service(name = "get-config-secrets-dir") // the name of the service is the asadmin command name | ||
@PerLookup // this means one instance is created every time the command is run | ||
@ExecuteOn() | ||
@TargetType() | ||
@RestEndpoints({ // creates a REST endpoint needed for integration with the admin interface | ||
|
||
@RestEndpoint(configBean = MicroprofileConfigConfiguration.class, | ||
opType = RestEndpoint.OpType.POST, // must be POST as it is doing an update | ||
path = "get-config-secrets-dir", | ||
description = "Gets the Secrets Directory for the Secrets Config Source") | ||
}) | ||
public class GetConfigSecretsDirectory implements AdminCommand { | ||
|
||
@Param(optional = true, defaultValue = "server") // if no target is specified it will be the DAS | ||
String target; | ||
|
||
@Inject | ||
Target targetUtil; | ||
|
||
@Override | ||
public void execute(AdminCommandContext context) { | ||
String result = "Not Found"; | ||
Config configVal = targetUtil.getConfig(target); | ||
MicroprofileConfigConfiguration serviceConfig = configVal.getExtensionByType(MicroprofileConfigConfiguration.class); | ||
if (serviceConfig != null) { | ||
result = serviceConfig.getSecretDir(); | ||
} | ||
context.getActionReport().setMessage(result); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
License header missing here