@@ -80,10 +80,19 @@ func flattenLifecycleHandler(in *v1.LifecycleHandler) []interface{} {
8080 if in .TCPSocket != nil {
8181 att ["tcp_socket" ] = flattenTCPSocket (in .TCPSocket )
8282 }
83+ if in .Sleep != nil {
84+ att ["sleep" ] = flattenSleep (in .Sleep )
85+ }
8386
8487 return []interface {}{att }
8588}
8689
90+ func flattenSleep (in * v1.SleepAction ) []interface {} {
91+ att := make (map [string ]interface {})
92+ att ["seconds" ] = in .Seconds
93+ return []interface {}{att }
94+ }
95+
8796func flattenHTTPHeader (in []v1.HTTPHeader ) []interface {} {
8897 att := make ([]interface {}, len (in ))
8998 for i , v := range in {
@@ -686,6 +695,18 @@ func expandSecurityCapabilities(l []interface{}) *v1.Capabilities {
686695 return & obj
687696}
688697
698+ func expandSleep (l []interface {}) * v1.SleepAction {
699+ if len (l ) == 0 || l [0 ] == nil {
700+ return & v1.SleepAction {}
701+ }
702+ in := l [0 ].(map [string ]interface {})
703+ obj := v1.SleepAction {}
704+ if v , ok := in ["seconds" ].(int ); ok && v >= 0 {
705+ obj .Seconds = int64 (v )
706+ }
707+ return & obj
708+ }
709+
689710func expandTCPSocket (l []interface {}) * v1.TCPSocketAction {
690711 if len (l ) == 0 || l [0 ] == nil {
691712 return & v1.TCPSocketAction {}
@@ -791,6 +812,9 @@ func expandLifecycleHandlers(l []interface{}) *v1.LifecycleHandler {
791812 if v , ok := in ["tcp_socket" ].([]interface {}); ok && len (v ) > 0 {
792813 obj .TCPSocket = expandTCPSocket (v )
793814 }
815+ if v , ok := in ["sleep" ].([]interface {}); ok && len (v ) > 0 {
816+ obj .Sleep = expandSleep (v )
817+ }
794818 return & obj
795819}
796820
0 commit comments