@@ -191,18 +191,20 @@ func Contains(s []string, e string) bool {
191191//
192192// The path of the file will change based on the component that is accessing it
193193func GetUsersFile (filePath string ) ([]byte , error ) {
194- if os .Getenv ("HASURA_PLUGIN_CONNECTOR_CONTEXT_PATH" ) != "" {
195- // the plugin is accessing the file
196- // we'll prepend the value of this env var to the file path
197- filePath = filepath .Join (os .Getenv ("HASURA_PLUGIN_CONNECTOR_CONTEXT_PATH" ), filePath )
198- } else if os .Getenv ("HASURA_CONFIGURATION_DIRECTORY" ) != "" {
199- // the docker container is accessing the file
200- filePath = filepath .Join (os .Getenv ("HASURA_CONFIGURATION_DIRECTORY" ), filePath )
201- } else {
202- // since no env var is set, we'll assume that the docker container is accessing the file
203- // and the file is mounted to the /etc/connector/ directory, according to the spec:
204- // https://github.com/hasura/ndc-hub/blob/a764938e13fa3cc719745edaff73b584a936e3ef/rfcs/0000-deployment.md?plain=1#L23
205- filePath = filepath .Join ("/etc/connector/" , filePath )
194+ if ! filepath .IsAbs (filePath ) {
195+ if os .Getenv ("HASURA_PLUGIN_CONNECTOR_CONTEXT_PATH" ) != "" {
196+ // the plugin is accessing the file
197+ // we'll prepend the value of this env var to the file path
198+ filePath = filepath .Join (os .Getenv ("HASURA_PLUGIN_CONNECTOR_CONTEXT_PATH" ), filePath )
199+ } else if os .Getenv ("HASURA_CONFIGURATION_DIRECTORY" ) != "" {
200+ // the docker container is accessing the file
201+ filePath = filepath .Join (os .Getenv ("HASURA_CONFIGURATION_DIRECTORY" ), filePath )
202+ } else {
203+ // since no env var is set, we'll assume that the docker container is accessing the file
204+ // and the file is mounted to the /etc/connector/ directory, according to the spec:
205+ // https://github.com/hasura/ndc-hub/blob/a764938e13fa3cc719745edaff73b584a936e3ef/rfcs/0000-deployment.md?plain=1#L23
206+ filePath = filepath .Join ("/etc/connector/" , filePath )
207+ }
206208 }
207209
208210 if ! FileExists (filePath ) {
0 commit comments