Use local paths when possible, some AI cleanup
This commit is contained in:
@ -201,8 +201,8 @@ func TestValidateClusterConfiguration_InvalidValues(t *testing.T) {
|
||||
ApiPort: 10251,
|
||||
EtcdPeerPort: 2380,
|
||||
EtcdClientPort: 2379,
|
||||
VolumeBasePath: "/var/lib/kat/volumes",
|
||||
BackupPath: "/var/lib/kat/backups",
|
||||
VolumeBasePath: "~/.kat/volumes",
|
||||
BackupPath: "~/.kat/backups",
|
||||
BackupIntervalMinutes: 30,
|
||||
AgentTickSeconds: 15,
|
||||
NodeLossTimeoutSeconds: 60,
|
||||
|
@ -11,13 +11,13 @@ const (
|
||||
DefaultApiPort = 9115
|
||||
DefaultEtcdPeerPort = 2380
|
||||
DefaultEtcdClientPort = 2379
|
||||
DefaultVolumeBasePath = "/var/lib/kat/volumes"
|
||||
DefaultBackupPath = "/var/lib/kat/backups"
|
||||
DefaultVolumeBasePath = "~/.kat/volumes"
|
||||
DefaultBackupPath = "~/.kat/backups"
|
||||
DefaultBackupIntervalMins = 30
|
||||
DefaultAgentTickSeconds = 15
|
||||
DefaultNodeLossTimeoutSec = 60 // DefaultNodeLossTimeoutSeconds = DefaultAgentTickSeconds * 4 (example logic)
|
||||
DefaultNodeSubnetBits = 7 // yields /23 from /16, or /31 from /24 etc. (5 bits for /29, 7 for /25)
|
||||
// RFC says 7 for /23 from /16. This means 2^(32-16-7) = 2^9 = 512 IPs per node subnet.
|
||||
// If nodeSubnetBits means bits for the node portion *within* the host part of clusterCIDR:
|
||||
// e.g. /16 -> 16 host bits. If nodeSubnetBits = 7, then node subnet is / (16+7) = /23.
|
||||
)
|
||||
// RFC says 7 for /23 from /16. This means 2^(32-16-7) = 2^9 = 512 IPs per node subnet.
|
||||
// If nodeSubnetBits means bits for the node portion *within* the host part of clusterCIDR:
|
||||
// e.g. /16 -> 16 host bits. If nodeSubnetBits = 7, then node subnet is / (16+7) = /23.
|
||||
)
|
||||
|
@ -1,15 +1,11 @@
|
||||
package pki
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"crypto/rsa"
|
||||
"crypto/x509"
|
||||
"crypto/x509/pkix"
|
||||
"encoding/pem"
|
||||
"fmt"
|
||||
"net"
|
||||
"os"
|
||||
"time"
|
||||
)
|
||||
|
||||
// ParseCSRFromBytes parses a PEM-encoded CSR from bytes
|
||||
|
@ -87,7 +87,7 @@ func TestSignCertificateRequest(t *testing.T) {
|
||||
|
||||
// Sign CSR
|
||||
certPath := filepath.Join(tempDir, "node.crt")
|
||||
err = SignCertificateRequest(caKeyPath, caCertPath, csrData, certPath, 30) // 30 days validity
|
||||
err = SignCertificateRequest(caKeyPath, caCertPath, string(csrData), certPath, 30) // 30 days validity
|
||||
if err != nil {
|
||||
t.Fatalf("SignCertificateRequest failed: %v", err)
|
||||
}
|
||||
|
@ -51,8 +51,8 @@ spec:
|
||||
apiPort: 9115
|
||||
etcdPeerPort: 2380
|
||||
etcdClientPort: 2379
|
||||
volumeBasePath: "/var/lib/kat/volumes"
|
||||
backupPath: "/var/lib/kat/backups"
|
||||
volumeBasePath: "~/.kat/volumes"
|
||||
backupPath: "~/.kat/backups"
|
||||
backupIntervalMinutes: 30
|
||||
agentTickSeconds: 15
|
||||
nodeLossTimeoutSeconds: 60
|
||||
|
Reference in New Issue
Block a user