Skip to content

Commit

Permalink
Merge branch 'eclipse:master' into Issue-Fix-eclipse-jkube#2640
Browse files Browse the repository at this point in the history
  • Loading branch information
l3002 authored Feb 20, 2024
2 parents f79d2ac + c850332 commit f74363f
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class KubernetesHelmTaskTest {
private MockedConstruction<HelmService> helmServiceMockedConstruction;

@BeforeEach
void setUp() throws IOException {
void setUp() {
TestKubernetesExtension extension = new TestKubernetesExtension();
extension.isUseColor = false;
helmServiceMockedConstruction = mockConstruction(HelmService.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
*/
package org.eclipse.jkube.gradle.plugin.task;

import java.io.IOException;
import java.util.Collections;

import org.eclipse.jkube.gradle.plugin.KubernetesExtension;
Expand Down Expand Up @@ -54,7 +53,7 @@ class KubernetesPushTaskTest {
private KubernetesExtension extension;

@BeforeEach
void setUp() throws IOException {
void setUp() {
// Mock required for environments with no DOCKER available (don't remove)
dockerAccessFactoryMockedConstruction = mockConstruction(DockerAccessFactory.class,
(mock, ctx) -> when(mock.createDockerAccess(any())).thenReturn(mock(DockerAccess.class)));
Expand Down
2 changes: 1 addition & 1 deletion jkube-kit/doc/src/main/asciidoc/inc/helm/_jkube_helm.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ Defaults to empty string.
ifeval::["{plugin-type}" == "maven"]
| *security*
| The Maven security dispatcher configuration file. If you use the default security dispatcher, you need to point this to the file containing your master password. If you followed the http://maven.apache.org/guides/mini/guide-encryption.html[Maven Password Encryption guide], this is `${user.home}/.m2/settings-security.xml`.
| The Maven security dispatcher configuration file. If you use the default security dispatcher, you need to point this to the file containing your master password. If you followed the http://maven.apache.org/guides/mini/guide-encryption.html[Maven Password Encryption guide], this is `${user.home}/.m2/settings-security.xml`, so that is what this setting defaults to when you do not set it explicitly.
|
endif::[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ need to add a server entry for your repo like this:
</settings>
----

If you have encrypted your password with a master password (as outlined in the http://maven.apache.org/guides/mini/guide-encryption.html[Maven Password Encryption guide]), make sure to configure the `security` setting:
If you have encrypted your password with a master password (as outlined in the http://maven.apache.org/guides/mini/guide-encryption.html[Maven Password Encryption guide]), your master password is encrypted somewhere in a file. By default this is `~/.m2/security-settings.xml`. If you've chosen another location, make sure to configure the `security` setting:
[source,xml,indent=0,subs="verbatim,quotes,attributes"]
----
<plugin>
<configuration>
<helm>
<security>~/.m2/security-settings.xml</security>
<security>~/work/.m2/work-security-settings.xml</security>
...
</helm>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ void metadataVisit_whenMultilineAnnotationProvided_shouldAddTrailingNewline() {
// Given
Properties allProps = new Properties();
final ObjectMetaBuilder db = new ObjectMetaBuilder();
allProps.put("multiline/config", "proxyMetadata:\n ISTIO_META_DNS_CAPTURE: \"false\"\nholdUntilProxyStarts: true");
allProps.put("multiline/config", String.format("proxyMetadata:%n ISTIO_META_DNS_CAPTURE: \"false\"%nholdUntilProxyStarts: true"));
ResourceConfig rc = ResourceConfig.builder()
.annotations(MetaDataConfig.builder()
.all(allProps)
Expand All @@ -367,6 +367,6 @@ void metadataVisit_whenMultilineAnnotationProvided_shouldAddTrailingNewline() {

// Then
assertThat(db.build().getAnnotations())
.containsOnly(entry("multiline/config", "proxyMetadata:\n ISTIO_META_DNS_CAPTURE: \"false\"\nholdUntilProxyStarts: true\n"));
.containsOnly(entry("multiline/config", String.format("proxyMetadata:%n ISTIO_META_DNS_CAPTURE: \"false\"%nholdUntilProxyStarts: true%n")));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class DefaultControllerEnricherTest {
private Properties properties;

@BeforeEach
void setUp() throws Exception {
void setUp() {
config = new HashMap<>();
properties = new Properties();
context = JKubeEnricherContext.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class DefaultMetadataEnricherTest {
private KubernetesListBuilder klb;

@BeforeEach
void setUp() throws Exception {
void setUp() {
JKubeEnricherContext buildContext = mock(JKubeEnricherContext.class, RETURNS_DEEP_STUBS);
Configuration configuration = Configuration.builder()
.resource(ResourceConfig.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class IngressEnricherBehavioralTest {
private KubernetesListBuilder klb;

@BeforeEach
void setUp() throws Exception {
void setUp() {
context = JKubeEnricherContext.builder()
.project(JavaProject.builder()
.properties(new Properties())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ public void executeInternal() throws MojoExecutionException {
}
try {
super.executeInternal();
helm = initHelmPushConfig(helm, javaProject);
if (securityDispatcher instanceof DefaultSecDispatcher) {
((DefaultSecDispatcher) securityDispatcher).setConfigurationFile(getHelm().getSecurity());
((DefaultSecDispatcher) securityDispatcher).setConfigurationFile(helm.getSecurity());
}
helm = initHelmPushConfig(helm, javaProject);
jkubeServiceHub.getHelmService().uploadHelmChart(helm);
} catch (Exception exp) {
getKitLogger().error("Error performing helm push", exp);
Expand Down

0 comments on commit f74363f

Please sign in to comment.