Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Commit

Permalink
Revert "[8.0](backport #2111) chore: use preconfigured policy for fle…
Browse files Browse the repository at this point in the history
…et-server's default policy (#2116)" (#2133)

This reverts commit 9b00e41.
  • Loading branch information
mdelapenya authored Feb 10, 2022
1 parent 48ad5fc commit 36680c4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 31 deletions.
13 changes: 0 additions & 13 deletions cli/config/compose/profiles/fleet/default/kibana.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,3 @@ xpack.fleet.agents.fleet_server.hosts: ["http://fleet-server:8220"]

xpack.encryptedSavedObjects.encryptionKey: "12345678901234567890123456789012"
xpack.fleet.agents.tlsCheckDisabled: true

xpack.fleet.packages:
- name: fleet_server
version: latest
xpack.fleet.agentPolicies:
- name: Fleet Server policy
id: fleet-server-policy
description: Fleet server policy
namespace: default
package_policies:
- name: Fleet Server
package:
name: fleet_server
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ xpack.fleet.outputs:
type: "elasticsearch"
id: "output-123"
hosts: ["http://elasticsearch:9200"]
xpack.fleet.packages:
- name: fleet_server
version: latest
xpack.fleet.agentPolicies:
- name: Test preconfigured policy
id: "test-preconfigured"
Expand All @@ -35,11 +32,3 @@ xpack.fleet.agentPolicies:
- package:
name: system
name: sytem-1
- name: Fleet Server policy
id: fleet-server-policy
description: Fleet server policy
namespace: default
package_policies:
- name: Fleet Server
package:
name: fleet_server
11 changes: 5 additions & 6 deletions e2e/_suites/fleet/fleet.go
Original file line number Diff line number Diff line change
Expand Up @@ -651,13 +651,12 @@ func bootstrapFleet(ctx context.Context, env map[string]string) error {
}).Fatal("Fleet could not be recreated")
}

// these values comes from the kibana.config.yml file at Fleet's profile dir
fleetServicePolicy := kibana.Policy{
ID: "fleet-server-policy",
Name: "Fleet Server Policy",
Description: "Fleet Server policy",
fleetServicePolicy, err := kibanaClient.GetDefaultPolicy(ctx, true)
if err != nil {
log.WithFields(log.Fields{
"error": err,
}).Fatal("Could not get Fleet Server's default policy")
}

log.WithFields(log.Fields{
"id": fleetServicePolicy.ID,
"name": fleetServicePolicy.Name,
Expand Down
1 change: 0 additions & 1 deletion internal/kibana/policies.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ type Policy struct {
}

// GetDefaultPolicy gets the default policy or optionally the default fleet policy
// deprecated: will be removed in upcoming releases
func (c *Client) GetDefaultPolicy(ctx context.Context, fleetServer bool) (Policy, error) {
span, _ := apm.StartSpanOptions(ctx, "Getting default policy", "fleet.package-policies.get-default", apm.SpanOptions{
Parent: apm.SpanFromContext(ctx).TraceContext(),
Expand Down

0 comments on commit 36680c4

Please sign in to comment.