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

add values.yaml to help discover default values. #458

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
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 @@ -194,6 +194,18 @@ public void extractDataFromTgz(InputStream in, Chart chart) throws IOException {
}
chart.setConfig(mapper.readTree(baos.toString("UTF-8")));
}
if (entry.getName().endsWith(chart.getName() + "/values.yaml")
&& !entry.getName()
.endsWith("charts/" + chart.getName() + "/values.yaml")) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int len;
while ((len = tarIn.read(buffer)) != -1) {
baos.write(buffer, 0, len);
}
byte[] fileContent = baos.toByteArray();
chart.setDefaultValues(new String(fileContent));
}
}
}
}
Expand Down
14 changes: 14 additions & 0 deletions onyxia-model/src/main/java/fr/insee/onyxia/model/helm/Chart.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ public class Chart extends Pkg {

@JsonIgnore private Map<String, Object> additionalProperties = new HashMap<String, Object>();

@Schema(description = "")
@JsonProperty("defaultValues")
private String defaultValues;

@JsonProperty("apiVersion")
public String getApiVersion() {
return apiVersion;
Expand Down Expand Up @@ -239,6 +243,16 @@ public void setVersion(String version) {
this.version = version;
}

@JsonProperty("defaultValues")
public String getDefaultValues() {
return defaultValues;
}

@JsonProperty("defaultValues")
public void setDefaultValues(String defaultValues) {
this.defaultValues = defaultValues;
}

@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
Expand Down