@Override public List<Profile> getProfiles(DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints) { List<Profile> result = new ArrayList<>(); Profile deckProfile = deckProfileFactory.getProfile(deckSettingsPath, deckPath, deploymentConfiguration, endpoints); String deploymentName = deploymentConfiguration.getName(); Path userProfilePath = halconfigDirectoryStructure.getUserProfilePath(deploymentName); Optional<Profile> settingsLocalProfile = this.customProfile( deploymentConfiguration, endpoints, Paths.get(userProfilePath.toString(), deckSettingsLocalPath), deckSettingsLocalPath); settingsLocalProfile.ifPresent(p -> deckProfile.appendContents(p.getContents())); result.add(deckProfile); return result; }
protected Providers getImageProviders(String version, String deploymentName) { Providers providers; try (InputStream is = profileRegistry.readProfile(getArtifact().getName(), version, "images.yml")) { Object obj = yamlParser.load(is); providers = objectMapper.convertValue(obj, Providers.class); } catch (IOException e) { throw new HalException(Problem.Severity.FATAL, "Unable to read images.yml for rosco: " + e.getMessage(), e); } File f = halconfigDirectoryStructure.getUserProfilePath(deploymentName).resolve("images-local.yml").toFile(); Providers localProviders = null; if (f.exists()) { // Need just the $PROVIDER.bakeryDefaults.baseImages list items to merge in with the content from rosco/halconfig/images.yml. try (FileInputStream fis = new FileInputStream(f)) { Object localObj = yamlParser.load(fis); localProviders = objectMapper.convertValue(localObj, Providers.class); } catch (IOException e) { throw new HalException(Problem.Severity.FATAL, "Unable to read images-local.yml for rosco: " + e.getMessage(), e); } } if (localProviders != null) { augmentProvidersBaseImages(providers, localProviders); } return providers; }
protected Providers getImageProviders(String version, String deploymentName) { Providers providers; try (InputStream is = profileRegistry.readProfile(getArtifact().getName(), version, "images.yml")) { Object obj = yamlParser.load(is); providers = objectMapper.convertValue(obj, Providers.class); } catch (IOException e) { throw new HalException(Problem.Severity.FATAL, "Unable to read images.yml for rosco: " + e.getMessage(), e); } File f = halconfigDirectoryStructure.getUserProfilePath(deploymentName).resolve("images-local.yml").toFile(); Providers localProviders = null; if (f.exists()) { // Need just the $PROVIDER.bakeryDefaults.baseImages list items to merge in with the content from rosco/halconfig/images.yml. try (FileInputStream fis = new FileInputStream(f)) { Object localObj = yamlParser.load(fis); localProviders = objectMapper.convertValue(localObj, Providers.class); } catch (IOException e) { throw new HalException(Problem.Severity.FATAL, "Unable to read images-local.yml for rosco: " + e.getMessage(), e); } } if (localProviders != null) { augmentProvidersBaseImages(providers, localProviders); } return providers; }
Path userProfilePath = halconfigDirectoryStructure.getUserProfilePath(deploymentName); List<String> userProfileNames = aggregateProfilesInPath(userProfilePath.toString(), "");
Path userProfilePath = halconfigDirectoryStructure.getUserProfilePath(deploymentName); List<String> userProfileNames = aggregateProfilesInPath(userProfilePath.toString(), "");