mirror of https://github.com/kubernetes/kops.git
add a==nil usecase
This commit is contained in:
parent
ed8d03d402
commit
924e44afff
|
|
@ -87,10 +87,17 @@ func (e *SSHKey) Run(c *fi.Context) error {
|
|||
}
|
||||
|
||||
func (s *SSHKey) CheckChanges(a, e, changes *SSHKey) error {
|
||||
if a != nil {
|
||||
if a == nil {
|
||||
if e.Name == nil {
|
||||
return fi.RequiredField("Name")
|
||||
}
|
||||
} else {
|
||||
if changes.Name != nil {
|
||||
return fi.CannotChangeField("Name")
|
||||
}
|
||||
if changes.KeyFingerprint != nil {
|
||||
return fi.CannotChangeField("KeyFingerprint")
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue