fix(kubernetes): surface dockerRegistries to credentials endpoint
MODIFY
clouddriver-kubernetes-v2/src/main/java/com/netflix/spinnaker/clouddriver/kubernetes/v2/security/KubernetesV2Credentials.java
clouddriver-kubernetes-v2/src/main/java/com/netflix/spinnaker/clouddriver/kubernetes/v2/security/KubernetesV2Credentials.java
@@ -35,6 +35,7 @@ import com.netflix.spinnaker.clouddriver.kubernetes.KubernetesCloudProvider;
import com.netflix.spinnaker.clouddriver.kubernetes.config.CustomKubernetesResource;
import com.netflix.spinnaker.clouddriver.kubernetes.config.KubernetesCachingPolicy;
import com.netflix.spinnaker.clouddriver.kubernetes.config.KubernetesConfigurationProperties;
+import com.netflix.spinnaker.clouddriver.kubernetes.config.LinkedDockerRegistryConfiguration;
import com.netflix.spinnaker.clouddriver.kubernetes.security.KubeconfigFileHasher;
import com.netflix.spinnaker.clouddriver.kubernetes.security.KubernetesCredentialFactory;
import com.netflix.spinnaker.clouddriver.kubernetes.security.KubernetesCredentials;
@@ -400,6 +401,11 @@ public class KubernetesV2Credentials implements KubernetesCredentials {
return kindMap;
}
+ @Override
+ public List<LinkedDockerRegistryConfiguration> getDockerRegistries() {
+ return Collections.emptyList();
+ }
+
public KubernetesManifest get(KubernetesKind kind, String namespace, String name) {
return runAndRecordMetrics(
"get", kind, namespace, () -> jobExecutor.get(this, kind, namespace, name));

MODIFY
clouddriver-kubernetes/src/main/java/com/netflix/spinnaker/clouddriver/kubernetes/security/KubernetesCredentials.java
clouddriver-kubernetes/src/main/java/com/netflix/spinnaker/clouddriver/kubernetes/security/KubernetesCredentials.java
package com.netflix.spinnaker.clouddriver.kubernetes.security;
+import com.netflix.spinnaker.clouddriver.kubernetes.config.LinkedDockerRegistryConfiguration;
import java.util.List;
import java.util.Map;
@@ -24,4 +25,6 @@ public interface KubernetesCredentials {
List<String> getDeclaredNamespaces();
Map<String, String> getSpinnakerKindMap();
+
+ List<LinkedDockerRegistryConfiguration> getDockerRegistries();
}

MODIFY
clouddriver-kubernetes/src/main/java/com/netflix/spinnaker/clouddriver/kubernetes/security/KubernetesNamedAccountCredentials.java
clouddriver-kubernetes/src/main/java/com/netflix/spinnaker/clouddriver/kubernetes/security/KubernetesNamedAccountCredentials.java
@@ -19,6 +19,7 @@ package com.netflix.spinnaker.clouddriver.kubernetes.security;
import static lombok.EqualsAndHashCode.Include;
import com.netflix.spinnaker.clouddriver.kubernetes.config.KubernetesConfigurationProperties.ManagedAccount;
+import com.netflix.spinnaker.clouddriver.kubernetes.config.LinkedDockerRegistryConfiguration;
import com.netflix.spinnaker.clouddriver.security.AccountCredentials;
import com.netflix.spinnaker.clouddriver.security.ProviderVersion;
import com.netflix.spinnaker.fiat.model.resources.Permissions;
@@ -87,4 +88,8 @@ public class KubernetesNamedAccountCredentials<C extends KubernetesCredentials>
public Map<String, String> getSpinnakerKindMap() {
return credentials.getSpinnakerKindMap();
}
+
+ public List<LinkedDockerRegistryConfiguration> getDockerRegistries() {
+ return credentials.getDockerRegistries();
+ }
}

fix(kubernetes): surface dockerRegistries to credentials endpoint (#4134)