Skip to content

Commit aa87dab

Browse files
Fix scheduler e2e tests and adjust recommended cortex secrets example structure
1 parent 63452a5 commit aa87dab

File tree

4 files changed

+20
-39
lines changed

4 files changed

+20
-39
lines changed

cortex.secrets.example.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,23 @@ sharedSSOCert: &sharedSSOCert
2020
# If true, the certificate is not verified.
2121
selfSigned: "false"
2222

23+
# Override the endpoints and credentials to your OpenStack.
24+
keystone: &keystone
25+
url: https://path-to-keystone/v3
26+
availability: public
27+
username: openstack-user-with-all-project-read-access
28+
password: openstack-user-password
29+
projectName: openstack-project-of-user
30+
userDomainName: openstack-domain-of-user
31+
projectDomainName: openstack-domain-of-project-scoped-to
32+
sso:
33+
enabled: false
34+
<<: *sharedSSOCert
35+
36+
global:
37+
secrets:
38+
keystone: *keystone
39+
2340
# For the cortex knowledge operator.
2441
datasources:
2542
prometheus:

scheduler/internal/conf/conf.go

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -180,39 +180,6 @@ type SchedulerAPIConfig struct {
180180
LogRequestBodies bool `json:"logRequestBodies"`
181181
}
182182

183-
// Configuration for the nova service.
184-
type SyncOpenStackNovaConfig struct {
185-
// Availability of the service, such as "public", "internal", or "admin".
186-
Availability string `json:"availability"`
187-
}
188-
189-
// Configuration for the identity service.
190-
type SyncOpenStackIdentityConfig struct {
191-
// Availability of the service, such as "public", "internal", or "admin".
192-
Availability string `json:"availability"`
193-
}
194-
195-
// Configuration for the manila service.
196-
type SyncOpenStackManilaConfig struct {
197-
// Availability of the service, such as "public", "internal", or "admin".
198-
Availability string `json:"availability"`
199-
}
200-
201-
// Configuration for the sync/openstack module.
202-
type SyncOpenStackConfig struct {
203-
// Configuration for the nova service.
204-
Nova SyncOpenStackNovaConfig `json:"nova"`
205-
// Configuration for the identity service.
206-
Identity SyncOpenStackIdentityConfig `json:"identity"`
207-
// Configuration for the manila service.
208-
Manila SyncOpenStackManilaConfig `json:"manila"`
209-
}
210-
211-
// Configuration for the sync module.
212-
type SyncConfig struct {
213-
OpenStack SyncOpenStackConfig `json:"openstack"`
214-
}
215-
216183
type Config struct {
217184
SchedulerConfig `json:"scheduler"`
218185

@@ -225,5 +192,4 @@ type Config struct {
225192
// Required for e2e tests.
226193
libconf.KeystoneConfig `json:"keystone"`
227194
libconf.APIConfig `json:"api"`
228-
SyncConfig `json:"sync"`
229195
}

scheduler/internal/e2e/manila/checks.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ func RunChecks(ctx context.Context, config conf.Config) {
2828
// Check that the Manila external scheduler returns a valid set of share hosts.
2929
func checkManilaSchedulerReturnsValidHosts(ctx context.Context, config conf.Config) {
3030
keystoneConf := config.KeystoneConfig
31-
osConf := config.SyncConfig.OpenStack
3231
slog.Info("authenticating against openstack", "url", keystoneConf.URL)
3332
authOptions := gophercloud.AuthOptions{
3433
IdentityEndpoint: keystoneConf.URL,
@@ -48,7 +47,7 @@ func checkManilaSchedulerReturnsValidHosts(ctx context.Context, config conf.Conf
4847
gophercloud.ServiceTypeAliases["shared-file-system"] = []string{"sharev2"}
4948
sc := must.Return(openstack.NewSharedFileSystemV2(pc, gophercloud.EndpointOpts{
5049
Type: "sharev2",
51-
Availability: gophercloud.Availability(osConf.Manila.Availability),
50+
Availability: gophercloud.Availability(keystoneConf.Availability),
5251
}))
5352
sc.Microversion = "2.65"
5453
slog.Info("authenticated against openstack", "url", sc.Endpoint)

scheduler/internal/e2e/nova/checks.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ func getHypervisors(ctx context.Context, sc *gophercloud.ServiceClient) ([]nova.
9292
// Prepare the test by fetching the necessary data from OpenStack.
9393
func prepare(ctx context.Context, config conf.Config) datacenter {
9494
keystoneConf := config.KeystoneConfig
95-
osConf := config.SyncConfig.OpenStack
9695
slog.Info("authenticating against openstack", "url", keystoneConf.URL)
9796
authOptions := gophercloud.AuthOptions{
9897
IdentityEndpoint: keystoneConf.URL,
@@ -112,7 +111,7 @@ func prepare(ctx context.Context, config conf.Config) datacenter {
112111
slog.Info("locating nova endpoint")
113112
novaURL := must.Return(pc.EndpointLocator(gophercloud.EndpointOpts{
114113
Type: "compute",
115-
Availability: gophercloud.Availability(osConf.Nova.Availability),
114+
Availability: gophercloud.Availability(keystoneConf.Availability),
116115
}))
117116
novaSC := &gophercloud.ServiceClient{
118117
ProviderClient: pc,
@@ -169,7 +168,7 @@ func prepare(ctx context.Context, config conf.Config) datacenter {
169168
slog.Info("locating keystone endpoint")
170169
keystoneURL := must.Return(pc.EndpointLocator(gophercloud.EndpointOpts{
171170
Type: "identity",
172-
Availability: gophercloud.Availability(osConf.Identity.Availability),
171+
Availability: gophercloud.Availability(keystoneConf.Availability),
173172
}))
174173
keystoneSC := &gophercloud.ServiceClient{
175174
ProviderClient: pc,

0 commit comments

Comments
 (0)