Skip to content

Commit

Permalink
Include additional keys to adopt identityProviderConfig
Browse files Browse the repository at this point in the history
This change ensures users are required to provide
an identityProviderConfigName when adopting the resource,
as it is a required input field.

Not sure if we should change that to the primary NameOrID,
and make clusterName and additional Key..
  • Loading branch information
michaelhtm committed Oct 17, 2024
1 parent abd09fd commit eebb52d
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 5 deletions.
10 changes: 5 additions & 5 deletions apis/v1alpha1/ack-generate-metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
ack_generate_info:
build_date: "2024-10-10T03:55:41Z"
build_hash: 36c2d234498c2bc4f60773ab8df632af4067f43b
build_date: "2024-10-17T18:18:29Z"
build_hash: ab15f9206796e9660c51695fab0ff07a09ea28e2
go_version: go1.23.2
version: v0.39.1
api_directory_checksum: d736919240d3843865e860f7cb685cec30921bd4
version: v0.39.1-2-gab15f92
api_directory_checksum: 4cfe0b6ec81b65719c1f165983b84116135f5e40
api_version: v1alpha1
aws_sdk_go_version: v1.55.5
generator_config_info:
file_checksum: 157f31e5a8ce8e0e922e4e5c2e406841ec1a8136
file_checksum: 5b5c72cb103e99a0dd19beffb8863f16e4fd163e
original_file_name: generator.yaml
last_modification:
reason: API generation
2 changes: 2 additions & 0 deletions apis/v1alpha1/generator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ resources:
template_path: hooks/identity_provider_config/sdk_create_post_set_output.go.tpl
sdk_read_one_post_set_output:
template_path: hooks/identity_provider_config/sdk_read_one_post_set_output.go.tpl
post_set_resource_identifiers:
template_path: hooks/identity_provider_config/post_set_resource_identifiers.go.tpl
update_operation:
custom_method_name: customUpdate
Cluster:
Expand Down
2 changes: 2 additions & 0 deletions generator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ resources:
template_path: hooks/identity_provider_config/sdk_create_post_set_output.go.tpl
sdk_read_one_post_set_output:
template_path: hooks/identity_provider_config/sdk_read_one_post_set_output.go.tpl
post_set_resource_identifiers:
template_path: hooks/identity_provider_config/post_set_resource_identifiers.go.tpl
update_operation:
custom_method_name: customUpdate
Cluster:
Expand Down
12 changes: 12 additions & 0 deletions pkg/resource/identity_provider_config/resource.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

if identifier.AdditionalKeys == nil {
return fmt.Errorf("expected additional key `identityProviderConfigName` identifier, found nil")
}
f0, f0ok := identifier.AdditionalKeys["identityProviderConfigName"]
if f0ok {
r.ko.Spec.OIDC = &svcapitypes.OIDCIdentityProviderConfigRequest{
IdentityProviderConfigName: &f0,
}
} else {
return fmt.Errorf("expected additional key `identityProviderConfigName` identifier, found empty")
}

0 comments on commit eebb52d

Please sign in to comment.