diff --git a/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesDeployments.java b/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesDeployments.java index 22376e6d76..be999e8bf6 100644 --- a/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesDeployments.java +++ b/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesDeployments.java @@ -1175,7 +1175,7 @@ public class KubernetesDeployments { @VisibleForTesting void addPullSecretsOfSA(Deployment deployment) throws InfrastructureException { final PodSpec podSpec = deployment.getSpec().getTemplate().getSpec(); - final String podServiceAccountName = podSpec.getServiceAccount(); + final String podServiceAccountName = podSpec.getServiceAccountName(); if (podServiceAccountName == null) { return; } @@ -1184,7 +1184,7 @@ public class KubernetesDeployments { .create(workspaceId) .serviceAccounts() .inNamespace(namespace) - .withName(podSpec.getServiceAccount()) + .withName(podServiceAccountName) .get(); if (deploymentServiceAccount == null) { return; diff --git a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesDeploymentsTest.java b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesDeploymentsTest.java index b393fee53f..ccbeda409e 100644 --- a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesDeploymentsTest.java +++ b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesDeploymentsTest.java @@ -728,7 +728,7 @@ public class KubernetesDeploymentsTest { .withMetadata(objectMeta) .withNewSpec() .withImagePullSecrets(imagePullSecrets) - .withServiceAccount(serviceAccountName) + .withServiceAccountName(serviceAccountName) .endSpec() .endTemplate() .build()) @@ -767,7 +767,7 @@ public class KubernetesDeploymentsTest { .withMetadata(objectMeta) .withNewSpec() .withImagePullSecrets(pullSecretOfPod) - .withServiceAccount("nonexistent-sa") + .withServiceAccountName("nonexistent-sa") .endSpec() .endTemplate() .build())