Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Print HTPasswd user credentials #1099

Merged
merged 3 commits into from
Feb 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/tasks/che.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { KubeHelper } from '../api/kube'
import { OpenShiftHelper } from '../api/openshift'
import { VersionHelper } from '../api/version'
import { CHE_OPERATOR_SELECTOR, DOC_LINK, DOC_LINK_RELEASE_NOTES, OUTPUT_SEPARATOR } from '../constants'
import { base64Decode } from '../util'

import { KubeTasks } from './kube'

Expand Down Expand Up @@ -675,7 +676,20 @@ export class CheTasks {

const cheUrl = await this.che.cheURL(flags.chenamespace)
messages.push(`Users Dashboard : ${cheUrl}`)
messages.push('Admin user login : "admin:admin". NOTE: must change after first login.')

const cr = await this.kube.getCheCluster(flags.chenamespace)
if (ctx.isOpenShift && cr && cr.spec && cr.spec.auth && cr.spec.auth.openShiftoAuth) {
AndrienkoAleksandr marked this conversation as resolved.
Show resolved Hide resolved
if (cr.status && cr.status.openShiftOAuthUserCredentialsSecret) {
const credentialsSecret = await this.kube.getSecret(cr.status.openShiftOAuthUserCredentialsSecret, flags.chenamespace)
if (credentialsSecret) {
const user = base64Decode(credentialsSecret.data!.user)
const password = base64Decode(credentialsSecret.data!.password)
messages.push(`HTPasswd user credentials : "${user}:${password}".`)
}
}
} else {
messages.push('Admin user login : "admin:admin". NOTE: must change after first login.')
}
messages.push(OUTPUT_SEPARATOR)

const cheConfigMap = await this.kube.getConfigMap('che', flags.chenamespace)
Expand Down