File tree 2 files changed +14
-11
lines changed
2 files changed +14
-11
lines changed Original file line number Diff line number Diff line change 1
1
package main
2
2
3
3
import (
4
- "os"
5
-
6
- v1 "github.com/rancher/system-upgrade-controller/pkg/apis/upgrade.cattle.io/v1"
7
4
_ "github.com/rancher/system-upgrade-controller/pkg/generated/controllers/upgrade.cattle.io/v1"
5
+ "github.com/rancher/system-upgrade-controller/pkg/upgrade/plan"
8
6
"github.com/rancher/wrangler/pkg/crd"
7
+ "os"
9
8
)
10
9
11
10
func main () {
12
- plan := crd . NamespacedType ( "Plan.upgrade.cattle.io/v1" ).
13
- WithSchemaFromStruct (v1. Plan {}).
14
- WithColumn ( "Image" , ".spec.upgrade.image" ).
15
- WithColumn ( "Channel" , ".spec.channel" ).
16
- WithColumn ( "Version" , ".spec.version" )
17
- crd .Print (os .Stdout , []crd.CRD {plan })
11
+ planCrd , err := plan . CRD ()
12
+ if err != nil {
13
+ print ( err )
14
+ return
15
+ }
16
+ crd .Print (os .Stdout , []crd.CRD {* planCrd })
18
17
}
Original file line number Diff line number Diff line change @@ -49,13 +49,17 @@ func CRD() (*crd.CRD, error) {
49
49
if err != nil {
50
50
return nil , err
51
51
}
52
- return & crd.CRD {
52
+ plan := crd.CRD {
53
53
GVK : prototype .GroupVersionKind (),
54
54
PluralName : upgradeapiv1 .PlanResourceName ,
55
55
Status : true ,
56
56
Schema : schema ,
57
57
Categories : []string {"upgrade" },
58
- }, nil
58
+ }.
59
+ WithColumn ("Image" , ".spec.upgrade.image" ).
60
+ WithColumn ("Channel" , ".spec.channel" ).
61
+ WithColumn ("Version" , ".spec.version" )
62
+ return & plan , nil
59
63
}
60
64
61
65
func DigestStatus (plan * upgradeapiv1.Plan , secretCache corectlv1.SecretCache ) (upgradeapiv1.PlanStatus , error ) {
You can’t perform that action at this time.
0 commit comments