Skip to content

Commit

Permalink
fix: do not set KSPP kernel params in container mode
Browse files Browse the repository at this point in the history
That was accidentally changed after migration to kernel params
controller.

Signed-off-by: Artem Chernyshev <artem.chernyshev@talos-systems.com>
  • Loading branch information
Unix4ever committed Aug 20, 2021
1 parent b8c92ed commit 576ba19
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ func (ctrl *KernelParamDefaultsController) Run(ctx context.Context, r controller
case <-ctx.Done():
return nil
case <-r.EventCh():
kernels := append(
kspp.GetKernelParams(),
ctrl.getKernelParams()...,
)
kernelParams := ctrl.getKernelParams()
if ctrl.V1Alpha1Mode != v1alpha1runtime.ModeContainer {
kernelParams = append(kernelParams, kspp.GetKernelParams()...)
}

for _, prop := range kernels {
for _, prop := range kernelParams {
value := prop.Value
item := runtime.NewKernelParamSpec(runtime.NamespaceName, prop.Key)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ func SetupLogger(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionF
// EnforceKSPPRequirements represents the EnforceKSPPRequirements task.
func EnforceKSPPRequirements(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string) {
return func(ctx context.Context, logger *log.Logger, r runtime.Runtime) (err error) {
if err = kspp.EnforceKSPPKernelParameters(); err != nil {
if err = resourceruntime.NewKernelParamsSetCondition(r.State().V1Alpha2().Resources(), kspp.GetKernelParams()...).Wait(ctx); err != nil {
return err
}

return resourceruntime.NewKernelParamsSetCondition(r.State().V1Alpha2().Resources(), kspp.GetKernelParams()...).Wait(ctx)
return kspp.EnforceKSPPKernelParameters()
}, "enforceKSPPRequirements"
}

Expand Down

0 comments on commit 576ba19

Please sign in to comment.