fix(kubernetes): add param to KubernetesAtomicOperationDescription to prevent having to cast credentials
MODIFY
clouddriver-kubernetes-v2/src/main/java/com/netflix/spinnaker/clouddriver/kubernetes/v2/description/manifest/KubernetesManifestOperationDescription.java
clouddriver-kubernetes-v2/src/main/java/com/netflix/spinnaker/clouddriver/kubernetes/v2/description/manifest/KubernetesManifestOperationDescription.java
@@ -20,13 +20,15 @@ package com.netflix.spinnaker.clouddriver.kubernetes.v2.description.manifest;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.netflix.spinnaker.clouddriver.kubernetes.description.KubernetesAtomicOperationDescription;
import com.netflix.spinnaker.clouddriver.kubernetes.v2.description.KubernetesCoordinates;
+import com.netflix.spinnaker.clouddriver.kubernetes.v2.security.KubernetesV2Credentials;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.tuple.Pair;
@EqualsAndHashCode(callSuper = true)
@Data
-public class KubernetesManifestOperationDescription extends KubernetesAtomicOperationDescription {
+public class KubernetesManifestOperationDescription
+ extends KubernetesAtomicOperationDescription<KubernetesV2Credentials> {
private String manifestName;
private String location;

MODIFY
clouddriver-kubernetes-v2/src/main/java/com/netflix/spinnaker/clouddriver/kubernetes/v2/op/manifest/KubernetesRollingRestartManifestOperation.java
clouddriver-kubernetes-v2/src/main/java/com/netflix/spinnaker/clouddriver/kubernetes/v2/op/manifest/KubernetesRollingRestartManifestOperation.java
@@ -35,7 +35,7 @@ public class KubernetesRollingRestartManifestOperation implements AtomicOperatio
public KubernetesRollingRestartManifestOperation(
KubernetesRollingRestartManifestDescription description) {
this.description = description;
- this.credentials = (KubernetesV2Credentials) description.getCredentials().getCredentials();
+ this.credentials = description.getCredentials().getCredentials();
}
private static Task getTask() {

MODIFY
clouddriver-kubernetes/src/main/java/com/netflix/spinnaker/clouddriver/kubernetes/description/KubernetesAtomicOperationDescription.java
clouddriver-kubernetes/src/main/java/com/netflix/spinnaker/clouddriver/kubernetes/description/KubernetesAtomicOperationDescription.java
@@ -19,6 +19,7 @@ package com.netflix.spinnaker.clouddriver.kubernetes.description;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.netflix.spinnaker.clouddriver.deploy.DeployDescription;
+import com.netflix.spinnaker.clouddriver.kubernetes.security.KubernetesCredentials;
import com.netflix.spinnaker.clouddriver.kubernetes.security.KubernetesNamedAccountCredentials;
import com.netflix.spinnaker.clouddriver.security.resources.CredentialsNameable;
import lombok.AllArgsConstructor;
@@ -28,10 +29,10 @@ import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
-public class KubernetesAtomicOperationDescription
+public class KubernetesAtomicOperationDescription<C extends KubernetesCredentials>
implements DeployDescription, CredentialsNameable {
@JsonProperty("account")
String account;
- KubernetesNamedAccountCredentials credentials;
+ KubernetesNamedAccountCredentials<C> credentials;
}

fix(kubernetes): add param to KubernetesAtomicOperationDescription to prevent having to cast credentials