Skip to content

Commit 9a41489

Browse files
authored
Update OIDC spec in update cluster handler (#1002)
1 parent 5533071 commit 9a41489

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pkg/api/handlers/update_cluster.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func (d *updateCluster) Handle(params operations.UpdateClusterParams, principal
151151
}
152152

153153
if !dexEnabled && dashboardEnabled {
154-
return apierrors.NewBadRequest(fmt.Sprintf("Dashboard cannot be enabled while Dex is disabled"))
154+
return apierrors.NewBadRequest("Dashboard cannot be enabled while Dex is disabled")
155155
}
156156

157157
//Dex value changed
@@ -170,6 +170,14 @@ func (d *updateCluster) Handle(params operations.UpdateClusterParams, principal
170170

171171
}
172172

173+
// oidc values changed
174+
if params.Body.Spec.Oidc != kluster.Spec.Oidc {
175+
if dexEnabled && params.Body.Spec.Oidc != nil {
176+
return apierrors.NewBadRequest("OIDC cannot be customized while Dex is enabled")
177+
}
178+
kluster.Spec.Oidc = params.Body.Spec.Oidc
179+
}
180+
173181
return nil
174182
})
175183

0 commit comments

Comments
 (0)