Skip to content

Commit

Permalink
Fix casting for cert v1b1 approval (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
nitishkrishna authored Nov 30, 2021
1 parent 7be76ba commit 66af193
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/kube/kube_fake.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,17 @@ func (h *fakeKube) ServeHTTP(w http.ResponseWriter, r *http.Request) {
APIVersion: "certificates.k8s.io/v1beta1",
Kind: "CertificateSigningRequest",
}
csReq.Status.Certificate = []byte("cert")
data, err = apiruntime.Encode(unstructured.UnstructuredJSONScheme, csReq)
} else {
csReq.TypeMeta = metav1.TypeMeta{
APIVersion: "certificates.k8s.io/v1",
Kind: "CertificateSigningRequest",
}
csReq.Status.Certificate = []byte("cert")
data, err = apiruntime.Encode(unstructured.UnstructuredJSONScheme, csReq)
}
csReq.Status.Certificate = []byte("cert")
data, err = apiruntime.Encode(unstructured.UnstructuredJSONScheme, csReq)

if err != nil {
http.Error(w, err.Error(), http.StatusBadRequest)
return
Expand Down

0 comments on commit 66af193

Please sign in to comment.