Class: Zilla::IoK8sApiCoreV1PodSpec

Inherits:
Object
  • Object
show all
Defined in:
lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb

Overview

PodSpec is a description of a pod.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ IoK8sApiCoreV1PodSpec

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 218

def initialize(attributes = {})
  unless attributes.is_a?(Hash)
    raise ArgumentError,
          'The input argument (attributes) must be a hash in `Zilla::IoK8sApiCoreV1PodSpec` initialize method'
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) do |(k, v), h|
    unless self.class.attribute_map.key?(k.to_sym)
      raise ArgumentError,
            "`#{k}` is not a valid attribute in `Zilla::IoK8sApiCoreV1PodSpec`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end

    h[k.to_sym] = v
  end

  self.active_deadline_seconds = attributes[:active_deadline_seconds] if attributes.key?(:active_deadline_seconds)

  self.affinity = attributes[:affinity] if attributes.key?(:affinity)

  if attributes.key?(:automount_service_account_token)
    self. = attributes[:automount_service_account_token]
  end

  if attributes.key?(:containers) && (value = attributes[:containers]).is_a?(Array)
    self.containers = value
  end

  self.dns_config = attributes[:dns_config] if attributes.key?(:dns_config)

  self.dns_policy = attributes[:dns_policy] if attributes.key?(:dns_policy)

  self.enable_service_links = attributes[:enable_service_links] if attributes.key?(:enable_service_links)

  if attributes.key?(:ephemeral_containers) && (value = attributes[:ephemeral_containers]).is_a?(Array)
    self.ephemeral_containers = value
  end

  if attributes.key?(:host_aliases) && (value = attributes[:host_aliases]).is_a?(Array)
    self.host_aliases = value
  end

  self.host_ipc = attributes[:host_ipc] if attributes.key?(:host_ipc)

  self.host_network = attributes[:host_network] if attributes.key?(:host_network)

  self.host_pid = attributes[:host_pid] if attributes.key?(:host_pid)

  self.host_users = attributes[:host_users] if attributes.key?(:host_users)

  self.hostname = attributes[:hostname] if attributes.key?(:hostname)

  if attributes.key?(:image_pull_secrets) && (value = attributes[:image_pull_secrets]).is_a?(Array)
    self.image_pull_secrets = value
  end

  if attributes.key?(:init_containers) && (value = attributes[:init_containers]).is_a?(Array)
    self.init_containers = value
  end

  self.node_name = attributes[:node_name] if attributes.key?(:node_name)

  if attributes.key?(:node_selector) && (value = attributes[:node_selector]).is_a?(Hash)
    self.node_selector = value
  end

  self.os = attributes[:os] if attributes.key?(:os)

  if attributes.key?(:overhead) && (value = attributes[:overhead]).is_a?(Hash)
    self.overhead = value
  end

  self.preemption_policy = attributes[:preemption_policy] if attributes.key?(:preemption_policy)

  self.priority = attributes[:priority] if attributes.key?(:priority)

  self.priority_class_name = attributes[:priority_class_name] if attributes.key?(:priority_class_name)

  if attributes.key?(:readiness_gates) && (value = attributes[:readiness_gates]).is_a?(Array)
    self.readiness_gates = value
  end

  self.restart_policy = attributes[:restart_policy] if attributes.key?(:restart_policy)

  self.runtime_class_name = attributes[:runtime_class_name] if attributes.key?(:runtime_class_name)

  self.scheduler_name = attributes[:scheduler_name] if attributes.key?(:scheduler_name)

  self.security_context = attributes[:security_context] if attributes.key?(:security_context)

  self. = attributes[:service_account] if attributes.key?(:service_account)

  self. = attributes[:service_account_name] if attributes.key?(:service_account_name)

  self.set_hostname_as_fqdn = attributes[:set_hostname_as_fqdn] if attributes.key?(:set_hostname_as_fqdn)

  self.share_process_namespace = attributes[:share_process_namespace] if attributes.key?(:share_process_namespace)

  self.subdomain = attributes[:subdomain] if attributes.key?(:subdomain)

  if attributes.key?(:termination_grace_period_seconds)
    self.termination_grace_period_seconds = attributes[:termination_grace_period_seconds]
  end

  if attributes.key?(:tolerations) && (value = attributes[:tolerations]).is_a?(Array)
    self.tolerations = value
  end

  if attributes.key?(:topology_spread_constraints) && (value = attributes[:topology_spread_constraints]).is_a?(Array)
    self.topology_spread_constraints = value
  end

  return unless attributes.key?(:volumes)
  return unless (value = attributes[:volumes]).is_a?(Array)

  self.volumes = value
