OctopusDeploy / OctopusClients

| Public | Octopus.Client for commanding Octopus servers

Home Page:https://octopus.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sensitive tenant variables are cleared when they should be modified #5300

tothegills opened this issue · comments

The bug

When using Octopus.Client to update sensitive tenant variables, the variables are cleared instead of updated. Creating sensitive variables works fine.

What I expected to happen

Sensitive tenant variables should be modified instead of deleted.

Steps to reproduce

  1. Configure a tenant connected to a project and define a variable template on that project that contains a sensitive variable
  2. Using Octopus.Client create a value for the sensitive variable template, notice it works fine
  3. Using Octopus.Client modify the value for the sensitive variable template, notice the variable gets deleted

Sample script:

var endpoint = new OctopusServerEndpoint(octopusURI, apikey);
var repository = new OctopusRepository(endpoint);

var tenant = repository.Tenants.Get("Tenants-1");
var tenantVariables = repository.Tenants.GetVariables(tenant);

tenantVariables.LibraryVariables["LibraryVariableSets-1"].Variables["6b9a77cd-4f96-4d3d-b890-c126cbcab29e"] = new PropertyValueResource("Password", true);

var response = repository.Tenants.ModifyVariables(tenant, tenantVariables);

Links

https://secure.helpscout.net/conversation/765780316/38576?folderId=571723