INNER CODE UNIT · Go

selectAppProtectAPIVersion

nginx/kubernetes-ingress · cmd/nginx-ingress/main.go:636

func selectAppProtectAPIVersion(ctx context.Context, plmEnabled bool, recorder record.EventRecorder, pod *api_v1.Pod) {
	l := nl.LoggerFromContext(ctx)
	version := appprotect.SelectAPIVersion(plmEnabled)
	// Defensive: SelectAPIVersion only returns values SetAPIVersion accepts.
	if err := appprotect.SetAPIVersion(version); err != nil {
		nl.Fatalf(l, "Invalid %s API version %q: %v", appprotect.APIGroup, version, err)
	}
	nl.Infof(l, "Using %s/%s CRDs", appprotect.APIGroup, version)
	recorder.Eventf(pod, api_v1.EventTypeNormal, nl.EventReasonAppProtectAPIVersionSelected,
		"Using %s/%s CRDs", appprotect.APIGroup, version)
}

// plmStorageSpec assembles the wafbundle.S3ConfigSpec from the PLM flags and
// the secret refs parsed once in flags.go (plmRefs). Endpoint is empty when
// PLM is disabled, which callers treat as "PLM off".
func plmStorageSpec() wafbundle.S3ConfigSpec {
	return wafbundle.S3ConfigSpec{
		Endpoint:           *plmStorageURL,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…