Skip to content

Commit

Permalink
Fix multiple records cannot be created
Browse files Browse the repository at this point in the history
Only need to fix put, it keeps sending update requests to the backend for whatever reason, probably because the object generation is not set correctly. Will step debug it tomorrow.
  • Loading branch information
edenreich committed Jun 1, 2024
1 parent 88942ac commit 5a56256
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions crates/k8s-codegen/templates/k8s_operator_controller.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,10 @@ pub async fn check_for_drift(
{{ arg_name }}: &mut {{ kind_struct }},
) -> Result<()> {
let dto = convert_kube_type_to_dto({{ arg_name }}.clone());
let {{ resource_remote_ref }} = convert_uuid_to_string(dto.{{ resource_remote_ref }}).unwrap();
let {{ resource_remote_ref }} = convert_uuid_to_string(dto.{{ resource_remote_ref }}).unwrap_or_default();
let config = get_client_config().await?;

if dto.{{ resource_remote_ref }}.is_none() {
if {{ resource_remote_ref }}.is_empty() {
warn!("{{ kind_struct }} has no status, cannot get by id or check for drift. Skipping...");
return Ok(());
}
Expand Down
4 changes: 2 additions & 2 deletions crates/k8s-operator/src/controllers/cats.rs

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

0 comments on commit 5a56256

Please sign in to comment.