Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge main to 1.4 #851

Merged
merged 2 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/operator/controllers/serverless_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ type serverlessReconciler struct {
log *zap.SugaredLogger
}

func NewServerlessReconciler(client client.Client, config *rest.Config, recorder record.EventRecorder, log *zap.SugaredLogger, chartPath string, ns string) *serverlessReconciler {
func NewServerlessReconciler(client client.Client, config *rest.Config, recorder record.EventRecorder, log *zap.SugaredLogger, chartPath string) *serverlessReconciler {
cache := chart.NewSecretManifestCache(client)

return &serverlessReconciler{
initStateMachine: func(log *zap.SugaredLogger) state.StateReconciler {
return state.NewMachine(client, config, recorder, log, cache, chartPath, ns)
return state.NewMachine(client, config, recorder, log, cache, chartPath)
},
client: client,
log: log,
Expand Down
5 changes: 2 additions & 3 deletions components/operator/controllers/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,8 @@ var _ = BeforeSuite(func() {
k8sManager.GetConfig(),
record.NewFakeRecorder(100),
reconcilerLogger.Sugar(),
chartPath,
"",
)).SetupWithManager(k8sManager)
chartPath)).
SetupWithManager(k8sManager)
Expect(err).ToNot(HaveOccurred())

go func() {
Expand Down
3 changes: 1 addition & 2 deletions components/operator/internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ package config
import "github.com/vrischmann/envconfig"

type Config struct {
ChartPath string `envconfig:"default=/module-chart"`
ServerlessManagerNamespace string `envconfig:"default=default"`
ChartPath string `envconfig:"default=/module-chart"`
}

func GetConfig(prefix string) (Config, error) {
Expand Down
1 change: 0 additions & 1 deletion components/operator/internal/state/fsm.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ type stateFn func(context.Context, *reconciler, *systemState) (stateFn, *ctrl.Re
type cfg struct {
finalizer string
chartPath string
namespace string
managerPodUID string
}

Expand Down
3 changes: 1 addition & 2 deletions components/operator/internal/state/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@ type StateReconciler interface {
Reconcile(ctx context.Context, v v1alpha1.Serverless) (ctrl.Result, error)
}

func NewMachine(client client.Client, config *rest.Config, recorder record.EventRecorder, log *zap.SugaredLogger, cache chart.ManifestCache, chartPath, namespace string) StateReconciler {
func NewMachine(client client.Client, config *rest.Config, recorder record.EventRecorder, log *zap.SugaredLogger, cache chart.ManifestCache, chartPath string) StateReconciler {
return &reconciler{
fn: sFnServedFilter,
cache: cache,
log: log,
cfg: cfg{
finalizer: v1alpha1.Finalizer,
chartPath: chartPath,
namespace: namespace,
managerPodUID: os.Getenv("SERVERLESS_MANAGER_UID"),
},
k8s: k8s{
Expand Down
5 changes: 2 additions & 3 deletions components/operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func main() {
ctx, cancel := context.WithTimeout(context.Background(), cleanupTimeout)
defer cancel()

setupLog.Info("cleaning orphan depricated resources")
setupLog.Info("cleaning orphan deprecated resources")
err = cleanupOrphanDeprecatedResources(ctx)
if err != nil {
setupLog.Error(err, "while removing orphan resources")
Expand Down Expand Up @@ -131,8 +131,7 @@ func main() {
mgr.GetClient(), mgr.GetConfig(),
mgr.GetEventRecorderFor("serverless-operator"),
reconcilerLogger.Sugar(),
cfg.ChartPath,
cfg.ServerlessManagerNamespace)
cfg.ChartPath)

if err = reconciler.SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "Serverless")
Expand Down
4 changes: 0 additions & 4 deletions config/operator/base/deployment/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ spec:
image: controller:latest
name: manager
env:
- name: SERVERLESS_MANAGER_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: SERVERLESS_MANAGER_UID
valueFrom:
fieldRef:
Expand Down
2 changes: 1 addition & 1 deletion sec-scanners-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module-name: serverless
rc-tag: 1.3.0
rc-tag: 1.4.0
protecode:
- europe-docker.pkg.dev/kyma-project/prod/serverless-operator:main
- europe-docker.pkg.dev/kyma-project/prod/function-controller:main
Expand Down
Loading