From 7c6f0584639e874849ca5d55a52f38184989bf5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Skrz=C4=99tnicki?= Date: Mon, 17 Nov 2025 14:59:51 +0100 Subject: [PATCH] support updating exising oidc integration with `tctl` --- api/types/integration.go | 9 +++++++++ tool/tctl/common/resource_command.go | 2 ++ 2 files changed, 11 insertions(+) diff --git a/api/types/integration.go b/api/types/integration.go index 8a7df35db0765..4a4275be74e26 100644 --- a/api/types/integration.go +++ b/api/types/integration.go @@ -76,6 +76,8 @@ type Integration interface { // GetAzureOIDCIntegrationSpec returns the `azure-oidc` spec fields. GetAzureOIDCIntegrationSpec() *AzureOIDCIntegrationSpecV1 + // SetAzureOIDCIntegrationSpec sets the `azure-oidc` spec fields. + SetAzureOIDCIntegrationSpec(*AzureOIDCIntegrationSpecV1) // GetGitHubIntegrationSpec returns the GitHub spec. GetGitHubIntegrationSpec() *GitHubIntegrationSpecV1 @@ -401,6 +403,13 @@ func (ig *IntegrationV1) GetAzureOIDCIntegrationSpec() *AzureOIDCIntegrationSpec return ig.Spec.GetAzureOIDC() } +// SetAzureOIDCIntegrationSpec sets the `azure-oidc` spec fields. +func (ig *IntegrationV1) SetAzureOIDCIntegrationSpec(spec *AzureOIDCIntegrationSpecV1) { + ig.Spec.SubKindSpec = &IntegrationSpecV1_AzureOIDC{ + AzureOIDC: spec, + } +} + // GetGitHubIntegrationSpec returns the GitHub spec. func (ig *IntegrationV1) GetGitHubIntegrationSpec() *GitHubIntegrationSpecV1 { return ig.Spec.GetGitHub() diff --git a/tool/tctl/common/resource_command.go b/tool/tctl/common/resource_command.go index 336b70ffb1aed..9b73740ab167a 100644 --- a/tool/tctl/common/resource_command.go +++ b/tool/tctl/common/resource_command.go @@ -1731,6 +1731,8 @@ func (rc *ResourceCommand) createIntegration(ctx context.Context, client *authcl existingIntegration.SetGitHubIntegrationSpec(integration.GetGitHubIntegrationSpec()) case types.IntegrationSubKindAWSRolesAnywhere: existingIntegration.SetAWSRolesAnywhereIntegrationSpec(integration.GetAWSRolesAnywhereIntegrationSpec()) + case types.IntegrationSubKindAzureOIDC: + existingIntegration.SetAzureOIDCIntegrationSpec(integration.GetAzureOIDCIntegrationSpec()) default: return trace.BadParameter("subkind %q is not supported", integration.GetSubKind()) }