Fixed: Allow to disable owner references for cross namespace access with builder and function namespace (#3024)

* Add DISABLE_OWNER_REFERENCES env variable to executor and buildermgr deployment.
Use this env var to decide adding ownerReferences to K8s resources created by fission CRD.
* Resolve review comments
* Fix lint failure

---------

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
This commit is contained in:
soharab-ic
2024-09-27 15:11:07 +05:30
committed by GitHub
parent b8f746cb98
commit 2bf00025ed
13 changed files with 155 additions and 82 deletions
+9
View File
@@ -39,6 +39,10 @@ import (
"github.com/fission/fission/pkg/utils/uuid"
)
const (
ENV_DISABLE_OWNER_REFERENCES string = "DISABLE_OWNER_REFERENCES"
)
func UrlForFunction(name, namespace string) string {
prefix := "/fission-function"
if namespace != metav1.NamespaceDefault {
@@ -296,3 +300,8 @@ func DeleteOldPackages(pkgPath, pkgType string) error {
return nil
}
func IsOwnerReferencesEnabled() bool {
disableOwnerReference, _ := strconv.ParseBool(os.Getenv(ENV_DISABLE_OWNER_REFERENCES))
return !disableOwnerReference
}