Skip to content

Commit

Permalink
#1898: cluster setup: Harbor SSO login isn't working
Browse files Browse the repository at this point in the history
  • Loading branch information
jefflill committed Apr 29, 2024
1 parent fc81882 commit 2feeb0b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
7 changes: 0 additions & 7 deletions Lib/Neon.Kube.Setup/KubeSetup.Operations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5002,12 +5002,6 @@ await NeonHelper.WaitAllAsync(tasks,
await controlNode.InvokeIdempotentAsync("setup/harbor-login",
async () =>
{
// $todo(jefflill): This is failing!
//
// https://github.com/nforgeio/neonKUBE/issues/1898
await Task.CompletedTask;
#if TODO
var user = await KubeHelper.GetClusterLdapUserAsync(k8s, KubeConst.SysAdminUser);
var password = user.Password;
var command = $"echo '{password}' | podman login registry.neon.local --username {user.Name} --password-stdin";
Expand All @@ -5027,7 +5021,6 @@ await controlNode.InvokeIdempotentAsync("setup/harbor-login",
},
cancellationToken: controller.CancellationToken);
}
#endif
});

controller.ThrowIfCancelled();
Expand Down
19 changes: 17 additions & 2 deletions Lib/Neon.Kube.Setup/KubeSetup.PrepareCluster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -365,13 +365,28 @@ public static async Task<ISetupController> CreateClusterPrepareControllerAsync(
}
}
// We also need to generate the cluster's root SSO password, unless this was specified
// We also need to generate the cluster's [sysadmin] SSO password, unless this was specified
// in the cluster definition (typically for NEONDESKTOP clusters).
controller.SetGlobalStepStatus("generate: SSO password");
setupState.SsoUsername = KubeConst.SysAdminUser;
setupState.SsoPassword = clusterDefinition.SsoPassword ?? NeonHelper.GetCryptoRandomPassword(clusterDefinition.Security.PasswordLength);
if (clusterDefinition.SsoPassword != null)
{
setupState.SsoPassword = clusterDefinition.SsoPassword;
}
else
{
if (options.Insecure)
{
setupState.SsoPassword = KubeConst.SysAdminInsecurePassword;
}
else
{
setupState.SsoPassword = NeonHelper.GetCryptoRandomPassword(clusterDefinition.Security.PasswordLength);
}
}
setupState.Save();
});
Expand Down
2 changes: 1 addition & 1 deletion Lib/Neon.Kube.Setup/KubeSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public static ClusterDefinition GetDesktopClusterDefinition(HostingEnvironment h
clusterDefinition.Hosting.Hypervisor.VCpus = 3;
}

// Use the insecure password for NeonDESKTOP clusters.
// Use the insecure SSO password for NeonDESKTOP clusters.

clusterDefinition.SsoPassword = KubeConst.SysAdminInsecurePassword;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ stringData:
users.cfg: |
#################
# The users section contains a hardcoded list of valid users.
# to create a passSHA256: echo -n "mysecret" | openssl dgst -sha256
# to create a passSHA256: echo -n "mysecret" | openssl dgst -sha256
# This user record shows all of the possible fields available
[[users]]
Expand Down

0 comments on commit 2feeb0b

Please sign in to comment.