Skip to content

Commit

Permalink
fix(config): Expect TAR profile files to be flat (#472)
Browse files Browse the repository at this point in the history
  • Loading branch information
lwander authored May 18, 2017
1 parent f71f0f7 commit 7733b0e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class RegistryBackedArchiveProfileBuilder {

public List<Profile> build(DeploymentConfiguration deploymentConfiguration, String baseOutputPath, SpinnakerArtifact artifact, String archiveName) {
String version = artifactService.getArtifactVersion(deploymentConfiguration.getName(), artifact);
String archiveObjectName = ProfileRegistry.profilePath(artifact.getName(), version, archiveName);
String archiveObjectName = ProfileRegistry.profilePath(artifact.getName(), version, archiveName + ".tar.gz");

InputStream is;
try {
Expand All @@ -75,8 +75,9 @@ public List<Profile> build(DeploymentConfiguration deploymentConfiguration, Stri
continue;
}

String name = String.join("/", artifact.getName(), profileEntry.getName());
String outputPath = Paths.get(baseOutputPath, name).toString();
String entryName = profileEntry.getName();
String profileName = String.join("/", artifact.getName(), archiveName, entryName);
String outputPath = Paths.get(baseOutputPath, archiveName, entryName).toString();
String contents = IOUtils.toString(tis);

result.add((new ProfileFactory() {
Expand Down Expand Up @@ -109,7 +110,7 @@ public SpinnakerArtifact getArtifact() {
protected String commentPrefix() {
return null;
}
}).getProfile(name, outputPath, deploymentConfiguration, null));
}).getProfile(profileName, outputPath, deploymentConfiguration, null));

profileEntry = tis.getNextEntry();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
@Data
@Component
abstract public class RoscoService extends SpringService<RoscoService.Rosco> {
private static String roscoPackerPath = "/opt/rosco/config/packer";
private static String roscoConfigPath = "/opt/rosco/config";

@Autowired
RoscoProfileFactory roscoProfileFactory;
Expand Down Expand Up @@ -71,7 +71,7 @@ public List<Profile> getProfiles(DeploymentConfiguration deploymentConfiguration
Profile profile = roscoProfileFactory.getProfile(filename, path, deploymentConfiguration, endpoints);

profiles.add(profile);
profiles.addAll(prefixProfileBuilder.build(deploymentConfiguration, roscoPackerPath, getArtifact(), "packer.tar.gz"));
profiles.addAll(prefixProfileBuilder.build(deploymentConfiguration, roscoConfigPath, getArtifact(), "packer"));
return profiles;
}

Expand Down

0 comments on commit 7733b0e

Please sign in to comment.