Skip to content
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

return dns suffix through method so the AWS Provider can be extended #2150

Merged
merged 1 commit into from
May 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,14 @@ public void initialize(String provider, String providerEndpoint, SSLContext sslC
awsRegion = System.getProperty(AWS_PROP_REGION_NAME);
}

protected Set<String> getDnsSuffixes() {
return dnsSuffixes;
}

protected List<String> getEksDnsSuffixes() {
return eksDnsSuffixes;
}

public ResourceException error(String message) {
return error(ResourceException.FORBIDDEN, message);
}
Expand Down Expand Up @@ -269,7 +277,7 @@ public InstanceConfirmation confirmInstance(InstanceConfirmation confirmation) {

StringBuilder instanceId = new StringBuilder(256);
if (!InstanceUtils.validateCertRequestSanDnsNames(instanceAttributes, instanceDomain,
instanceService, dnsSuffixes, eksDnsSuffixes, eksClusterNames.getStringsList(),
instanceService, getDnsSuffixes(), getEksDnsSuffixes(), eksClusterNames.getStringsList(),
true, instanceId)) {
throw error("Unable to validate certificate request hostnames");
}
Expand All @@ -285,7 +293,6 @@ public InstanceConfirmation confirmInstance(InstanceConfirmation confirmation) {
StringBuilder errMsg = new StringBuilder(256);
if (!validateAWSDocument(confirmation.getProvider(), info, awsAccount,
instanceId.toString(), true, privateIp, errMsg)) {
LOGGER.error("validateAWSDocument: {}", errMsg);
throw error("Unable to validate AWS document: " + errMsg);
}
}
Expand Down Expand Up @@ -358,7 +365,6 @@ public InstanceConfirmation refreshInstance(InstanceConfirmation confirmation) {
StringBuilder errMsg = new StringBuilder(256);
if (!validateAWSDocument(confirmation.getProvider(), info, awsAccount,
instanceId, false, privateIp, errMsg)) {
LOGGER.error("validateAWSDocument: {}", errMsg);
throw error("Unable to validate AWS document: " + errMsg);
}
}
Expand Down