end

Instance Attribute Details

#active_deadline_secondsObject

Optional duration in seconds the pod may be active on the node relative to StartTime before the system will actively try to mark it failed and kill associated containers. Value must be a positive integer.



20
21
22
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 20

def active_deadline_seconds
  @active_deadline_seconds
end

#affinityObject

Returns the value of attribute affinity.



22
23
24
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 22

def affinity
  @affinity
end

#automount_service_account_tokenObject

AutomountServiceAccountToken indicates whether a service account token should be automatically mounted.



25
26
27
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 25

def 
  @automount_service_account_token
end

#containersObject

List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated.



28
29
30
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 28

def containers
  @containers
end

#dns_configObject

Returns the value of attribute dns_config.



22
23
24
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 22

def dns_config
  @dns_config
end

#dns_policyObject

Set DNS policy for the pod. Defaults to "ClusterFirst". Valid values are ‘ClusterFirstWithHostNet’, ‘ClusterFirst’, ‘Default’ or ‘None’. DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to ‘ClusterFirstWithHostNet’.



31
32
33
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 31

def dns_policy
  @dns_policy
end

EnableServiceLinks indicates whether information about services should be injected into pod’s environment variables, matching the syntax of Docker links. Optional: Defaults to true.



34
35
36
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 34

def enable_service_links
  @enable_service_links
end

#ephemeral_containersObject

List of ephemeral containers run in this pod. Ephemeral containers may be run in an existing pod to perform user-initiated actions such as debugging. This list cannot be specified when creating a pod, and it cannot be modified by updating the pod spec. In order to add an ephemeral container to an existing pod, use the pod’s ephemeralcontainers subresource.



37
38
39
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 37

def ephemeral_containers
  @ephemeral_containers
end

#host_aliasesObject

HostAliases is an optional list of hosts and IPs that will be injected into the pod’s hosts file if specified. This is only valid for non-hostNetwork pods.



40
41
42
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 40

def host_aliases
  @host_aliases
end

#host_ipcObject

Use the host’s ipc namespace. Optional: Default to false.



43
44
45
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 43

def host_ipc
  @host_ipc
end

#host_networkObject

Host networking requested for this pod. Use the host’s network namespace. If this option is set, the ports that will be used must be specified. Default to false.



46
47
48
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 46

def host_network
  @host_network
end

#host_pidObject

Use the host’s pid namespace. Optional: Default to false.



49
50
51
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 49

def host_pid
  @host_pid
end

#host_usersObject

Use the host’s user namespace. Optional: Default to true. If set to true or not present, the pod will be run in the host user namespace, useful for when the pod needs a feature only available to the host user namespace, such as loading a kernel module with CAP_SYS_MODULE. When set to false, a new userns is created for the pod. Setting false is useful for mitigating container breakout vulnerabilities even allowing users to run their containers as root without actually having root privileges on the host. This field is alpha-level and is only honored by servers that enable the UserNamespacesSupport feature.



52
53
54
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 52

def host_users
  @host_users
end

#hostnameObject

Specifies the hostname of the Pod If not specified, the pod’s hostname will be set to a system-defined value.



55
56
57
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 55

def hostname
  @hostname
end

#image_pull_secretsObject

ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. More info: kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod



58
59
60
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 58

def image_pull_secrets
  @image_pull_secrets
end

#init_containersObject

List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: kubernetes.io/docs/concepts/workloads/pods/init-containers/



61
62
63
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 61

def init_containers
  @init_containers
end

#node_nameObject

NodeName is a request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements.



64
65
66
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 64

def node_name
  @node_name
end

#node_selectorObject

NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node’s labels for the pod to be scheduled on that node. More info: kubernetes.io/docs/concepts/configuration/assign-pod-node/



67
68
69
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 67

def node_selector
  @node_selector
end

#osObject

Returns the value of attribute os.



22
23
24
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 22

def os
  @os
end

#overheadObject

Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. This field will be autopopulated at admission time by the RuntimeClass admission controller. If the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests. The RuntimeClass admission controller will reject Pod create requests which have the overhead already set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. More info: git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md



70
71
72
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 70

def overhead
  @overhead
end

#preemption_policyObject

PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset.



73
74
75
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 73

def preemption_policy
  @preemption_policy
end

#priorityObject

The priority value. Various system components use this field to find the priority of the pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority.



76
77
78
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 76

def priority
  @priority
end

#priority_class_nameObject

If specified, indicates the pod’s priority. "system-node-critical" and "system-cluster-critical" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default.



79
80
81
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 79

