need to store agent enrollment details (#967)

This commit is contained in:
Michael Quigley 2025-05-28 13:39:00 -04:00
parent 14b40b3875
commit 8b2910adcf
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
4 changed files with 17 additions and 0 deletions

View File

@ -30,6 +30,7 @@ type Root interface {
AgentSocket() (string, error)
AgentRegistry() (string, error)
AgentEnrollment() (string, error)
}
type Environment struct {

View File

@ -201,6 +201,10 @@ func (r *Root) AgentRegistry() (string, error) {
return "", errors.Errorf("this environment version does not support the zrok Agent; please 'zrok update' this environment")
}
func (r *Root) AgentEnrollment() (string, error) {
return "", errors.Errorf("this environment version does not support the zrok Agent; please 'zrok update' this environment")
}
func (r *Root) Obliterate() error {
zrd, err := rootDir()
if err != nil {

View File

@ -200,6 +200,10 @@ func (r *Root) AgentRegistry() (string, error) {
return agentRegistry()
}
func (r *Root) AgentEnrollment() (string, error) {
return agentEnrollment()
}
func (r *Root) Obliterate() error {
zrd, err := rootDir()
if err != nil {

View File

@ -69,3 +69,11 @@ func agentRegistry() (string, error) {
}
return filepath.Join(zrd, "agent-registry.json"), nil
}
func agentEnrollment() (string, error) {
zrd, err := rootDir()
if err != nil {
return "", err
}
return filepath.Join(zrd, "agent-enrollment.json"), nil
}