class KubernetesEnvironmentRepository implements EnvironmentRepository {

	private static final Log LOG = LogFactory.getLog(KubernetesEnvironmentRepository.class);

	private final CoreV1Api coreApi;

	private final List<KubernetesPropertySourceSupplier> kubernetesPropertySourceSuppliers;

	private final String namespace;

	public KubernetesEnvironmentRepository(CoreV1Api coreApi,
			List<KubernetesPropertySourceSupplier> kubernetesPropertySourceSuppliers, String namespace) {
		this.coreApi = coreApi;
		this.kubernetesPropertySourceSuppliers = kubernetesPropertySourceSuppliers;
		this.namespace = namespace;
	}

	@Override
	public Environment findOne(String application, String profile, String label) {
		return findOne(application, profile, label, true);
	}

	@Override
	public Environment findOne(String application, String profile, String label, boolean includeOrigin) {
		if (!StringUtils.hasText(profile)) {
			profile = "default";
		}
		List<String> profiles = new ArrayList<>(List.of(StringUtils.commaDelimitedListToStringArray(profile)));

		Collections.reverse(profiles);
		if (!profiles.contains("default")) {
			profiles.add("default");
		}
		Environment environment = new Environment(application, profiles.toArray(profiles.toArray(new String[0])), label,
				null, null);
		LOG.info("Profiles: " + profile);
		LOG.info("Application: " + application);
		LOG.info("Label: " + label);
		for (String activeProfile : profiles) {
			try {
				// This is needed so that when we get the application name in
				// SourceDataProcessor.sorted that it actually
				// exists in the Environment
				StandardEnvironment springEnv = new KubernetesConfigServerEnvironment(
						createPropertySources(application));
				springEnv.setActiveProfiles(activeProfile);
				if (!"application".equalsIgnoreCase(application)) {
					addApplicationConfiguration(environment, springEnv, application);
				}
			}
			catch (Exception e) {
				LOG.warn(e);
			}
		}
		StandardEnvironment springEnv = new KubernetesConfigServerEnvironment(createPropertySources("application"));
		addApplicationConfiguration(environment, springEnv, "application");
		return environment;
	}

	private MutablePropertySources createPropertySources(String application) {
		Map<String, Object> applicationProperties = Map.of("spring.application.name", application);
		MapPropertySource propertySource = new MapPropertySource("kubernetes-config-server", applicationProperties);
		MutablePropertySources mutablePropertySources = new MutablePropertySources();
		mutablePropertySources.addFirst(propertySource);
		return mutablePropertySources;
	}

	private void addApplicationConfiguration(Environment environment, StandardEnvironment springEnv,
			String applicationName) {<FILL_FUNCTION_BODY>}

}

		kubernetesPropertySourceSuppliers.forEach(supplier -> {
			List<MapPropertySource> propertySources = supplier.get(coreApi, applicationName, namespace, springEnv);
			propertySources.forEach(propertySource -> {
				if (propertySource.getPropertyNames().length > 0) {
					LOG.debug("Adding PropertySource " + propertySource.getName());
					LOG.debug("PropertySource Names: "
							+ StringUtils.arrayToCommaDelimitedString(propertySource.getPropertyNames()));
					environment.add(new PropertySource(propertySource.getName(), propertySource.getSource()));
				}
			});
		});
	
<no_super_class>