mirror of
https://github.com/theonedev/onedev.git
synced 2025-12-08 18:26:30 +00:00
fix: Unable to publish helm package (OD-2570)
This commit is contained in:
parent
d8cdd0e327
commit
c0c8c585c1
@ -136,6 +136,24 @@ public class VersionedYamlDoc extends MappingNode {
|
|||||||
return constructDocument(node);
|
return constructDocument(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected Object constructObject(Node node) {
|
||||||
|
if (node instanceof MappingNode) {
|
||||||
|
MappingNode mappingNode = (MappingNode) node;
|
||||||
|
for (var it = mappingNode.getValue().iterator(); it.hasNext();) {
|
||||||
|
var tuple = it.next();
|
||||||
|
if (tuple.getKeyNode() instanceof ScalarNode) {
|
||||||
|
ScalarNode keyNode = (ScalarNode) tuple.getKeyNode();
|
||||||
|
if ("type".equals(keyNode.getValue())) {
|
||||||
|
String implementationName = ((ScalarNode) tuple.getValueNode()).getValue();
|
||||||
|
mappingNode.setTag(new Tag("!" + implementationName));
|
||||||
|
it.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return super.constructObject(node);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String constructScalar(ScalarNode node) {
|
protected String constructScalar(ScalarNode node) {
|
||||||
String value = super.constructScalar(node);
|
String value = super.constructScalar(node);
|
||||||
|
|||||||
@ -242,20 +242,6 @@ public abstract class BaseConstructor {
|
|||||||
* @return Java instance
|
* @return Java instance
|
||||||
*/
|
*/
|
||||||
protected Object constructObject(Node node) {
|
protected Object constructObject(Node node) {
|
||||||
if (node instanceof MappingNode) {
|
|
||||||
MappingNode mappingNode = (MappingNode) node;
|
|
||||||
for (var it = mappingNode.getValue().iterator(); it.hasNext();) {
|
|
||||||
var tuple = it.next();
|
|
||||||
if (tuple.getKeyNode() instanceof ScalarNode) {
|
|
||||||
ScalarNode keyNode = (ScalarNode) tuple.getKeyNode();
|
|
||||||
if ("type".equals(keyNode.getValue())) {
|
|
||||||
String implementationName = ((ScalarNode) tuple.getValueNode()).getValue();
|
|
||||||
mappingNode.setTag(new Tag("!" + implementationName));
|
|
||||||
it.remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (constructedObjects.containsKey(node)) {
|
if (constructedObjects.containsKey(node)) {
|
||||||
return constructedObjects.get(node);
|
return constructedObjects.get(node);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -113,7 +113,7 @@ public class GemPackService implements PackService {
|
|||||||
sessionManager.run(() -> {
|
sessionManager.run(() -> {
|
||||||
checkProject(projectId, true);
|
checkProject(projectId, true);
|
||||||
});
|
});
|
||||||
var tempFile = FileUtils.createTempFile("upload", "nuget");
|
var tempFile = FileUtils.createTempFile("upload", "gem");
|
||||||
try {
|
try {
|
||||||
try (var os = new BufferedOutputStream(new FileOutputStream(tempFile), BUFFER_SIZE)) {
|
try (var os = new BufferedOutputStream(new FileOutputStream(tempFile), BUFFER_SIZE)) {
|
||||||
IOUtils.copy(request.getInputStream(), os);
|
IOUtils.copy(request.getInputStream(), os);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user