Skip to content

Commit

Permalink
Enabled reverse proxy by default (#686)
Browse files Browse the repository at this point in the history
* Enabled reverse proxy by default

Signed-off-by: Harish P <harish_p4@dell.com>

* updated tests

Signed-off-by: Harish P <harish_p4@dell.com>

* updated code-owners

Signed-off-by: Harish P <harish_p4@dell.com>

---------

Signed-off-by: Harish P <harish_p4@dell.com>
Co-authored-by: Meghana GM <41953467+meggm@users.noreply.github.com>
  • Loading branch information
ChristianAtDell and meggm committed Oct 15, 2024
1 parent c7028de commit 046cec7
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
6 changes: 5 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@
# Coulombel Florian (coulof)
# Deepak Ghivari (Deepak-Ghivari)
# Gallacher Sean (gallacher)
# Gil Taran (gilltaran)
# Harish P (harishp8889)
# Harish H (HarishH-DELL)
# Jacob Grosner (JacobGros)
# Jooseppi Luna (jooseppi-luna)
# Karthik K (karthikk92)
# Kumar Karthik Gosa (kumarkgosa)
# Keerthi Bandapati (bandak2)
# Meghana M (meggm)
# Mukesh Gandharva (mgandharva)
# Matt Schmaelzle (mjsdell)
# Nitesh Rewatkar (nitesh3108)
# Prabhu Revur (prabhu-dell)
Expand All @@ -35,4 +39,4 @@
# Yamunadevi N Shanmugam (shanmydell)

# for all files:
* @abhi16394 @mbasha-dell @alikdell @bharathsreekanth @chimanjain @coulof @Deepak-Ghivari @gallacher @HarishH-DELL @JacobGros @jooseppi-luna @karthikk92 @kumarkgosa @bandak2 @mjsdell @nitesh3108 @prabhu-dell @rajendraindukuri @rajkumar-palani @shefali-malhotra @panigs7 @tdawe @shaynafinocchiaro @atye @sharmilarama @shanmydell
* @abhi16394 @mbasha-dell @alikdell @bharathsreekanth @chimanjain @coulof @Deepak-Ghivari @gallacher @gilltaran @harishp8889 @HarishH-DELL @JacobGros @jooseppi-luna @karthikk92 @kumarkgosa @bandak2 @meggm @mgandharva @mjsdell @nitesh3108 @prabhu-dell @rajendraindukuri @rajkumar-palani @shefali-malhotra @panigs7 @tdawe @shaynafinocchiaro @atye @sharmilarama @shanmydell
19 changes: 18 additions & 1 deletion pkg/drivers/powermax.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,17 @@ func PrecheckPowerMax(ctx context.Context, cr *csmv1.ContainerStorageModule, ope
Value: "/var/lib/kubelet",
})
}
if cr.Spec.Modules == nil {
// this means it's a minimal yaml and we will append reverse-proxy by default
modules := make([]csmv1.Module, 0)
modules = append(modules, csmv1.Module{
Name: "csireverseproxy",
Enabled: true,
ConfigVersion: "v2.10.0",
ForceRemoveModule: true,
})
cr.Spec.Modules = modules
}
foundRevProxy := false
for _, mod := range cr.Spec.Modules {
if mod.Name == csmv1.ReverseProxy {
Expand All @@ -102,7 +113,13 @@ func PrecheckPowerMax(ctx context.Context, cr *csmv1.ContainerStorageModule, ope
}
}
if !foundRevProxy {
return fmt.Errorf("failed to find reverseproxy module")
log.Infof("Reverse proxy module not found adding it with default config")
cr.Spec.Modules = append(cr.Spec.Modules, csmv1.Module{
Name: "csireverseproxy",
Enabled: true,
ConfigVersion: "v2.10.0",
ForceRemoveModule: true,
})
}

log.Debugw("preCheck", "secrets", cred)
Expand Down
2 changes: 1 addition & 1 deletion pkg/drivers/powermax_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var (
expectedErr string
}{
{"happy path", powerMaxCSM, powerMaxClient, powerMaxSecret, ""},
{"no proxy", powerMaxCSMNoProxy, powerMaxClient, powerMaxSecret, "failed to find reverseproxy module"},
{"no proxy set defaults", powerMaxCSMNoProxy, powerMaxClient, powerMaxSecret, ""},
}

preCheckpowerMaxTest = []struct {
Expand Down
4 changes: 0 additions & 4 deletions samples/minimal-samples/powermax.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,3 @@ spec:
driver:
csiDriverType: "powermax"
configVersion: v2.12.0
modules:
- name: csireverseproxy
enabled: true
configVersion: v2.10.0

0 comments on commit 046cec7

Please sign in to comment.