-
Notifications
You must be signed in to change notification settings - Fork 1
Block update when instance is provisioned #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ge-platform/infra-core into block-lc-instance-update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do a test case without field in the fm as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please do this as well - to avoid future surprise
inventory/internal/store/instance.go
Outdated
// transition from Untrusted to any other state than DELETED is not allowed | ||
return slices.Contains(fieldmask.GetPaths(), instanceresource.FieldDesiredState) && | ||
instanceq.CurrentState == instanceresource.CurrentStateINSTANCE_STATE_UNTRUSTED && | ||
in.DesiredState != computev1.InstanceState_INSTANCE_STATE_DELETED | ||
in.DesiredState != computev1.InstanceState_INSTANCE_STATE_DELETED || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my suggestion was to borrow the logic (and create a similar function) that check if
slices.Contains(fieldmask.GetPaths(), instanceresource.FieldCurrentState) AND...
inventory/internal/store/instance.go
Outdated
in.DesiredState != computev1.InstanceState_INSTANCE_STATE_DELETED | ||
in.DesiredState != computev1.InstanceState_INSTANCE_STATE_DELETED || | ||
instanceq.CurrentState != instanceresource.CurrentStateINSTANCE_STATE_UNSPECIFIED && | ||
instanceq.CurrentState != "" && in.GetLocalaccount() != nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instanceq.CurrentState != "" && in.GetLocalaccount() != nil | |
&& in.GetLocalaccount() != nil |
…ge-platform/infra-core into block-lc-instance-update
in *computev1.InstanceResource, | ||
) bool { | ||
return slices.Contains(fieldmask.GetPaths(), instanceresource.EdgeLocalaccount) && | ||
in.GetLocalaccount() != nil && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont believe we need to check if it is not nil
return slices.Contains(fieldmask.GetPaths(), instanceresource.EdgeLocalaccount) && | ||
in.GetLocalaccount() != nil && | ||
(instanceq.CurrentState != instanceresource.CurrentStateINSTANCE_STATE_UNSPECIFIED && | ||
len(instanceq.CurrentState) != 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need len
check?
}, | ||
"UpdateInstanceLocalAccount": { | ||
"UpdateInstanceDetailStatus": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this change about ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather merge this post-release
PULL DESCRIPTION
Provide a 1-2 line brief overview of the changes submitted through the Pull Request...
Impact Analysis
CODE MAINTAINABILITY
Code must act as a teacher for future developers