Skip to content

Commit

Permalink
fix(kubernetes): Add Json annotations (#3991)
Browse files Browse the repository at this point in the history
These annotations were dropped in converting KubernetesKind;
this means that we're serializing a KubernetesKind as a full
object rather than just as a string. This slightly changes the
result of calls to /serverGroups and /loadBalancers as now the
'kind' field is an object not a string. This could cause issues
with consumers that expect a specific format; our integration tests
expect to see just a string there which is how I found this.
  • Loading branch information
ezimanyi committed Aug 29, 2019
1 parent 9526c10 commit c71ba04
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

package com.netflix.spinnaker.clouddriver.kubernetes.v2.description.manifest;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import javax.annotation.Nonnull;
Expand Down Expand Up @@ -131,6 +133,7 @@ public static KubernetesKind from(@Nullable String name, @Nullable KubernetesApi
}

@Nonnull
@JsonCreator
public static KubernetesKind fromString(@Nonnull String qualifiedKind) {
KubernetesApiGroup apiGroup;
String kindName;
Expand All @@ -146,6 +149,7 @@ public static KubernetesKind fromString(@Nonnull String qualifiedKind) {
}

@Override
@JsonValue
public String toString() {
if (apiGroup.isNativeGroup()) {
return name;
Expand Down

0 comments on commit c71ba04

Please sign in to comment.