mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-06 05:54:28 -04:00
k8supdates: label nodes with k8s component hash
This commit is contained in:
parent
1466c12972
commit
a1161ae05d
30 changed files with 869 additions and 18 deletions
|
@ -173,6 +173,15 @@ func (s *Server) IssueJoinTicket(ctx context.Context, req *joinproto.IssueJoinTi
|
|||
}
|
||||
}
|
||||
|
||||
nodeName, err := s.ca.GetNodeNameFromCSR(req.CertificateRequest)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "unable to get node name from CSR: %s", err)
|
||||
}
|
||||
|
||||
if err := s.kubeClient.AddNodeToJoiningNodes(ctx, nodeName, components.GetHash()); err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "unable to add node to joining nodes: %s", err)
|
||||
}
|
||||
|
||||
log.Infof("IssueJoinTicket successful")
|
||||
return &joinproto.IssueJoinTicketResponse{
|
||||
StateDiskKey: stateDiskKey,
|
||||
|
@ -294,10 +303,13 @@ type dataKeyGetter interface {
|
|||
type certificateAuthority interface {
|
||||
// GetCertificate returns a certificate and private key, signed by the issuer.
|
||||
GetCertificate(certificateRequest []byte) (kubeletCert []byte, err error)
|
||||
// GetNodeNameFromCSR returns the node name from the CSR.
|
||||
GetNodeNameFromCSR(csr []byte) (string, error)
|
||||
}
|
||||
|
||||
type kubeClient interface {
|
||||
GetComponents(ctx context.Context, configMapName string) (versions.ComponentVersions, error)
|
||||
CreateConfigMap(ctx context.Context, configMap corev1.ConfigMap) error
|
||||
AddNodeToJoiningNodes(ctx context.Context, nodeName string, componentsHash string) error
|
||||
AddReferenceToK8sVersionConfigMap(ctx context.Context, k8sVersionsConfigMapName string, componentsConfigMapName string) error
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue