forked from rook/rook
Merge pull request #4865 from nizamial09/credential
rook: Fixing the potential hardcoded credential warnings
This commit is contained in:
@@ -39,7 +39,7 @@ import (
|
||||
|
||||
const (
|
||||
crashCollectorKeyringUsername = "client.crash"
|
||||
crashCollectorSecretName = "rook-ceph-crash-collector-keyring"
|
||||
crashCollectorKeyName = "rook-ceph-crash-collector-keyring"
|
||||
)
|
||||
|
||||
// ClusterResource operator-kit Custom Resource Definition
|
||||
|
||||
@@ -80,7 +80,7 @@ func createOrUpdateCrashCollectorSecret(namespace, crashCollectorSecretKey strin
|
||||
|
||||
s := &corev1.Secret{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: crashCollectorSecretName,
|
||||
Name: crashCollectorKeyName,
|
||||
Namespace: namespace,
|
||||
},
|
||||
Data: crashCollectorSecret,
|
||||
|
||||
@@ -34,10 +34,11 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
dashboardModuleName = "dashboard"
|
||||
dashboardPortHTTPS = 8443
|
||||
dashboardPortHTTP = 7000
|
||||
dashboardUsername = "admin"
|
||||
dashboardModuleName = "dashboard"
|
||||
dashboardPortHTTPS = 8443
|
||||
dashboardPortHTTP = 7000
|
||||
dashboardUsername = "admin"
|
||||
// #nosec because of the word `Password`
|
||||
dashboardPasswordName = "rook-ceph-dashboard-password"
|
||||
passwordLength = 20
|
||||
passwordKeyName = "password"
|
||||
@@ -273,6 +274,7 @@ func (c *Cluster) getOrGenerateDashboardPassword() (string, error) {
|
||||
}
|
||||
|
||||
func generatePassword(length int) (string, error) {
|
||||
// #nosec because of the word password
|
||||
const passwordChars = "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
|
||||
passwd, err := generateRandomBytes(length)
|
||||
if err != nil {
|
||||
|
||||
@@ -25,6 +25,7 @@ import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// #nosec because of the word `Secret`
|
||||
const (
|
||||
csiKeyringRBDProvisionerUsername = "client.csi-rbd-provisioner"
|
||||
csiKeyringRBDNodeUsername = "client.csi-rbd-node"
|
||||
@@ -32,6 +33,7 @@ const (
|
||||
csiRBDProvisionerSecret = "rook-csi-rbd-provisioner"
|
||||
)
|
||||
|
||||
// #nosec because of the word `Secret`
|
||||
const (
|
||||
csiKeyringCephFSProvisionerUsername = "client.csi-cephfs-provisioner"
|
||||
csiKeyringCephFSNodeUsername = "client.csi-cephfs-node"
|
||||
|
||||
@@ -67,9 +67,11 @@ func NewPodSpecTester(t *testing.T, spec *v1.PodSpec) *PodSpecTester {
|
||||
func (ps *PodSpecTester) AssertVolumesMeetCephRequirements(
|
||||
daemonType config.DaemonType, daemonID string,
|
||||
) {
|
||||
// #nosec because of the word `Secret`
|
||||
keyringSecretName := fmt.Sprintf("rook-ceph-%s-%s-keyring", daemonType, daemonID)
|
||||
if daemonType == config.MonType {
|
||||
keyringSecretName = "rook-ceph-mons-keyring" // mons share a keyring
|
||||
// #nosec because of the word `Secret`
|
||||
keyringSecretName = "rook-ceph-mons-keyring"
|
||||
}
|
||||
requiredVols := []string{"rook-config-override", keyringSecretName}
|
||||
if daemonType != config.RbdMirrorType {
|
||||
|
||||
@@ -32,7 +32,8 @@ import (
|
||||
const (
|
||||
// DefaultContainerMaxCapacity - max allowed container disks capacity, if exeeded then new new container will be added
|
||||
DefaultContainerMaxCapacity = "132Ti"
|
||||
S3PayloadSecretsPath = "/opt/nedge/etc/secrets/"
|
||||
// #nosec because of the word `Secret`
|
||||
S3PayloadSecretsPath = "/opt/nedge/etc/secrets/"
|
||||
)
|
||||
|
||||
// CreateQualifiedHeadlessServiceName creates a qualified name of the headless service for a given replica id and namespace,
|
||||
|
||||
Reference in New Issue
Block a user