@@ -8,15 +8,15 @@ package main
88import (
99 "log"
1010
11- certv1alpha1 "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha1 "
11+ certv1 "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1 "
1212 "github.com/pkg/errors"
1313 "k8s.io/apimachinery/pkg/runtime"
1414 "k8s.io/apimachinery/pkg/runtime/schema"
1515
16- "github.com/vmware/octant/pkg/plugin"
17- "github.com/vmware/octant/pkg/plugin/service"
18- "github.com/vmware/octant/pkg/store"
19- "github.com/vmware/octant/pkg/view/component"
16+ "github.com/vmware-tanzu /octant/pkg/plugin"
17+ "github.com/vmware-tanzu /octant/pkg/plugin/service"
18+ "github.com/vmware-tanzu /octant/pkg/store"
19+ "github.com/vmware-tanzu /octant/pkg/view/component"
2020)
2121
2222var pluginName = "certificates.certmanager.k8s.io"
@@ -26,10 +26,10 @@ func main() {
2626 // Remove the prefix from the go logger since Octant will print logs with timestamps.
2727 log .SetPrefix ("" )
2828
29- // This plugin is interested in Pods
30- certGVK := schema.GroupVersionKind {Group : "certmanager.k8s. io" , Version : "v1alpha1 " , Kind : "Certificate" }
29+ // This plugin is interested in certificates
30+ certGVK := schema.GroupVersionKind {Group : "cert-manager. io" , Version : "v1 " , Kind : "Certificate" }
3131
32- // Tell Octant to call this plugin when printing configuration or tabs for Pods
32+ // Tell Octant to call this plugin when printing configuration for certificates
3333 capabilities := & plugin.Capabilities {
3434 SupportsPrinterConfig : []schema.GroupVersionKind {certGVK },
3535 IsModule : false ,
@@ -63,17 +63,17 @@ func handlePrint(request *service.PrintRequest) (plugin.PrintResponse, error) {
6363 if err != nil {
6464 return plugin.PrintResponse {}, err
6565 }
66- u , found , err := request .DashboardClient .Get (request .Context (), key )
66+ u , err := request .DashboardClient .Get (request .Context (), key )
6767 if err != nil {
6868 return plugin.PrintResponse {}, err
6969 }
7070
7171 // The plugin can check if the object it requested exists.
72- if ! found {
72+ if u == nil {
7373 return plugin.PrintResponse {}, errors .New ("object doesn't exist" )
7474 }
7575
76- var cert certv1alpha1 .Certificate
76+ var cert certv1 .Certificate
7777 err = runtime .DefaultUnstructuredConverter .FromUnstructured (u .UnstructuredContent (), & cert )
7878 if err != nil {
7979 return plugin.PrintResponse {}, err
@@ -87,7 +87,7 @@ func handlePrint(request *service.PrintRequest) (plugin.PrintResponse, error) {
8787 dnsNameComp = component .NewText (dnsname )
8888 dnsNameList = append (dnsNameList , dnsNameComp )
8989 }
90- config = append (config , component.SummarySection {Header : "DNS Names" , Content : component .NewList ("" , dnsNameList )})
90+ config = append (config , component.SummarySection {Header : "DNS Names" , Content : component .NewList (component . TitleFromString ( "" ) , dnsNameList )})
9191 // When printing an object, you can create multiple types of content. In this
9292 // example, the plugin is:
9393 //
0 commit comments