Skip to content

Commit 138c602

Browse files
committed
Update UserSpec documentation
Describe the new structure of the `importCredentialsSecret` field
1 parent 58d496c commit 138c602

File tree

3 files changed

+31
-18
lines changed

3 files changed

+31
-18
lines changed

api/v1beta1/user_types.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,15 @@ type UserSpec struct {
2727
// exist for the User object to be created.
2828
// +kubebuilder:validation:Required
2929
RabbitmqClusterReference RabbitmqClusterReference `json:"rabbitmqClusterReference"`
30-
// Defines a Secret used to pre-define the username and password set for this User. User objects created
31-
// with this field set will not have randomly-generated credentials, and will instead import
32-
// the username/password values from this Secret.
33-
// The Secret must contain the keys `username` and `password` in its Data field, or the import will fail.
34-
// Note that this import only occurs at creation time, and is ignored once a password has been set
35-
// on a User.
30+
// Defines a Secret containing the credentials for the User. If this field is omitted, random a username and
31+
// password will be generated. The Secret must have the following keys in its Data field:
32+
//
33+
// * `username` – Must be present or the import will fail.
34+
// * `passwordHash` – The SHA-512 hash of the password. If the hash is an empty string, a passwordless user
35+
// will be created. For more information, see https://www.rabbitmq.com/docs/passwords.
36+
// * `password` – Plain-text password. Will be used only if the `passwordHash` key is missing.
37+
//
38+
// Note that this import only occurs at creation time, and is ignored once a password has been set on a User.
3639
ImportCredentialsSecret *corev1.LocalObjectReference `json:"importCredentialsSecret,omitempty"`
3740
}
3841

config/crd/bases/rabbitmq.com_users.yaml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,17 @@ spec:
4343
properties:
4444
importCredentialsSecret:
4545
description: |-
46-
Defines a Secret used to pre-define the username and password set for this User. User objects created
47-
with this field set will not have randomly-generated credentials, and will instead import
48-
the username/password values from this Secret.
49-
The Secret must contain the keys `username` and `password` in its Data field, or the import will fail.
50-
Note that this import only occurs at creation time, and is ignored once a password has been set
51-
on a User.
46+
Defines a Secret containing the credentials for the User. If this field is omitted, random a username and
47+
password will be generated. The Secret must have the following keys in its Data field:
48+
49+
50+
* `username` – Must be present or the import will fail.
51+
* `passwordHash` – The SHA-512 hash of the password. If the hash is an empty string, a passwordless user
52+
will be created. For more information, see https://www.rabbitmq.com/docs/passwords.
53+
* `password` – Plain-text password. Will be used only if the `passwordHash` key is missing.
54+
55+
56+
Note that this import only occurs at creation time, and is ignored once a password has been set on a User.
5257
properties:
5358
name:
5459
default: ""

docs/api/rabbitmq.com.ref.asciidoc

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,12 +1411,17 @@ but cannot perform any management actions.
14111411
For more information, see https://www.rabbitmq.com/management.html#permissions.
14121412
| *`rabbitmqClusterReference`* __xref:{anchor_prefix}-github-com-rabbitmq-messaging-topology-operator-api-v1beta1-rabbitmqclusterreference[$$RabbitmqClusterReference$$]__ | Reference to the RabbitmqCluster that the user will be created for. This cluster must
14131413
exist for the User object to be created.
1414-
| *`importCredentialsSecret`* __link:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#localobjectreference-v1-core[$$LocalObjectReference$$]__ | Defines a Secret used to pre-define the username and password set for this User. User objects created
1415-
with this field set will not have randomly-generated credentials, and will instead import
1416-
the username/password values from this Secret.
1417-
The Secret must contain the keys `username` and `password` in its Data field, or the import will fail.
1418-
Note that this import only occurs at creation time, and is ignored once a password has been set
1419-
on a User.
1414+
| *`importCredentialsSecret`* __link:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#localobjectreference-v1-core[$$LocalObjectReference$$]__ | Defines a Secret containing the credentials for the User. If this field is omitted, random a username and
1415+
password will be generated. The Secret must have the following keys in its Data field:
1416+
1417+
1418+
* `username` – Must be present or the import will fail.
1419+
* `passwordHash` – The SHA-512 hash of the password. If the hash is an empty string, a passwordless user
1420+
will be created. For more information, see https://www.rabbitmq.com/docs/passwords.
1421+
* `password` – Plain-text password. Will be used only if the `passwordHash` key is missing.
1422+
1423+
1424+
Note that this import only occurs at creation time, and is ignored once a password has been set on a User.
14201425
|===
14211426

14221427

0 commit comments

Comments
 (0)