def priority_class_name
  @priority_class_name
end

#readiness_gatesObject

If specified, all readiness gates will be evaluated for pod readiness. A pod is ready when all its containers are ready AND all conditions specified in the readiness gates have status equal to "True" More info: git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates



82
83
84
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 82

def readiness_gates
  @readiness_gates
end

#restart_policyObject

Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. More info: kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy



85
86
87
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 85

def restart_policy
  @restart_policy
end

#runtime_class_nameObject

RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. If unset or empty, the "legacy" RuntimeClass will be used, which is an implicit class with an empty definition that uses the default runtime handler. More info: git.k8s.io/enhancements/keps/sig-node/585-runtime-class



88
89
90
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 88

def runtime_class_name
  @runtime_class_name
end

#scheduler_nameObject

If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler.



91
92
93
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 91

def scheduler_name
  @scheduler_name
end

#security_contextObject

Returns the value of attribute security_context.



22
23
24
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 22

def security_context
  @security_context
end

#service_accountObject

DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.



94
95
96
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 94

def 
  @service_account
end

#service_account_nameObject

ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/



97
98
99
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 97

def 
  @service_account_name
end

#set_hostname_as_fqdnObject

If true the pod’s hostname will be configured as the pod’s FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.



100
101
102
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 100

def set_hostname_as_fqdn
  @set_hostname_as_fqdn
end

#share_process_namespaceObject

Share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers in the same pod, and the first process in each container will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both be set. Optional: Default to false.



103
104
105
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 103

def share_process_namespace
  @share_process_namespace
end

#subdomainObject

If specified, the fully qualified Pod hostname will be "<hostname>.<subdomain>.<pod namespace>.svc.<cluster domain>". If not specified, the pod will not have a domainname at all.



106
107
108
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 106

def subdomain
  @subdomain
end

#termination_grace_period_secondsObject

Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 30 seconds.



109
110
111
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 109

def termination_grace_period_seconds
  @termination_grace_period_seconds
end

#tolerationsObject

If specified, the pod’s tolerations.



112
113
114
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 112

def tolerations
  @tolerations
end

#topology_spread_constraintsObject

TopologySpreadConstraints describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. All topologySpreadConstraints are ANDed.



115
116
117
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 115

def topology_spread_constraints
  @topology_spread_constraints
end

#volumesObject

List of volumes that can be mounted by containers belonging to the pod. More info: kubernetes.io/docs/concepts/storage/volumes



118
119
120
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 118

def volumes
  @volumes
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



164
165
166
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 164

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 121

