diff --git a/api/types/integration.go b/api/types/integration.go index ee00a47d7ac1e..17e016117fdd2 100644 --- a/api/types/integration.go +++ b/api/types/integration.go @@ -66,6 +66,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 @@ -327,6 +329,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 0197c2a542ab4..a036834cfd00b 100644 --- a/tool/tctl/common/resource_command.go +++ b/tool/tctl/common/resource_command.go @@ -1605,6 +1605,8 @@ func (rc *ResourceCommand) createIntegration(ctx context.Context, client *authcl existingIntegration.SetAWSOIDCIntegrationSpec(integration.GetAWSOIDCIntegrationSpec()) case types.IntegrationSubKindGitHub: existingIntegration.SetGitHubIntegrationSpec(integration.GetGitHubIntegrationSpec()) + case types.IntegrationSubKindAzureOIDC: + existingIntegration.SetAzureOIDCIntegrationSpec(integration.GetAzureOIDCIntegrationSpec()) default: return trace.BadParameter("subkind %q is not supported", integration.GetSubKind()) }