ignore danger fields if kalm is running under multi-tenancy mode
@@ -1557,6 +1557,18 @@ func (r *ComponentReconcilerTask) SetupAttributes(req ctrl.Request) (err error)
}
r.component = &component
+ // If current controller is running under multi-tenancy mode
+ // No matter what's the original values of these fields are, they will be ignored.
+ if v1alpha1.GetEnvKalmIsInLocalMode() == "false" {
+ r.component.Spec.Labels = nil
+ r.component.Spec.NodeSelectorLabels = nil
+ r.component.Spec.IstioResourceRequirements = nil
+ r.component.Spec.StartAfterComponents = nil
+ r.component.Spec.Annotations = nil
+ r.component.Spec.DnsPolicy = ""
+ r.component.Spec.RunnerPermission = nil
+ }
+
var ns corev1.Namespace
err = r.Reader.Get(r.ctx, types.NamespacedName{
Name: component.Namespace,