def self.attribute_map
  {
    active_deadline_seconds: :activeDeadlineSeconds,
    affinity: :affinity,
    automount_service_account_token: :automountServiceAccountToken,
    containers: :containers,
    dns_config: :dnsConfig,
    dns_policy: :dnsPolicy,
    enable_service_links: :enableServiceLinks,
    ephemeral_containers: :ephemeralContainers,
    host_aliases: :hostAliases,
    host_ipc: :hostIPC,
    host_network: :hostNetwork,
    host_pid: :hostPID,
    host_users: :hostUsers,
    hostname: :hostname,
    image_pull_secrets: :imagePullSecrets,
    init_containers: :initContainers,
    node_name: :nodeName,
    node_selector: :nodeSelector,
    os: :os,
    overhead: :overhead,
    preemption_policy: :preemptionPolicy,
    priority: :priority,
    priority_class_name: :priorityClassName,
    readiness_gates: :readinessGates,
    restart_policy: :restartPolicy,
    runtime_class_name: :runtimeClassName,
    scheduler_name: :schedulerName,
    security_context: :securityContext,
    service_account: :serviceAccount,
    service_account_name: :serviceAccountName,
    set_hostname_as_fqdn: :setHostnameAsFQDN,
    share_process_namespace: :shareProcessNamespace,
    subdomain: :subdomain,
    termination_grace_period_seconds: :terminationGracePeriodSeconds,
    tolerations: :tolerations,
    topology_spread_constraints: :topologySpreadConstraints,
    volumes: :volumes
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



414
415
416
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 414

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



212
213
214
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 212

def self.openapi_nullable
  Set.new([])
end

.openapi_typesObject

Attribute type mapping.



169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 169

def self.openapi_types
  {
    active_deadline_seconds: :Integer,
    affinity: :IoK8sApiCoreV1Affinity,
    automount_service_account_token: :Boolean,
    containers: :'Array<IoK8sApiCoreV1Container>',
    dns_config: :IoK8sApiCoreV1PodDNSConfig,
    dns_policy: :String,
    enable_service_links: :Boolean,
    ephemeral_containers: :'Array<IoK8sApiCoreV1EphemeralContainer>',
    host_aliases: :'Array<IoK8sApiCoreV1HostAlias>',
    host_ipc: :Boolean,
    host_network: :Boolean,
    host_pid: :Boolean,
    host_users: :Boolean,
    hostname: :String,
    image_pull_secrets: :'Array<IoK8sApiCoreV1LocalObjectReference>',
    init_containers: :'Array<IoK8sApiCoreV1Container>',
    node_name: :String,
    node_selector: :'Hash<String, String>',
    os: :IoK8sApiCoreV1PodOS,
    overhead: :'Hash<String, String>',
    preemption_policy: :String,
    priority: :Integer,
    priority_class_name: :String,
    readiness_gates: :'Array<IoK8sApiCoreV1PodReadinessGate>',
    restart_policy: :String,
    runtime_class_name: :String,
    scheduler_name: :String,
    security_context: :IoK8sApiCoreV1PodSecurityContext,
    service_account: :String,
    service_account_name: :String,
    set_hostname_as_fqdn: :Boolean,
    share_process_namespace: :Boolean,
    subdomain: :String,
    termination_grace_period_seconds: :Integer,
    tolerations: :'Array<IoK8sApiCoreV1Toleration>',
    topology_spread_constraints: :'Array<IoK8sApiCoreV1TopologySpreadConstraint>',
    volumes: :'Array<IoK8sApiCoreV1Volume>'
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 355

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    active_deadline_seconds == other.active_deadline_seconds &&
    affinity == other.affinity &&
     == other. &&
    containers == other.containers &&
    dns_config == other.dns_config &&
    dns_policy == other.dns_policy &&
    enable_service_links == other.enable_service_links &&
    ephemeral_containers == other.ephemeral_containers &&
    host_aliases == other.host_aliases &&
    host_ipc == other.host_ipc &&
    host_network == other.host_network &&
    host_pid == other.host_pid &&
    host_users == other.host_users &&
    hostname == other.hostname &&
    image_pull_secrets == other.image_pull_secrets &&
    init_containers == other.init_containers &&
    node_name == other.node_name &&
    node_selector == other.node_selector &&
    os == other.os &&
    overhead == other.overhead &&
    preemption_policy == other.preemption_policy &&
    priority == other.priority &&
    priority_class_name == other.priority_class_name &&
    readiness_gates == other.readiness_gates &&
    restart_policy == other.restart_policy &&
    runtime_class_name == other.runtime_class_name &&
    scheduler_name == other.scheduler_name &&
    security_context == other.security_context &&
     == other. &&
     == other. &&
    set_hostname_as_fqdn == other.set_hostname_as_fqdn &&
    share_process_namespace == other.share_process_namespace &&
    subdomain == other.subdomain &&
    termination_grace_period_seconds == other.termination_grace_period_seconds &&
    tolerations == other.tolerations &&
    topology_spread_constraints == other.topology_spread_constraints &&
    volumes == other.volumes
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 448

def _deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = Zilla.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



519
520
521
522
523
524
525
526
527
528
529
530
531
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 519

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 421

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  attributes = attributes.transform_keys(&:to_sym)
  self.class.openapi_types.each_pair do |key, type|
    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      send("#{key}=", nil)
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        send("#{key}=", attributes[self.class.attribute_map[key]].map do |v|
                          _deserialize(::Regexp.last_match(1), v)
                        end)
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


400
401
402
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 400

def eql?(other)
  self == other
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



406
407
408
409
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 406

def hash
  [active_deadline_seconds, affinity, , containers, dns_config, dns_policy,
   enable_service_links, ephemeral_containers, host_aliases, host_ipc, host_network, host_pid, host_users, hostname, image_pull_secrets, init_containers, node_name, node_selector, os, overhead, preemption_policy, priority, priority_class_name, readiness_gates, restart_policy, runtime_class_name, scheduler_name, security_context, , , set_hostname_as_fqdn, share_process_namespace, subdomain, termination_grace_period_seconds, tolerations, topology_spread_constraints, volumes].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



338
339
340
341
342
343
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 338

def list_invalid_properties
  invalid_properties = []
  invalid_properties.push('invalid value for "containers", containers cannot be nil.') if @containers.nil?

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



495
496
497
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 495

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



501
502
503
504
505
506
507
508
509
510
511
512
513
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 501

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



489
490
491
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 489

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



347
348
349
350
351
# File 'lib/zilla/models/io_k8s_api_core_v1_pod_spec.rb', line 347

def valid?
  return false if @containers.nil?

  true
end