Skip to content

Commit 4ba9d91

Browse files
committed
Merge remote-tracking branch 'oss/master' into bb/noderoster-optimize-query
2 parents a9fa990 + 3083bdc commit 4ba9d91

File tree

4 files changed

+34
-3
lines changed

4 files changed

+34
-3
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.walmartlabs.concord.cli;
2+
3+
/*-
4+
* *****
5+
* Concord
6+
* -----
7+
* Copyright (C) 2017 - 2025 Walmart Inc.
8+
* -----
9+
* Licensed under the Apache License, Version 2.0 (the "License");
10+
* you may not use this file except in compliance with the License.
11+
* You may obtain a copy of the License at
12+
*
13+
* http://www.apache.org/licenses/LICENSE-2.0
14+
*
15+
* Unless required by applicable law or agreed to in writing, software
16+
* distributed under the License is distributed on an "AS IS" BASIS,
17+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
* See the License for the specific language governing permissions and
19+
* limitations under the License.
20+
* =====
21+
*/
22+
23+
public class AbortException extends RuntimeException {
24+
25+
public AbortException() {
26+
super("Aborted");
27+
}
28+
}

cli/src/main/java/com/walmartlabs/concord/cli/CliConfig.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* =====
2121
*/
2222

23+
import com.fasterxml.jackson.databind.DeserializationFeature;
2324
import com.fasterxml.jackson.databind.JsonMappingException;
2425
import com.fasterxml.jackson.databind.JsonNode;
2526
import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -38,7 +39,8 @@
3839
public record CliConfig(Map<String, CliConfigContext> contexts) {
3940

4041
public static CliConfig load(Path path) throws IOException {
41-
var mapper = new YAMLMapper();
42+
var mapper = new YAMLMapper()
43+
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
4244

4345
JsonNode defaults = mapper.readTree(readDefaultConfig());
4446

cli/src/main/java/com/walmartlabs/concord/cli/runner/secrets/RemoteSecretsProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* =====
2121
*/
2222

23+
import com.walmartlabs.concord.cli.AbortException;
2324
import com.walmartlabs.concord.cli.Version;
2425
import com.walmartlabs.concord.client2.*;
2526
import com.walmartlabs.concord.common.secret.BinaryDataSecret;
@@ -190,8 +191,7 @@ private void askForAccessConfirmation(String orgName, String secretName) throws
190191
int response = System.in.read();
191192
// y == 121, Y == 89
192193
if (response != 121 && response != 89) {
193-
System.out.println(ansi().fgRed().a("Aborting.").reset());
194-
System.exit(-1);
194+
throw new AbortException();
195195
}
196196
}
197197
}

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
<processStartTag>*****</processStartTag>
131131
<sectionDelimiter>-----</sectionDelimiter>
132132
<processEndTag>=====</processEndTag>
133+
<trimHeaderLine>true</trimHeaderLine>
133134
<roots>
134135
<root>src/main/java</root>
135136
<root>src/test/java</root>

0 commit comments

Comments
 (0)