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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user