You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add webhook validation for PTP secrets and context-based merge logic
Add validateSecretExists() to verify ptpSecretName references exist
Add validateSppInSecret() to validate SPP numbers against secret data
Implement context-based merge to distinguish controller sources
PtpConfig controller: use security volumes from updated (supports deletion)
PtpOperatorConfig controller: preserve security volumes from current
Update merge logic for volumes, annotations, and volume mounts
Add controller source constants to apply package
Update all tests to pass context parameter
Add PTP authentication testing support with conditional enablement
Add configure-switch-ptp-security.sh script to configure external switch
Add ptp-security.yaml template with security associations (SPP 0 and 1)
Add GetPtp4lConfigWithAuth() to conditionally inject auth settings
Add PtpSecretName field conditionally based on PTP_AUTH_ENABLED
Add negative test for SPP mismatch validation (2-minute check)
Update run-ci-github.sh to configure switch and run auth-enabled tests
Apply auth settings to all config creation functions (GM, slave, BC, etc)
Add PTP authentication security tests for attack scenarios
Add rogue client injection test: verifies unauthenticated clients are blocked
Add MITM protection test: verifies tampered messages with wrong keys are dropped
Add replay attack test: verifies seqid_window is configured for anti-replay
Implement robust cleanup with delete and recreate for test-slave1
Add pod stabilization waits between tests to prevent race conditions
Include optional log validation for authentication failure messages
ifcurrentSecret, found:=currentSaFileToSecret[saFile]; found {
298
+
// Conflict: same sa_file but different secret
299
+
ifcurrentSecret!=*profile.PtpSecretName {
300
+
returnfmt.Errorf("sa_file '%s' conflict: PtpConfig '%s' already uses secret '%s' with this sa_file path, but this PtpConfig tries to use secret '%s'. All PtpConfigs using the same sa_file must reference the same secret",
// Try to get the secret from openshift-ptp namespace
332
+
secret:=&corev1.Secret{}
333
+
err:=webhookClient.Get(ctx, types.NamespacedName{
334
+
Namespace: "openshift-ptp",
335
+
Name: secretName,
336
+
}, secret)
337
+
338
+
iferr!=nil {
339
+
ifapierrors.IsNotFound(err) {
340
+
returnfmt.Errorf("secret '%s' referenced by profile '%s' does not exist in namespace 'openshift-ptp'. Please create the secret before referencing it in PtpConfig",
341
+
secretName, profileName)
342
+
}
343
+
// For other errors (like permission issues), log but don't block
344
+
ptpconfiglog.Error(err, "failed to verify secret existence", "secret", secretName, "profile", profileName)
0 commit comments