From f2bd6b40160fd96e87d2f317348797cfd7b0f93f Mon Sep 17 00:00:00 2001 From: Stefania Chierici Date: Mon, 11 Mar 2019 14:10:43 +0000 Subject: [PATCH 1/2] WF-261 Add srv/* permissions required to start deployments --- examples/ServiceAccountMaintenance/Program.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/examples/ServiceAccountMaintenance/Program.cs b/examples/ServiceAccountMaintenance/Program.cs index b1db970..b1b3afe 100755 --- a/examples/ServiceAccountMaintenance/Program.cs +++ b/examples/ServiceAccountMaintenance/Program.cs @@ -111,7 +111,7 @@ private static void Main(string[] args) private static void Setup() { ServiceAccountIds = new List(); - var perm = new Permission + var permProject = new Permission { Parts = {new RepeatedField {"prj", ProjectName, "*"}}, Verbs = @@ -123,6 +123,18 @@ private static void Setup() } } }; + + var permMetrics = new Permission + { + Parts = {new RepeatedField {"srv", "*"}}, + Verbs = + { + new RepeatedField + { + Permission.Types.Verb.Read + } + } + }; Console.WriteLine("Setting up for the scenario by creating new service accounts..."); for (var i = 0; i < NumberOfServiceAccountsToCreate; i++) @@ -131,7 +143,7 @@ private static void Setup() { Name = ServiceAccountName, ProjectName = ProjectName, - Permissions = {new RepeatedField {perm}}, + Permissions = {new RepeatedField {permProject, permMetrics}}, Lifetime = Duration.FromTimeSpan(new TimeSpan(1, 0, 0, 0)) // Let this service account live for one day }); ServiceAccountIds.Add(resp.Id); From 605adaa74c7bf7fd4c9cb7624df403c3d2461b0c Mon Sep 17 00:00:00 2001 From: Stefania Chierici Date: Mon, 11 Mar 2019 14:32:08 +0000 Subject: [PATCH 2/2] Change name --- examples/ServiceAccountMaintenance/Program.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/ServiceAccountMaintenance/Program.cs b/examples/ServiceAccountMaintenance/Program.cs index b1b3afe..764ab88 100755 --- a/examples/ServiceAccountMaintenance/Program.cs +++ b/examples/ServiceAccountMaintenance/Program.cs @@ -124,7 +124,7 @@ private static void Setup() } }; - var permMetrics = new Permission + var permServices = new Permission { Parts = {new RepeatedField {"srv", "*"}}, Verbs = @@ -143,7 +143,7 @@ private static void Setup() { Name = ServiceAccountName, ProjectName = ProjectName, - Permissions = {new RepeatedField {permProject, permMetrics}}, + Permissions = {new RepeatedField {permProject, permServices}}, Lifetime = Duration.FromTimeSpan(new TimeSpan(1, 0, 0, 0)) // Let this service account live for one day }); ServiceAccountIds.Add(resp.Id);