diff --git a/pkg/c8ysession/c8ysession.go b/pkg/c8ysession/c8ysession.go index d1af4425b..611935f72 100644 --- a/pkg/c8ysession/c8ysession.go +++ b/pkg/c8ysession/c8ysession.go @@ -195,7 +195,7 @@ func GetVariablesFromSession(session *CumulocitySession, client *c8y.Client, set } output := map[string]interface{}{ - // "C8Y_SESSION": c.GetSessionFile(), + "C8Y_SESSION": "", "C8Y_URL": host, "C8Y_BASEURL": host, "C8Y_HOST": host, @@ -209,6 +209,13 @@ func GetVariablesFromSession(session *CumulocitySession, client *c8y.Client, set "C8Y_HEADER_AUTHORIZATION": authHeaderValue, "C8Y_HEADER": authHeader, } + + // Favor older path style over sessionUri to help with backwards compatibility + if session.Path != "" { + output["C8Y_SESSION"] = session.Path + } else if session.SessionUri != "" { + output["C8Y_SESSION"] = session.SessionUri + } return output }