Skip to content

Commit

Permalink
Align loading with Spring Boots resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
MatejNedic committed Dec 17, 2024
1 parent 18b1ea8 commit fd0ad73
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@
import org.springframework.boot.BootstrapRegistry;
import org.springframework.boot.ConfigurableBootstrapContext;
import org.springframework.boot.context.config.ConfigDataLocation;
import org.springframework.boot.context.config.ConfigDataLocationNotFoundException;
import org.springframework.boot.context.config.ConfigDataLocationResolver;
import org.springframework.boot.context.config.ConfigDataLocationResolverContext;
import org.springframework.boot.context.config.ConfigDataResource;
import org.springframework.boot.context.config.ConfigDataResourceNotFoundException;
import org.springframework.boot.context.properties.bind.Bindable;
import org.springframework.boot.context.properties.bind.Binder;
import org.springframework.context.ConfigurableApplicationContext;
Expand Down Expand Up @@ -62,12 +60,6 @@ public boolean isResolvable(ConfigDataLocationResolverContext context, ConfigDat
return location.hasPrefix(getPrefix());
}

@Override
public List<T> resolve(ConfigDataLocationResolverContext context, ConfigDataLocation location)
throws ConfigDataLocationNotFoundException, ConfigDataResourceNotFoundException {
return Collections.emptyList();
}

protected <C> void registerAndPromoteBean(ConfigDataLocationResolverContext context, Class<C> type,
BootstrapRegistry.InstanceSupplier<C> supplier) {
registerBean(context, type, supplier);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import org.springframework.boot.context.config.ConfigDataLocation;
import org.springframework.boot.context.config.ConfigDataLocationNotFoundException;
import org.springframework.boot.context.config.ConfigDataLocationResolverContext;
import org.springframework.boot.context.config.Profiles;
import org.springframework.boot.context.properties.bind.Bindable;
import org.springframework.boot.context.properties.bind.Binder;
import org.springframework.boot.logging.DeferredLogFactory;
Expand Down Expand Up @@ -60,9 +59,8 @@ protected String getPrefix() {
}

@Override
public List<ParameterStoreConfigDataResource> resolveProfileSpecific(
ConfigDataLocationResolverContext resolverContext, ConfigDataLocation location, Profiles profiles)
throws ConfigDataLocationNotFoundException {
public List<ParameterStoreConfigDataResource> resolve(ConfigDataLocationResolverContext resolverContext,
ConfigDataLocation location) throws ConfigDataLocationNotFoundException {
var properties = loadProperties(resolverContext.getBinder());
List<ParameterStoreConfigDataResource> locations = new ArrayList<>();
ParameterStorePropertySources sources = new ParameterStorePropertySources();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.springframework.boot.context.config.ConfigDataLocation;
import org.springframework.boot.context.config.ConfigDataLocationNotFoundException;
import org.springframework.boot.context.config.ConfigDataLocationResolverContext;
import org.springframework.boot.context.config.Profiles;
import org.springframework.boot.context.properties.bind.Bindable;
import org.springframework.boot.context.properties.bind.Binder;
import org.springframework.boot.logging.DeferredLogFactory;
Expand Down Expand Up @@ -60,8 +59,8 @@ protected String getPrefix() {
}

@Override
public List<S3ConfigDataResource> resolveProfileSpecific(ConfigDataLocationResolverContext resolverContext,
ConfigDataLocation location, Profiles profiles) throws ConfigDataLocationNotFoundException {
public List<S3ConfigDataResource> resolve(ConfigDataLocationResolverContext resolverContext,
ConfigDataLocation location) throws ConfigDataLocationNotFoundException {

S3Properties s3Properties = loadProperties(resolverContext.getBinder());
List<S3ConfigDataResource> locations = new ArrayList<>();
Expand Down

0 comments on commit fd0ad73

Please sign in to comment.