INNER CODE UNIT · Go

isTooOld

syself/cluster-api-provider-hetzner · controllers/csr_controller.go:105

	isTooOld := certificateSigningRequest.CreationTimestamp.Before(&metav1.Time{Time: time.Now().Add(-1 * time.Hour)})
	if isTooOld {
		condition.Type = certificatesv1.CertificateDenied
		condition.Reason = "CSRTooOld"
		condition.Status = "True"
		condition.Message = "csr ist too old"
	} else {
		// get machine addresses from corresponding machine
		machineAddresses, isHCloudMachine, err := r.getMachineAddresses(ctx, certificateSigningRequest)
		if errors.Is(err, errNoHetznerBareMetalMachineByProviderIDFound) {
			log.Info(fmt.Sprintf("ProviderID not set yet. The hbmm seems to be in 'ensure-provision'. Retrying. %s",
				err.Error()))
			return reconcile.Result{RequeueAfter: 5 * time.Second}, nil
		}
		if err != nil {
			log.Error(err, "could not find an associated bm machine or hcloud machine",
				"userName", certificateSigningRequest.Spec.Username)
			return reconcile.Result{RequeueAfter: 20 * time.Second}, nil

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…