@@ -879,15 +879,17 @@ func installCertManager() {
879879
880880 if installOlm {
881881 installOLMCertManager ()
882+ installCertManagerClusterIssuer ("default" )
882883 } else {
883884 installCertManagerSlim ()
885+ installCertManagerClusterIssuer ("cert-manager" )
884886 }
885887}
886888
887889func installCertManagerSlim () {
888890
889- kuberoUIInstalled , _ := exec .Command ("kubectl" , "get" , "crd" , "certificates.cert-manager.io" ).Output ()
890- if len (kuberoUIInstalled ) > 0 {
891+ checkInstalled , _ := exec .Command ("kubectl" , "get" , "crd" , "certificates.cert-manager.io" ).Output ()
892+ if len (checkInstalled ) > 0 {
891893 _ , _ = cfmt .Println ("{{✓ CertManager already installed}}::lightGreen" )
892894 return
893895 }
@@ -912,19 +914,30 @@ func installCertManagerSlim() {
912914 }
913915 certManagerSpinner .Success ("Cert Manager installed" )
914916
915- installCertManagerClusterIssuer ("cert-manager" )
916-
917917}
918918
919919func installCertManagerClusterIssuer (namespace string ) {
920920
921+ checkInstalled , _ := exec .Command ("kubectl" , "get" , "ClusterIssuer" ).Output ()
922+ if len (checkInstalled ) > 0 {
923+ _ , _ = cfmt .Println ("{{✓ CertManager ClusterIssuer already installed}}::lightGreen" )
924+ return
925+ }
926+
921927 installer := resty .New ()
922928
923929 installer .SetBaseURL ("https://raw.githubusercontent.com" )
924- kf , _ := installer .R ().Get ("kubero-dev/kubero-cli/main/templates/certManagerClusterIssuer.prod.yaml" )
930+ kf , err := installer .R ().Get ("kubero-dev/kubero-cli/refs/heads/main/templates/certmanagerClusterIssuer.prod.yaml" )
931+ if err != nil {
932+ fmt .Println (err )
933+ cfmt .Println ("{{✗ Failed to create CertManager ClusterIssuer. Rerunn command after finalized installer with: kubero install -c certManager}}::red" )
934+ }
925935
926936 var certManagerClusterIssuer CertManagerClusterIssuer
927- _ = yaml .Unmarshal (kf .Body (), & certManagerClusterIssuer )
937+ err = yaml .Unmarshal (kf .Body (), & certManagerClusterIssuer )
938+ if err != nil {
939+ fmt .Println (err )
940+ }
928941
929942 argCertManagerContact := promptLine ("6.1) Letsencrypt ACME contact email" , "" , "noreply@yourdomain.com" )
930943 certManagerClusterIssuer .Spec .Acme .Email = argCertManagerContact
@@ -986,7 +999,6 @@ func installOLMCertManager() {
986999 }
9871000 certManagerSpinner .Success ("Cert Manager is ready" )
9881001
989- installCertManagerClusterIssuer ("default" )
9901002}
9911003
9921004func writeCLIConfig () {
0 commit comments