generated from quarkiverse/quarkiverse-template
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: parallelize Helm chart generation (#782)
* feat: parallelize Helm chart generation Signed-off-by: Chris Laprun <claprun@redhat.com> * feat: use own Helm model (from dekorate) to avoid depending on dekorate Signed-off-by: Chris Laprun <claprun@redhat.com> --------- Signed-off-by: Chris Laprun <claprun@redhat.com>
- Loading branch information
Showing
10 changed files
with
747 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
.../src/main/java/io/quarkiverse/operatorsdk/deployment/helm/DisableDefaultHelmListener.java
This file was deleted.
Oops, something went wrong.
240 changes: 115 additions & 125 deletions
240
...ployment/src/main/java/io/quarkiverse/operatorsdk/deployment/helm/HelmChartProcessor.java
Large diffs are not rendered by default.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
...yment/src/main/java/io/quarkiverse/operatorsdk/deployment/helm/HelmGenerationEnabled.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package io.quarkiverse.operatorsdk.deployment.helm; | ||
|
||
import java.util.function.BooleanSupplier; | ||
|
||
import io.quarkiverse.operatorsdk.runtime.BuildTimeOperatorConfiguration; | ||
|
||
class HelmGenerationEnabled implements BooleanSupplier { | ||
private BuildTimeOperatorConfiguration config; | ||
|
||
@Override | ||
public boolean getAsBoolean() { | ||
return config.helm.enabled; | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...rc/main/java/io/quarkiverse/operatorsdk/deployment/helm/HelmTargetDirectoryBuildItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package io.quarkiverse.operatorsdk.deployment.helm; | ||
|
||
import static io.quarkiverse.operatorsdk.deployment.helm.HelmChartProcessor.TEMPLATES_DIR; | ||
|
||
import java.io.File; | ||
import java.nio.file.Path; | ||
|
||
import io.quarkus.builder.item.SimpleBuildItem; | ||
|
||
final class HelmTargetDirectoryBuildItem extends SimpleBuildItem { | ||
private final Path helmDir; | ||
private final Path templatesDir; | ||
|
||
HelmTargetDirectoryBuildItem(File helmDir) { | ||
this.helmDir = helmDir.toPath(); | ||
this.templatesDir = Path.of(helmDir.getPath(), TEMPLATES_DIR); | ||
} | ||
|
||
public File getHelmDir() { | ||
return helmDir.toFile(); | ||
} | ||
|
||
public Path getPathToHelmDir() { | ||
return helmDir; | ||
} | ||
|
||
public Path getPathToTemplatesDir() { | ||
return templatesDir; | ||
} | ||
} |
215 changes: 215 additions & 0 deletions
215
core/deployment/src/main/java/io/quarkiverse/operatorsdk/deployment/helm/model/Chart.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,215 @@ | ||
/** | ||
* Copyright 2018 The original authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
**/ | ||
package io.quarkiverse.operatorsdk.deployment.helm.model; | ||
|
||
import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_EMPTY; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** | ||
* Represents the <a href="https://github.com/helm/helm">Helm</a> | ||
* <a href="https://github.com/helm/helm/blob/v3.10.1/pkg/chart/metadata.go">Chart.yaml file</a> | ||
*/ | ||
@JsonInclude(NON_EMPTY) | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class Chart { | ||
@JsonProperty | ||
private String name; | ||
@JsonProperty | ||
private String home; | ||
@JsonProperty | ||
private List<String> sources; | ||
@JsonProperty | ||
private String version; | ||
@JsonProperty | ||
private String description; | ||
@JsonProperty | ||
private List<String> keywords; | ||
@JsonProperty | ||
private List<Maintainer> maintainers; | ||
@JsonProperty | ||
private String icon; | ||
@JsonProperty | ||
private String apiVersion; | ||
@JsonProperty | ||
private String condition; | ||
@JsonProperty | ||
private String tags; | ||
@JsonProperty | ||
private String appVersion; | ||
@JsonProperty | ||
private Boolean deprecated; | ||
@JsonProperty | ||
private Map<String, String> annotations; | ||
@JsonProperty | ||
private String kubeVersion; | ||
@JsonProperty | ||
private List<HelmDependency> dependencies; | ||
@JsonProperty | ||
private String type; | ||
|
||
public String getVersion() { | ||
return version; | ||
} | ||
|
||
public void setVersion(String version) { | ||
this.version = version; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getDescription() { | ||
return description; | ||
} | ||
|
||
public void setDescription(String description) { | ||
this.description = description; | ||
} | ||
|
||
public List<HelmDependency> getDependencies() { | ||
return dependencies; | ||
} | ||
|
||
public void setDependencies(List<HelmDependency> dependencies) { | ||
this.dependencies = dependencies; | ||
} | ||
|
||
public List<Maintainer> getMaintainers() { | ||
return maintainers; | ||
} | ||
|
||
public void setMaintainers(List<Maintainer> maintainers) { | ||
this.maintainers = maintainers; | ||
} | ||
|
||
public String getApiVersion() { | ||
return apiVersion; | ||
} | ||
|
||
public void setApiVersion(String apiVersion) { | ||
this.apiVersion = apiVersion; | ||
} | ||
|
||
public List<String> getKeywords() { | ||
return keywords; | ||
} | ||
|
||
public String getCondition() { | ||
return condition; | ||
} | ||
|
||
public void setCondition(String condition) { | ||
this.condition = condition; | ||
} | ||
|
||
public String getTags() { | ||
return tags; | ||
} | ||
|
||
public void setTags(String tags) { | ||
this.tags = tags; | ||
} | ||
|
||
public void setKeywords(List<String> keywords) { | ||
this.keywords = keywords; | ||
} | ||
|
||
public List<String> getSources() { | ||
return sources; | ||
} | ||
|
||
public void setSources(List<String> sources) { | ||
this.sources = sources; | ||
} | ||
|
||
public String getHome() { | ||
return home; | ||
} | ||
|
||
public void setHome(String home) { | ||
this.home = home; | ||
} | ||
|
||
public String getIcon() { | ||
return icon; | ||
} | ||
|
||
public void setIcon(String icon) { | ||
this.icon = icon; | ||
} | ||
|
||
public String getAppVersion() { | ||
return appVersion; | ||
} | ||
|
||
public void setAppVersion(String appVersion) { | ||
this.appVersion = appVersion; | ||
} | ||
|
||
public Boolean getDeprecated() { | ||
return deprecated; | ||
} | ||
|
||
public void setDeprecated(Boolean deprecated) { | ||
this.deprecated = deprecated; | ||
} | ||
|
||
public Map<String, String> getAnnotations() { | ||
return annotations; | ||
} | ||
|
||
public void setAnnotations(Map<String, String> annotations) { | ||
this.annotations = annotations; | ||
} | ||
|
||
public String getKubeVersion() { | ||
return kubeVersion; | ||
} | ||
|
||
public void setKubeVersion(String kubeVersion) { | ||
this.kubeVersion = kubeVersion; | ||
} | ||
|
||
public String getType() { | ||
return type; | ||
} | ||
|
||
public void setType(String type) { | ||
this.type = type; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Chart{" + | ||
"name='" + name + '\'' + | ||
", home='" + home + '\'' + | ||
", version='" + version + '\'' + | ||
'}'; | ||
} | ||
|
||
} |
Oops, something went wrong.