Skip to content

Commit fa79548

Browse files
alter-mageindougnito
authored andcommitted
feat: warning log for discontinued component (#1349)
1 parent b45ab27 commit fa79548

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

pom.xml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,7 @@
2828
<dependency>
2929
<groupId>software.amazon.awssdk</groupId>
3030
<artifactId>bom</artifactId>
31-
<!--
32-
Do not upgrade this version without additional testing. Newer versions have incompatible
33-
serialization changes.
34-
https://github.com/aws/aws-sdk-java-v2/issues/3127
35-
-->
36-
<version>2.17.81</version>
31+
<version>2.17.295</version>
3732
<type>pom</type>
3833
<scope>import</scope>
3934
</dependency>
@@ -134,7 +129,7 @@
134129
<dependency>
135130
<groupId>software.amazon.awssdk</groupId>
136131
<artifactId>greengrassv2-data</artifactId>
137-
<version>2.15.x-SNAPSHOT</version>
132+
<version>2.17.x-SNAPSHOT</version>
138133
<exclusions>
139134
<exclusion>
140135
<groupId>software.amazon.awssdk</groupId>

src/main/java/com/aws/greengrass/componentmanager/ComponentManager.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import software.amazon.awssdk.http.HttpStatusCode;
4848
import software.amazon.awssdk.services.greengrassv2data.model.GreengrassV2DataException;
4949
import software.amazon.awssdk.services.greengrassv2data.model.ResolvedComponentVersion;
50+
import software.amazon.awssdk.services.greengrassv2data.model.VendorGuidance;
5051

5152
import java.io.File;
5253
import java.io.IOException;
@@ -206,6 +207,15 @@ private ComponentIdentifier negotiateVersionWithCloud(String componentName,
206207
resolvedComponentVersion = RetryUtils.runWithRetry(clientExceptionRetryConfig,
207208
() -> componentServiceHelper.resolveComponentVersion(componentName, null, versionRequirements),
208209
"resolve-component-version", logger);
210+
211+
VendorGuidance vendorGuidance = resolvedComponentVersion.vendorGuidance();
212+
if (VendorGuidance.DISCONTINUED.equals(vendorGuidance)) {
213+
logger.atWarn().kv(COMPONENT_NAME, componentName)
214+
.kv("componentVersion", resolvedComponentVersion.componentVersion())
215+
.kv("versionRequirements", versionRequirements).log("This component version has been"
216+
+ " discontinued by its publisher. You can deploy this component version, but we"
217+
+ " recommend that you use a different version of this component");
218+
}
209219
} catch (InterruptedException e) {
210220
throw e;
211221
} catch (NoAvailableComponentVersionException e) {

0 commit comments

Comments
 (0)