func (tc *testContext) approve(csr *certificates.CertificateSigningRequest) error {
	// Add the approval status condition
	csr.Status.Conditions = append(csr.Status.Conditions, certificates.CertificateSigningRequestCondition{
		Type:           certificates.CertificateApproved,
		Reason:         "WMCOe2eTestRunnerApprove",
		Message:        "This CSR was approved by WMCO runner",
		LastUpdateTime: metav1.Now(),
		Status:         v1.ConditionTrue,
	})

	_, err := tc.client.K8s.CertificatesV1().CertificateSigningRequests().UpdateApproval(context.TODO(), csr.GetName(),
		csr, metav1.UpdateOptions{})
	return err
}
// TODO: vSphere CSRs are not being approved due to a hostname mismatch. This is an issue only because the
//       ConfigMap controller does not have the ability to approve CSRs yet. This needs to be removed when that
//       functionality is added in https://issues.redhat.com/browse/WINC-581
// approve approves the given CSR if it has not already been approved
// Based on https://github.com/kubernetes/kubectl/blob/master/pkg/cmd/certificates/certificates.go#L237
vSphere CSRs are not being approved due to a hostname mismatch. This is an issue only because the
ConfigMap controller does not have the ability to approve CSRs yet.
// TODO : vSphere CSRs are not being approved due to a hostname mismatch . This is an issue only because the // ConfigMap controller does not have the ability to approve CSRs yet . This needs to be removed when that // functionality is added in https : // issues . redhat . com / browse / WINC - 581 // approve approves the given CSR if it has not already been approved // Based on https : // github . com / kubernetes / kubectl / blob / master / pkg / cmd / certificates / certificates . go#L237
func (tc *testContext) approve(csr *certificates.CertificateSigningRequest) error {
	csr.Status.Conditions = append(csr.Status.Conditions, certificates.CertificateSigningRequestCondition{
		Type:           certificates.CertificateApproved,
		Reason:         "WMCOe2eTestRunnerApprove",
		Message:        "This CSR was approved by WMCO runner",
		LastUpdateTime: metav1.Now(),
		Status:         v1.ConditionTrue,
	})
	_, err := tc.client.K8s.CertificatesV1().CertificateSigningRequests().UpdateApproval(context.TODO(), csr.GetName(),
		csr, metav1.UpdateOptions{})
	return err
}
func ( tc * testContext ) approve ( csr * certificates . CertificateSigningRequest ) error { csr . Status . Conditions = append ( csr . Status . Conditions , certificates . CertificateSigningRequestCondition { Type : certificates . CertificateApproved , Reason : " " , Message : " " , LastUpdateTime : metav1 . Now ( ) , Status : v1 . ConditionTrue , } ) _ , err := tc . client . K8s . CertificatesV1 ( ) . CertificateSigningRequests ( ) . UpdateApproval ( context . TODO ( ) , csr . GetName ( ) , csr , metav1 . UpdateOptions { } ) return err }
vSphere CSRs are not being approved due to a hostname mismatch.
vSphere CSRs are not being approved due to a hostname mismatch .
// Add the approval status condition