This message was deleted.
# opal
s
This message was deleted.
f
@Thilak Reddy thanks for reaching out. I will forward this question to our dev team to find out if this is a possibility! 🙏🏼
👍 1
a
Hi @Thilak Reddy You should set
Copy code
OPAL_REPO_WATCHER_ENABLED=false
That should display the policy tracking from opal server
t
@Asaf Cohen the
OPAL_REPO_WATCHER_ENABLED
setting is only available for the server The OPAL client still calls the server to fetch the policy bundle Not sure if a similar setting exists for the client as well
a
mmm i see, unfortunately looks like we are missing this as a feature. We can add an option to disable policy fetching in the client, but it might take us a few days to get there. In the meanwhile - i can suggest syncing an empty repo as a stop gap solution. @Ro'e Katz @Ori Shavit when do you think we can get this done, Thursday?
t
Hey @Asaf Cohen created a feature request on github to note this down, i tried to make the change but got stuck on writing tests I might take another shot at it if have get some time
a
Hi @Thilak Reddy we'll try to get this in as soon as we can.
🙏 1
@Ro'e Katz opened a ticket on you (PER-5185) Let's prioritize this when you are available.
t
Hi @Asaf Cohen, i have tried to solve this by optionally initialising the
PolicyUpdater
based on an env variable, mentioned some points that i need help on Can someone look at this pull request? https://github.com/permitio/opal/pull/470 Would appreciate help on how i can go about this 🙏
r
@Thilak Reddy That’s great. I’ll take a look! (maybe today but probably tomorrow)
👍 1
Hi @Thilak Reddy - I’ve just took a look and replied you there (I’m not sure I fully understand the issues you’re still having). But thinking about that again, I tend to prefer a solution that involves the server rather than the client - after all it is the server where the user configures what should be tracked. if at some point you decide to also start syncing policy files - that should be achieved by either reconfiguring the server (or ideally - adding rego files to your tracked resources). But I guess that goes back to your use case, Can I ask how are you planning to sync data? (Tracking a git repo? using
OPAL_DATA_SOURCES_CONFIG
?) I think either way it’s possible to make the server not sync policy files to clients. For example: 1. Override
OPAL_POLICY_REPO_POLICY_EXTENSIONS=[]
(How to detect policy files,
[".rego"]
by default), or
OPAL_FILTER_FILE_EXTENSIONS=[.json]
(general filter on the policy bundles,
[.rego, .json]
by default). a. If you don’t use a git repo for syncing data - you can point it to a dummy repo, or to our default
OPAL_POLICY_REPO_URL=<https://github.com/permitio/opal-example-policy-repo.git>
. b. You can set
OPAL_POLICY_REPO_POLLING_INTERVAL=0
so server won’t even try to periodically check for updates. 2. Use
OPAL_POLICY_SOURCE_TYPE=API
and point it to a server that serves empty bundles. Even if those “workarounds” (though not really) aren’t enough, the right thing to do might be fixing the server to just serve empty bundles if
OPAL_REPO_WATCHER_ENABLED=False
(instead of raising an error). LMK what you think.
t
Can I ask how are you planning to sync data?
I am using
OPAL_DATA_SOURCES_CONFIG
to load data and updates would be pushed to OPAL server through API 1. Workaround mentioned here are when i am tracking a git repo or loading bundles, which is not what i am trying to do, i don’t want to load or sync any policy files to clients 2. As i don’t want to fetch or load policies, doing this additional setup just to workaround the OPAL client health doesn’t sound like a good idea
might be fixing the server to just serve empty bundles if
OPAL_REPO_WATCHER_ENABLED=False
(instead of raising an error).
In any case when we are loading a bundle either empty or some dummy bundle, the policies loaded into OPAL client docker image during docker build are overridden by the loaded bundle from the server which is not the desired state, i would want the policies(a single policy file) i loaded into my OPAL client image to be the one being used So don’t serving empty bundles from any place solves the issue, it always overrides the policies present in the docker image
But thinking about that again, I tend to prefer a solution that involves the server rather than the client -
after all it is the server where the user configures what should be tracked
yup, but let’s consider a use case where the server is set to track a git repo for policy files but one or a subset of clients don’t want to receive those policy bundles/files, these clients are only interested in the data config sources and the data updates (git repo doesn’t have any data, contains only policies) and want to load policies during docker build instead of loading them from server In this scenario, not having an option on client to switch off policy loading/syncing would result in the OPAL client trying to fetch policy which will override the policies loaded into the docker image TLDR: server may or may not track a git repo, in any case the client should be able to choose to load/sync policies just like how it can choose to switch off data updates using
OPAL_DATA_UPDATER_ENABLED
I will reply on the PR with more details but i hope i made sense
@Ro'e Katz commented here with the error i am getting on server when
PolicyUpdater
is not initialised on client but server still broadcasts policy updates to the client even though i don’t see any log on client which subscribed to the policy topic
policy:.
https://github.com/permitio/opal/pull/470#issuecomment-1564531702
r
@Thilak Reddy Thanks for the additional information. I see your points, Gonna reply soon on the PR itself.
👍 1
t
Updated the PR with changes for
OpaTransactionLogState.healthy
method https://github.com/permitio/opal/pull/470#issuecomment-1566218232
r
Approved 🙂 But had 2 requests before I merge - take a look there
âś… 1
t
Hi @Ro'e Katz, checked the working of disabling and not disabling of policy sync and fixed the pre-commit formatting issue
r
@Thilak Reddy Merged. Kudos!
t
Thanks for your time @Ro'e Katz 🙌
@Ro'e Katz when can i expect the docker image to be published?
r
I think we’re gonna release a new version next week (Meanwhile you can build your own image of course)
👍 1