Switch from ThirdPartyResources to CustomResourceDefinitions (#381)

Switch Fission's storage over to the new CustomResourceDefinitions, from the deprecated ThirdPartyResources. This allows us to be compatible with Kubernets 1.8 and onwards.

This also adds a CLI tool for dumping state from an old fission version and restoring state into new CRDs.

The storage service is unaffected by this change.
This commit is contained in:
Ta-Ching Chen
2017-11-04 14:55:16 -07:00
committed by Soam Vasani
parent 746c51901d
commit 5f14b9b0ae
76 changed files with 1223 additions and 701 deletions
+6 -6
View File
@@ -22,8 +22,8 @@ import (
"github.com/robfig/cron"
"github.com/fission/fission"
"github.com/fission/fission/crd"
"github.com/fission/fission/publisher"
"github.com/fission/fission/tpr"
)
type requestType int
@@ -41,14 +41,14 @@ type (
timerRequest struct {
requestType
triggers []tpr.Timetrigger
triggers []crd.TimeTrigger
responseChannel chan *timerResponse
}
timerResponse struct {
error
}
timerTriggerWithCron struct {
trigger tpr.Timetrigger
trigger crd.TimeTrigger
cron *cron.Cron
}
)
@@ -63,7 +63,7 @@ func MakeTimer(publisher publisher.Publisher) *Timer {
return timer
}
func (timer *Timer) Sync(triggers []tpr.Timetrigger) error {
func (timer *Timer) Sync(triggers []crd.TimeTrigger) error {
req := &timerRequest{
requestType: SYNC,
triggers: triggers,
@@ -85,7 +85,7 @@ func (timer *Timer) svc() {
}
}
func (timer *Timer) syncCron(triggers []tpr.Timetrigger) error {
func (timer *Timer) syncCron(triggers []crd.TimeTrigger) error {
// add new triggers or update existing ones
for _, t := range triggers {
if item, ok := timer.triggers[t.Metadata.Name]; ok {
@@ -137,7 +137,7 @@ func (timer *Timer) syncCron(triggers []tpr.Timetrigger) error {
return nil
}
func (timer *Timer) newCron(t tpr.Timetrigger) *cron.Cron {
func (timer *Timer) newCron(t crd.TimeTrigger) *cron.Cron {
c := cron.New()
c.AddFunc(t.Spec.Cron, func() {
headers := map[string]string{