From 2559b939a26d25db21ee8722eef63bd2813a9b2c Mon Sep 17 00:00:00 2001 From: Dante Catalfamo <43040593+dantecatalfamo@users.noreply.github.com> Date: Tue, 6 Aug 2024 12:00:56 -0400 Subject: [PATCH] Ensure empty gitops AdamIDs return an error to the user (#21087) Covers a case brought up in a question in #20875 This covers a case that was already handled by code, but not tested --- cmd/fleetctl/gitops_test.go | 1 + .../testdata/gitops/team_vpp_empty_adamid.yml | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 cmd/fleetctl/testdata/gitops/team_vpp_empty_adamid.yml diff --git a/cmd/fleetctl/gitops_test.go b/cmd/fleetctl/gitops_test.go index 22bd28845a..3b5470902b 100644 --- a/cmd/fleetctl/gitops_test.go +++ b/cmd/fleetctl/gitops_test.go @@ -1353,6 +1353,7 @@ func TestTeamVPPAppsGitOps(t *testing.T) { {"testdata/gitops/team_vpp_valid_empty.yml", "", time.Now().Add(-24 * time.Hour)}, {"testdata/gitops/team_vpp_valid_app.yml", "VPP token expired", time.Now().Add(-24 * time.Hour)}, {"testdata/gitops/team_vpp_invalid_app.yml", "app not available on vpp account", time.Now().Add(24 * time.Hour)}, + {"testdata/gitops/team_vpp_empty_adamid.yml", "software app store id required", time.Now().Add(24 * time.Hour)}, } for _, c := range cases { diff --git a/cmd/fleetctl/testdata/gitops/team_vpp_empty_adamid.yml b/cmd/fleetctl/testdata/gitops/team_vpp_empty_adamid.yml new file mode 100644 index 0000000000..675618c609 --- /dev/null +++ b/cmd/fleetctl/testdata/gitops/team_vpp_empty_adamid.yml @@ -0,0 +1,17 @@ +name: "${TEST_TEAM_NAME}" +team_settings: + secrets: + - secret: "ABC" + features: + enable_host_users: true + enable_software_inventory: true + host_expiry_settings: + host_expiry_enabled: true + host_expiry_window: 30 +agent_options: +controls: +policies: +queries: +software: + app_store_apps: + - app_store_id: