Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions internal/serverless/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"io"
"net/http"
"net/url"
"strings"
"time"

"github.com/elastic/elastic-package/internal/elasticsearch"
Expand Down Expand Up @@ -178,13 +179,13 @@ func (p *Project) getFleetHealth(ctx context.Context) error {

func (p *Project) CreateAgentPolicy(stackVersion string, kibanaClient *kibana.Client) error {
systemPackages, err := registry.Production.Revisions("system", registry.SearchOptions{
KibanaVersion: stackVersion,
KibanaVersion: strings.TrimSuffix(stackVersion, kibana.SNAPSHOT_SUFFIX),
})
if err != nil {
return fmt.Errorf("could not get the system package version for kibana %v: %w", stackVersion, err)
return fmt.Errorf("could not get the system package version for Kibana %v: %w", stackVersion, err)
}
if len(systemPackages) != 1 {
return fmt.Errorf("unexpected number of system package versions - found %d expected 1", len(systemPackages))
return fmt.Errorf("unexpected number of system package versions for Kibana %s - found %d expected 1", stackVersion, len(systemPackages))
}
logger.Debugf("Found %s package - version %s", systemPackages[0].Name, systemPackages[0].Version)

Expand Down