-
Notifications
You must be signed in to change notification settings - Fork 590
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update running status of KIC node to Konnect (#3533)
* feat: update status of kic to konnect * resolve conflicts and add flag to set period of uploading node status * add comments * move config status pub/sub to interface * fix notify status * move subscribe config status interface to dataplane
- Loading branch information
1 parent
c63fbca
commit ea2ed68
Showing
7 changed files
with
201 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package dataplane | ||
|
||
type ConfigStatus int | ||
|
||
const ( | ||
// ConfigStatusOK: no error happens in translation from k8s objects to kong configuration | ||
// and succeeded to apply kong configuration to kong gateway. | ||
ConfigStatusOK ConfigStatus = iota | ||
// ConfigStatusTranslationErrorHappened: error happened in translation of k8s objects | ||
// but succeeded to apply kong configuration for remaining objects. | ||
ConfigStatusTranslationErrorHappened | ||
// ConfigStatusApplyFailed: failed to apply kong configurations. | ||
ConfigStatusApplyFailed | ||
) | ||
|
||
type ConfigStatusNotifier interface { | ||
NotifyConfigStatus(ConfigStatus) | ||
} | ||
|
||
type ConfigStatusSubscriber interface { | ||
SubscribeConfigStatus() chan ConfigStatus | ||
} | ||
|
||
type NoOpConfigStatusNotifier struct{} | ||
|
||
var _ ConfigStatusNotifier = NoOpConfigStatusNotifier{} | ||
|
||
func (n NoOpConfigStatusNotifier) NotifyConfigStatus(status ConfigStatus) { | ||
} | ||
|
||
type ChannelConfigNotifier struct { | ||
ch chan ConfigStatus | ||
} | ||
|
||
var _ ConfigStatusNotifier = &ChannelConfigNotifier{} | ||
|
||
func (n *ChannelConfigNotifier) NotifyConfigStatus(status ConfigStatus) { | ||
n.ch <- status | ||
} | ||
|
||
func (n *ChannelConfigNotifier) SubscribeConfigStatus() chan ConfigStatus { | ||
return n.ch | ||
} | ||
|
||
func NewChannelConfigNotifier() *ChannelConfigNotifier { | ||
return &ChannelConfigNotifier{ | ||
ch: make(chan ConfigStatus, 1), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters