Create node-password secrets with custom Type

Allows list/watch node password secrets with fieldselector

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
Brad Davidson 2025-10-21 19:14:30 +00:00 committed by Brad Davidson
parent d622b18c20
commit 139d64c129

View file

@ -18,6 +18,8 @@ var (
// Hasher provides the algorithm for generating and verifying hashes
Hasher = hash.NewSCrypt()
ErrVerifyFailed = errVerifyFailed()
SecretTypeNodePassword = v1.SecretType(version.Program + ".cattle.io/node-password")
)
type passwordError struct {
@ -78,6 +80,7 @@ func Ensure(secretClient coreclient.SecretController, nodeName, pass string) err
},
Immutable: ptr.To(true),
Data: map[string][]byte{"hash": []byte(hash)},
Type: SecretTypeNodePassword,
})
}
return err