Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Proto Kms
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
danet
Proto Kms
Commits
a8c53294
Commit
a8c53294
authored
1 year ago
by
Martin Stiemerling
Browse files
Options
Downloads
Patches
Plain Diff
changed enum names
parent
19c921f3
No related branches found
No related tags found
1 merge request
!9
First working draft version
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kms/kmspeers.go
+7
-7
7 additions, 7 deletions
kms/kmspeers.go
with
7 additions
and
7 deletions
kms/kmspeers.go
+
7
−
7
View file @
a8c53294
...
@@ -15,10 +15,10 @@ import (
...
@@ -15,10 +15,10 @@ import (
type
KmsPeerStatus
int16
type
KmsPeerStatus
int16
const
(
const
(
k
msPeerUp
KmsPeerStatus
=
iota
// peer was seen up lately
K
msPeerUp
KmsPeerStatus
=
iota
// peer was seen up lately
k
msPeerDown
// peer not reachable anymore
K
msPeerDown
// peer not reachable anymore
k
msPeerPending
// peer was added and has to be succesfully contacted once
K
msPeerPending
// peer was added and has to be succesfully contacted once
k
msPeerUnknown
// not known, not initialized
K
msPeerUnknown
// not known, not initialized
)
)
type
kmsPeerInfo
interface
{
type
kmsPeerInfo
interface
{
...
@@ -68,7 +68,7 @@ func (ph *kmsPeer) PeerHandler(kmsName string) {
...
@@ -68,7 +68,7 @@ func (ph *kmsPeer) PeerHandler(kmsName string) {
r
,
err
:=
c
.
ETSICapabilities
(
ctx
,
&
pb
.
ETSICapabilitiesRequest
{
MyKmsName
:
kmsName
})
r
,
err
:=
c
.
ETSICapabilities
(
ctx
,
&
pb
.
ETSICapabilitiesRequest
{
MyKmsName
:
kmsName
})
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Printf
(
"could not greet: %v"
,
err
)
log
.
Printf
(
"could not greet: %v"
,
err
)
ph
.
peerStatus
=
k
msPeerDown
ph
.
peerStatus
=
K
msPeerDown
// Send notification about change
// Send notification about change
if
ph
.
externalNotifierKMSPeer
!=
nil
{
if
ph
.
externalNotifierKMSPeer
!=
nil
{
ph
.
externalNotifierKMSPeer
<-
ph
.
tcpSocketStr
ph
.
externalNotifierKMSPeer
<-
ph
.
tcpSocketStr
...
@@ -76,7 +76,7 @@ func (ph *kmsPeer) PeerHandler(kmsName string) {
...
@@ -76,7 +76,7 @@ func (ph *kmsPeer) PeerHandler(kmsName string) {
return
return
}
}
// Works and peer moves to kmsPeerUp
// Works and peer moves to kmsPeerUp
ph
.
peerStatus
=
k
msPeerUp
ph
.
peerStatus
=
K
msPeerUp
// Send notification about change
// Send notification about change
if
ph
.
externalNotifierKMSPeer
!=
nil
{
if
ph
.
externalNotifierKMSPeer
!=
nil
{
...
@@ -94,7 +94,7 @@ func (ph *kmsPeer) PeerHandler(kmsName string) {
...
@@ -94,7 +94,7 @@ func (ph *kmsPeer) PeerHandler(kmsName string) {
_
,
err
:=
c
.
ETSICapabilities
(
ctx
,
&
pb
.
ETSICapabilitiesRequest
{
MyKmsName
:
kmsName
})
_
,
err
:=
c
.
ETSICapabilities
(
ctx
,
&
pb
.
ETSICapabilitiesRequest
{
MyKmsName
:
kmsName
})
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Printf
(
"could not greet: %v"
,
err
)
log
.
Printf
(
"could not greet: %v"
,
err
)
ph
.
peerStatus
=
k
msPeerDown
ph
.
peerStatus
=
K
msPeerDown
// Send notification about change
// Send notification about change
if
ph
.
externalNotifierKMSPeer
!=
nil
{
if
ph
.
externalNotifierKMSPeer
!=
nil
{
ph
.
externalNotifierKMSPeer
<-
ph
.
tcpSocketStr
ph
.
externalNotifierKMSPeer
<-
ph
.
tcpSocketStr
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment