forked from LaconicNetwork/kompose
update vendor with openshift
This commit is contained in:
+191
@@ -0,0 +1,191 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
Copyright 2014 Red Hat, Inc.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
+565
@@ -0,0 +1,565 @@
|
||||
// +build !ignore_autogenerated_openshift
|
||||
|
||||
// This file was autogenerated by deepcopy-gen. Do not edit it manually!
|
||||
|
||||
package api
|
||||
|
||||
import (
|
||||
image_api "github.com/openshift/origin/pkg/image/api"
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
|
||||
conversion "k8s.io/kubernetes/pkg/conversion"
|
||||
intstr "k8s.io/kubernetes/pkg/util/intstr"
|
||||
)
|
||||
|
||||
func init() {
|
||||
if err := api.Scheme.AddGeneratedDeepCopyFuncs(
|
||||
DeepCopy_api_CustomDeploymentStrategyParams,
|
||||
DeepCopy_api_DeploymentCause,
|
||||
DeepCopy_api_DeploymentCauseImageTrigger,
|
||||
DeepCopy_api_DeploymentConfig,
|
||||
DeepCopy_api_DeploymentConfigList,
|
||||
DeepCopy_api_DeploymentConfigRollback,
|
||||
DeepCopy_api_DeploymentConfigRollbackSpec,
|
||||
DeepCopy_api_DeploymentConfigSpec,
|
||||
DeepCopy_api_DeploymentConfigStatus,
|
||||
DeepCopy_api_DeploymentDetails,
|
||||
DeepCopy_api_DeploymentLog,
|
||||
DeepCopy_api_DeploymentLogOptions,
|
||||
DeepCopy_api_DeploymentStrategy,
|
||||
DeepCopy_api_DeploymentTriggerImageChangeParams,
|
||||
DeepCopy_api_DeploymentTriggerPolicy,
|
||||
DeepCopy_api_ExecNewPodHook,
|
||||
DeepCopy_api_LifecycleHook,
|
||||
DeepCopy_api_RecreateDeploymentStrategyParams,
|
||||
DeepCopy_api_RollingDeploymentStrategyParams,
|
||||
DeepCopy_api_TagImageHook,
|
||||
DeepCopy_api_TemplateImage,
|
||||
); err != nil {
|
||||
// if one of the deep copy functions is malformed, detect it immediately.
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_api_CustomDeploymentStrategyParams(in CustomDeploymentStrategyParams, out *CustomDeploymentStrategyParams, c *conversion.Cloner) error {
|
||||
out.Image = in.Image
|
||||
if in.Environment != nil {
|
||||
in, out := in.Environment, &out.Environment
|
||||
*out = make([]api.EnvVar, len(in))
|
||||
for i := range in {
|
||||
if err := api.DeepCopy_api_EnvVar(in[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Environment = nil
|
||||
}
|
||||
if in.Command != nil {
|
||||
in, out := in.Command, &out.Command
|
||||
*out = make([]string, len(in))
|
||||
copy(*out, in)
|
||||
} else {
|
||||
out.Command = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_DeploymentCause(in DeploymentCause, out *DeploymentCause, c *conversion.Cloner) error {
|
||||
out.Type = in.Type
|
||||
if in.ImageTrigger != nil {
|
||||
in, out := in.ImageTrigger, &out.ImageTrigger
|
||||
*out = new(DeploymentCauseImageTrigger)
|
||||
if err := DeepCopy_api_DeploymentCauseImageTrigger(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.ImageTrigger = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_DeploymentCauseImageTrigger(in DeploymentCauseImageTrigger, out *DeploymentCauseImageTrigger, c *conversion.Cloner) error {
|
||||
if err := api.DeepCopy_api_ObjectReference(in.From, &out.From, c); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_DeploymentConfig(in DeploymentConfig, out *DeploymentConfig, c *conversion.Cloner) error {
|
||||
if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := DeepCopy_api_DeploymentConfigSpec(in.Spec, &out.Spec, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := DeepCopy_api_DeploymentConfigStatus(in.Status, &out.Status, c); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_DeploymentConfigList(in DeploymentConfigList, out *DeploymentConfigList, c *conversion.Cloner) error {
|
||||
if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if in.Items != nil {
|
||||
in, out := in.Items, &out.Items
|
||||
*out = make([]DeploymentConfig, len(in))
|
||||
for i := range in {
|
||||
if err := DeepCopy_api_DeploymentConfig(in[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Items = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_DeploymentConfigRollback(in DeploymentConfigRollback, out *DeploymentConfigRollback, c *conversion.Cloner) error {
|
||||
if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
out.Name = in.Name
|
||||
if in.UpdatedAnnotations != nil {
|
||||
in, out := in.UpdatedAnnotations, &out.UpdatedAnnotations
|
||||
*out = make(map[string]string)
|
||||
for key, val := range in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
} else {
|
||||
out.UpdatedAnnotations = nil
|
||||
}
|
||||
if err := DeepCopy_api_DeploymentConfigRollbackSpec(in.Spec, &out.Spec, c); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_DeploymentConfigRollbackSpec(in DeploymentConfigRollbackSpec, out *DeploymentConfigRollbackSpec, c *conversion.Cloner) error {
|
||||
if err := api.DeepCopy_api_ObjectReference(in.From, &out.From, c); err != nil {
|
||||
return err
|
||||
}
|
||||
out.Revision = in.Revision
|
||||
out.IncludeTriggers = in.IncludeTriggers
|
||||
out.IncludeTemplate = in.IncludeTemplate
|
||||
out.IncludeReplicationMeta = in.IncludeReplicationMeta
|
||||
out.IncludeStrategy = in.IncludeStrategy
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_DeploymentConfigSpec(in DeploymentConfigSpec, out *DeploymentConfigSpec, c *conversion.Cloner) error {
|
||||
if err := DeepCopy_api_DeploymentStrategy(in.Strategy, &out.Strategy, c); err != nil {
|
||||
return err
|
||||
}
|
||||
out.MinReadySeconds = in.MinReadySeconds
|
||||
if in.Triggers != nil {
|
||||
in, out := in.Triggers, &out.Triggers
|
||||
*out = make([]DeploymentTriggerPolicy, len(in))
|
||||
for i := range in {
|
||||
if err := DeepCopy_api_DeploymentTriggerPolicy(in[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Triggers = nil
|
||||
}
|
||||
out.Replicas = in.Replicas
|
||||
if in.RevisionHistoryLimit != nil {
|
||||
in, out := in.RevisionHistoryLimit, &out.RevisionHistoryLimit
|
||||
*out = new(int32)
|
||||
**out = *in
|
||||
} else {
|
||||
out.RevisionHistoryLimit = nil
|
||||
}
|
||||
out.Test = in.Test
|
||||
out.Paused = in.Paused
|
||||
if in.Selector != nil {
|
||||
in, out := in.Selector, &out.Selector
|
||||
*out = make(map[string]string)
|
||||
for key, val := range in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
} else {
|
||||
out.Selector = nil
|
||||
}
|
||||
if in.Template != nil {
|
||||
in, out := in.Template, &out.Template
|
||||
*out = new(api.PodTemplateSpec)
|
||||
if err := api.DeepCopy_api_PodTemplateSpec(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Template = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_DeploymentConfigStatus(in DeploymentConfigStatus, out *DeploymentConfigStatus, c *conversion.Cloner) error {
|
||||
out.LatestVersion = in.LatestVersion
|
||||
out.ObservedGeneration = in.ObservedGeneration
|
||||
out.Replicas = in.Replicas
|
||||
out.UpdatedReplicas = in.UpdatedReplicas
|
||||
out.AvailableReplicas = in.AvailableReplicas
|
||||
out.UnavailableReplicas = in.UnavailableReplicas
|
||||
if in.Details != nil {
|
||||
in, out := in.Details, &out.Details
|
||||
*out = new(DeploymentDetails)
|
||||
if err := DeepCopy_api_DeploymentDetails(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Details = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_DeploymentDetails(in DeploymentDetails, out *DeploymentDetails, c *conversion.Cloner) error {
|
||||
out.Message = in.Message
|
||||
if in.Causes != nil {
|
||||
in, out := in.Causes, &out.Causes
|
||||
*out = make([]DeploymentCause, len(in))
|
||||
for i := range in {
|
||||
if err := DeepCopy_api_DeploymentCause(in[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Causes = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_DeploymentLog(in DeploymentLog, out *DeploymentLog, c *conversion.Cloner) error {
|
||||
if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_DeploymentLogOptions(in DeploymentLogOptions, out *DeploymentLogOptions, c *conversion.Cloner) error {
|
||||
if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
out.Container = in.Container
|
||||
out.Follow = in.Follow
|
||||
out.Previous = in.Previous
|
||||
if in.SinceSeconds != nil {
|
||||
in, out := in.SinceSeconds, &out.SinceSeconds
|
||||
*out = new(int64)
|
||||
**out = *in
|
||||
} else {
|
||||
out.SinceSeconds = nil
|
||||
}
|
||||
if in.SinceTime != nil {
|
||||
in, out := in.SinceTime, &out.SinceTime
|
||||
*out = new(unversioned.Time)
|
||||
if err := unversioned.DeepCopy_unversioned_Time(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.SinceTime = nil
|
||||
}
|
||||
out.Timestamps = in.Timestamps
|
||||
if in.TailLines != nil {
|
||||
in, out := in.TailLines, &out.TailLines
|
||||
*out = new(int64)
|
||||
**out = *in
|
||||
} else {
|
||||
out.TailLines = nil
|
||||
}
|
||||
if in.LimitBytes != nil {
|
||||
in, out := in.LimitBytes, &out.LimitBytes
|
||||
*out = new(int64)
|
||||
**out = *in
|
||||
} else {
|
||||
out.LimitBytes = nil
|
||||
}
|
||||
out.NoWait = in.NoWait
|
||||
if in.Version != nil {
|
||||
in, out := in.Version, &out.Version
|
||||
*out = new(int64)
|
||||
**out = *in
|
||||
} else {
|
||||
out.Version = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_DeploymentStrategy(in DeploymentStrategy, out *DeploymentStrategy, c *conversion.Cloner) error {
|
||||
out.Type = in.Type
|
||||
if in.RecreateParams != nil {
|
||||
in, out := in.RecreateParams, &out.RecreateParams
|
||||
*out = new(RecreateDeploymentStrategyParams)
|
||||
if err := DeepCopy_api_RecreateDeploymentStrategyParams(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.RecreateParams = nil
|
||||
}
|
||||
if in.RollingParams != nil {
|
||||
in, out := in.RollingParams, &out.RollingParams
|
||||
*out = new(RollingDeploymentStrategyParams)
|
||||
if err := DeepCopy_api_RollingDeploymentStrategyParams(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.RollingParams = nil
|
||||
}
|
||||
if in.CustomParams != nil {
|
||||
in, out := in.CustomParams, &out.CustomParams
|
||||
*out = new(CustomDeploymentStrategyParams)
|
||||
if err := DeepCopy_api_CustomDeploymentStrategyParams(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.CustomParams = nil
|
||||
}
|
||||
if err := api.DeepCopy_api_ResourceRequirements(in.Resources, &out.Resources, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if in.Labels != nil {
|
||||
in, out := in.Labels, &out.Labels
|
||||
*out = make(map[string]string)
|
||||
for key, val := range in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
} else {
|
||||
out.Labels = nil
|
||||
}
|
||||
if in.Annotations != nil {
|
||||
in, out := in.Annotations, &out.Annotations
|
||||
*out = make(map[string]string)
|
||||
for key, val := range in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
} else {
|
||||
out.Annotations = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_DeploymentTriggerImageChangeParams(in DeploymentTriggerImageChangeParams, out *DeploymentTriggerImageChangeParams, c *conversion.Cloner) error {
|
||||
out.Automatic = in.Automatic
|
||||
if in.ContainerNames != nil {
|
||||
in, out := in.ContainerNames, &out.ContainerNames
|
||||
*out = make([]string, len(in))
|
||||
copy(*out, in)
|
||||
} else {
|
||||
out.ContainerNames = nil
|
||||
}
|
||||
if err := api.DeepCopy_api_ObjectReference(in.From, &out.From, c); err != nil {
|
||||
return err
|
||||
}
|
||||
out.LastTriggeredImage = in.LastTriggeredImage
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_DeploymentTriggerPolicy(in DeploymentTriggerPolicy, out *DeploymentTriggerPolicy, c *conversion.Cloner) error {
|
||||
out.Type = in.Type
|
||||
if in.ImageChangeParams != nil {
|
||||
in, out := in.ImageChangeParams, &out.ImageChangeParams
|
||||
*out = new(DeploymentTriggerImageChangeParams)
|
||||
if err := DeepCopy_api_DeploymentTriggerImageChangeParams(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.ImageChangeParams = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_ExecNewPodHook(in ExecNewPodHook, out *ExecNewPodHook, c *conversion.Cloner) error {
|
||||
if in.Command != nil {
|
||||
in, out := in.Command, &out.Command
|
||||
*out = make([]string, len(in))
|
||||
copy(*out, in)
|
||||
} else {
|
||||
out.Command = nil
|
||||
}
|
||||
if in.Env != nil {
|
||||
in, out := in.Env, &out.Env
|
||||
*out = make([]api.EnvVar, len(in))
|
||||
for i := range in {
|
||||
if err := api.DeepCopy_api_EnvVar(in[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Env = nil
|
||||
}
|
||||
out.ContainerName = in.ContainerName
|
||||
if in.Volumes != nil {
|
||||
in, out := in.Volumes, &out.Volumes
|
||||
*out = make([]string, len(in))
|
||||
copy(*out, in)
|
||||
} else {
|
||||
out.Volumes = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_LifecycleHook(in LifecycleHook, out *LifecycleHook, c *conversion.Cloner) error {
|
||||
out.FailurePolicy = in.FailurePolicy
|
||||
if in.ExecNewPod != nil {
|
||||
in, out := in.ExecNewPod, &out.ExecNewPod
|
||||
*out = new(ExecNewPodHook)
|
||||
if err := DeepCopy_api_ExecNewPodHook(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.ExecNewPod = nil
|
||||
}
|
||||
if in.TagImages != nil {
|
||||
in, out := in.TagImages, &out.TagImages
|
||||
*out = make([]TagImageHook, len(in))
|
||||
for i := range in {
|
||||
if err := DeepCopy_api_TagImageHook(in[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.TagImages = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_RecreateDeploymentStrategyParams(in RecreateDeploymentStrategyParams, out *RecreateDeploymentStrategyParams, c *conversion.Cloner) error {
|
||||
if in.TimeoutSeconds != nil {
|
||||
in, out := in.TimeoutSeconds, &out.TimeoutSeconds
|
||||
*out = new(int64)
|
||||
**out = *in
|
||||
} else {
|
||||
out.TimeoutSeconds = nil
|
||||
}
|
||||
if in.Pre != nil {
|
||||
in, out := in.Pre, &out.Pre
|
||||
*out = new(LifecycleHook)
|
||||
if err := DeepCopy_api_LifecycleHook(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Pre = nil
|
||||
}
|
||||
if in.Mid != nil {
|
||||
in, out := in.Mid, &out.Mid
|
||||
*out = new(LifecycleHook)
|
||||
if err := DeepCopy_api_LifecycleHook(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Mid = nil
|
||||
}
|
||||
if in.Post != nil {
|
||||
in, out := in.Post, &out.Post
|
||||
*out = new(LifecycleHook)
|
||||
if err := DeepCopy_api_LifecycleHook(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Post = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_RollingDeploymentStrategyParams(in RollingDeploymentStrategyParams, out *RollingDeploymentStrategyParams, c *conversion.Cloner) error {
|
||||
if in.UpdatePeriodSeconds != nil {
|
||||
in, out := in.UpdatePeriodSeconds, &out.UpdatePeriodSeconds
|
||||
*out = new(int64)
|
||||
**out = *in
|
||||
} else {
|
||||
out.UpdatePeriodSeconds = nil
|
||||
}
|
||||
if in.IntervalSeconds != nil {
|
||||
in, out := in.IntervalSeconds, &out.IntervalSeconds
|
||||
*out = new(int64)
|
||||
**out = *in
|
||||
} else {
|
||||
out.IntervalSeconds = nil
|
||||
}
|
||||
if in.TimeoutSeconds != nil {
|
||||
in, out := in.TimeoutSeconds, &out.TimeoutSeconds
|
||||
*out = new(int64)
|
||||
**out = *in
|
||||
} else {
|
||||
out.TimeoutSeconds = nil
|
||||
}
|
||||
if err := intstr.DeepCopy_intstr_IntOrString(in.MaxUnavailable, &out.MaxUnavailable, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := intstr.DeepCopy_intstr_IntOrString(in.MaxSurge, &out.MaxSurge, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if in.UpdatePercent != nil {
|
||||
in, out := in.UpdatePercent, &out.UpdatePercent
|
||||
*out = new(int32)
|
||||
**out = *in
|
||||
} else {
|
||||
out.UpdatePercent = nil
|
||||
}
|
||||
if in.Pre != nil {
|
||||
in, out := in.Pre, &out.Pre
|
||||
*out = new(LifecycleHook)
|
||||
if err := DeepCopy_api_LifecycleHook(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Pre = nil
|
||||
}
|
||||
if in.Post != nil {
|
||||
in, out := in.Post, &out.Post
|
||||
*out = new(LifecycleHook)
|
||||
if err := DeepCopy_api_LifecycleHook(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Post = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_TagImageHook(in TagImageHook, out *TagImageHook, c *conversion.Cloner) error {
|
||||
out.ContainerName = in.ContainerName
|
||||
if err := api.DeepCopy_api_ObjectReference(in.To, &out.To, c); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_TemplateImage(in TemplateImage, out *TemplateImage, c *conversion.Cloner) error {
|
||||
out.Image = in.Image
|
||||
if in.Ref != nil {
|
||||
in, out := in.Ref, &out.Ref
|
||||
*out = new(image_api.DockerImageReference)
|
||||
if err := image_api.DeepCopy_api_DockerImageReference(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Ref = nil
|
||||
}
|
||||
if in.From != nil {
|
||||
in, out := in.From, &out.From
|
||||
*out = new(api.ObjectReference)
|
||||
if err := api.DeepCopy_api_ObjectReference(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.From = nil
|
||||
}
|
||||
if in.Container != nil {
|
||||
in, out := in.Container, &out.Container
|
||||
*out = new(api.Container)
|
||||
if err := api.DeepCopy_api_Container(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Container = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package api
|
||||
|
||||
import "k8s.io/kubernetes/pkg/fields"
|
||||
|
||||
// DeploymentConfigToSelectableFields returns a label set that represents the object
|
||||
func DeploymentConfigToSelectableFields(deploymentConfig *DeploymentConfig) fields.Set {
|
||||
return fields.Set{
|
||||
"metadata.name": deploymentConfig.Name,
|
||||
"metadata.namespace": deploymentConfig.Namespace,
|
||||
}
|
||||
}
|
||||
+141
@@ -0,0 +1,141 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
kapi "k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/apis/extensions"
|
||||
|
||||
imageapi "github.com/openshift/origin/pkg/image/api"
|
||||
)
|
||||
|
||||
// DeploymentToPodLogOptions builds a PodLogOptions object out of a DeploymentLogOptions.
|
||||
// Currently DeploymentLogOptions.Container and DeploymentLogOptions.Previous aren't used
|
||||
// so they won't be copied to PodLogOptions.
|
||||
//
|
||||
// Note that Previous for PodLogOptions is different from Previous for DeploymentLogOptions
|
||||
// so it shouldn't be included here.
|
||||
func DeploymentToPodLogOptions(opts *DeploymentLogOptions) *kapi.PodLogOptions {
|
||||
return &kapi.PodLogOptions{
|
||||
Follow: opts.Follow,
|
||||
SinceSeconds: opts.SinceSeconds,
|
||||
SinceTime: opts.SinceTime,
|
||||
Timestamps: opts.Timestamps,
|
||||
TailLines: opts.TailLines,
|
||||
LimitBytes: opts.LimitBytes,
|
||||
}
|
||||
}
|
||||
|
||||
// ScaleFromConfig builds a scale resource out of a deployment config.
|
||||
func ScaleFromConfig(dc *DeploymentConfig) *extensions.Scale {
|
||||
return &extensions.Scale{
|
||||
ObjectMeta: kapi.ObjectMeta{
|
||||
Name: dc.Name,
|
||||
Namespace: dc.Namespace,
|
||||
UID: dc.UID,
|
||||
ResourceVersion: dc.ResourceVersion,
|
||||
CreationTimestamp: dc.CreationTimestamp,
|
||||
},
|
||||
Spec: extensions.ScaleSpec{
|
||||
Replicas: dc.Spec.Replicas,
|
||||
},
|
||||
Status: extensions.ScaleStatus{
|
||||
Replicas: dc.Status.Replicas,
|
||||
Selector: &unversioned.LabelSelector{
|
||||
MatchLabels: dc.Spec.Selector,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// TemplateImage is a structure for helping a caller iterate over a PodSpec
|
||||
type TemplateImage struct {
|
||||
Image string
|
||||
|
||||
Ref *imageapi.DockerImageReference
|
||||
|
||||
From *kapi.ObjectReference
|
||||
|
||||
Container *kapi.Container
|
||||
}
|
||||
|
||||
// TemplateImageForContainer locates the requested container in a pod spec, returning information about the
|
||||
// trigger (if it exists), or an error.
|
||||
func TemplateImageForContainer(pod *kapi.PodSpec, triggerFn TriggeredByFunc, containerName string) (TemplateImage, error) {
|
||||
for i := range pod.Containers {
|
||||
container := &pod.Containers[i]
|
||||
if container.Name != containerName {
|
||||
continue
|
||||
}
|
||||
var ref imageapi.DockerImageReference
|
||||
if trigger, ok := triggerFn(container); ok {
|
||||
trigger.Image = container.Image
|
||||
trigger.Container = container
|
||||
return trigger, nil
|
||||
}
|
||||
ref, err := imageapi.ParseDockerImageReference(container.Image)
|
||||
if err != nil {
|
||||
return TemplateImage{Image: container.Image, Container: container}, err
|
||||
}
|
||||
return TemplateImage{Image: container.Image, Ref: &ref, Container: container}, nil
|
||||
}
|
||||
return TemplateImage{}, fmt.Errorf("no container %q found", containerName)
|
||||
}
|
||||
|
||||
// EachTemplateImage iterates a pod spec, looking for triggers that match each container and invoking
|
||||
// fn with each located image.
|
||||
func EachTemplateImage(pod *kapi.PodSpec, triggerFn TriggeredByFunc, fn func(TemplateImage, error)) {
|
||||
for i := range pod.Containers {
|
||||
container := &pod.Containers[i]
|
||||
var ref imageapi.DockerImageReference
|
||||
if trigger, ok := triggerFn(container); ok {
|
||||
trigger.Image = container.Image
|
||||
trigger.Container = container
|
||||
fn(trigger, nil)
|
||||
continue
|
||||
}
|
||||
ref, err := imageapi.ParseDockerImageReference(container.Image)
|
||||
if err != nil {
|
||||
fn(TemplateImage{Image: container.Image, Container: container}, err)
|
||||
continue
|
||||
}
|
||||
fn(TemplateImage{Image: container.Image, Ref: &ref, Container: container}, nil)
|
||||
}
|
||||
}
|
||||
|
||||
// TriggeredByFunc returns a TemplateImage or error from the provided container
|
||||
type TriggeredByFunc func(container *kapi.Container) (TemplateImage, bool)
|
||||
|
||||
// IgnoreTriggers ignores the triggers
|
||||
func IgnoreTriggers(container *kapi.Container) (TemplateImage, bool) {
|
||||
return TemplateImage{}, false
|
||||
}
|
||||
|
||||
// DeploymentConfigHasTrigger returns a function that can identify the image for each container.
|
||||
func DeploymentConfigHasTrigger(config *DeploymentConfig) TriggeredByFunc {
|
||||
return func(container *kapi.Container) (TemplateImage, bool) {
|
||||
for _, trigger := range config.Spec.Triggers {
|
||||
params := trigger.ImageChangeParams
|
||||
if params == nil {
|
||||
continue
|
||||
}
|
||||
for _, name := range params.ContainerNames {
|
||||
if container.Name == name {
|
||||
if len(params.From.Name) == 0 {
|
||||
continue
|
||||
}
|
||||
from := params.From
|
||||
if len(from.Namespace) == 0 {
|
||||
from.Namespace = config.Namespace
|
||||
}
|
||||
return TemplateImage{
|
||||
Image: container.Image,
|
||||
From: &from,
|
||||
}, true
|
||||
}
|
||||
}
|
||||
}
|
||||
return TemplateImage{}, false
|
||||
}
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
)
|
||||
|
||||
const GroupName = ""
|
||||
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal}
|
||||
|
||||
// Kind takes an unqualified kind and returns back a Group qualified GroupKind
|
||||
func Kind(kind string) unversioned.GroupKind {
|
||||
return SchemeGroupVersion.WithKind(kind).GroupKind()
|
||||
}
|
||||
|
||||
// Resource takes an unqualified resource and returns back a Group qualified GroupResource
|
||||
func Resource(resource string) unversioned.GroupResource {
|
||||
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||||
}
|
||||
|
||||
func AddToScheme(scheme *runtime.Scheme) {
|
||||
// Add the API to Scheme.
|
||||
addKnownTypes(scheme)
|
||||
}
|
||||
|
||||
// Adds the list of known types to api.Scheme.
|
||||
func addKnownTypes(scheme *runtime.Scheme) {
|
||||
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||
&DeploymentConfig{},
|
||||
&DeploymentConfigList{},
|
||||
&DeploymentConfigRollback{},
|
||||
&DeploymentLog{},
|
||||
&DeploymentLogOptions{},
|
||||
)
|
||||
}
|
||||
|
||||
func (obj *DeploymentConfig) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
||||
func (obj *DeploymentConfigList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
||||
func (obj *DeploymentConfigRollback) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
||||
func (obj *DeploymentLog) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
||||
func (obj *DeploymentLogOptions) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
||||
+496
@@ -0,0 +1,496 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
kapi "k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/util/intstr"
|
||||
)
|
||||
|
||||
// DeploymentStatus describes the possible states a deployment can be in.
|
||||
type DeploymentStatus string
|
||||
|
||||
const (
|
||||
// DeploymentStatusNew means the deployment has been accepted but not yet acted upon.
|
||||
DeploymentStatusNew DeploymentStatus = "New"
|
||||
// DeploymentStatusPending means the deployment been handed over to a deployment strategy,
|
||||
// but the strategy has not yet declared the deployment to be running.
|
||||
DeploymentStatusPending DeploymentStatus = "Pending"
|
||||
// DeploymentStatusRunning means the deployment strategy has reported the deployment as
|
||||
// being in-progress.
|
||||
DeploymentStatusRunning DeploymentStatus = "Running"
|
||||
// DeploymentStatusComplete means the deployment finished without an error.
|
||||
DeploymentStatusComplete DeploymentStatus = "Complete"
|
||||
// DeploymentStatusFailed means the deployment finished with an error.
|
||||
DeploymentStatusFailed DeploymentStatus = "Failed"
|
||||
)
|
||||
|
||||
// DeploymentStrategy describes how to perform a deployment.
|
||||
type DeploymentStrategy struct {
|
||||
// Type is the name of a deployment strategy.
|
||||
Type DeploymentStrategyType
|
||||
|
||||
// RecreateParams are the input to the Recreate deployment strategy.
|
||||
RecreateParams *RecreateDeploymentStrategyParams
|
||||
// RollingParams are the input to the Rolling deployment strategy.
|
||||
RollingParams *RollingDeploymentStrategyParams
|
||||
|
||||
// CustomParams are the input to the Custom deployment strategy, and may also
|
||||
// be specified for the Recreate and Rolling strategies to customize the execution
|
||||
// process that runs the deployment.
|
||||
CustomParams *CustomDeploymentStrategyParams
|
||||
|
||||
// Resources contains resource requirements to execute the deployment
|
||||
Resources kapi.ResourceRequirements
|
||||
// Labels is a set of key, value pairs added to custom deployer and lifecycle pre/post hook pods.
|
||||
Labels map[string]string
|
||||
// Annotations is a set of key, value pairs added to custom deployer and lifecycle pre/post hook pods.
|
||||
Annotations map[string]string
|
||||
}
|
||||
|
||||
// DeploymentStrategyType refers to a specific DeploymentStrategy implementation.
|
||||
type DeploymentStrategyType string
|
||||
|
||||
const (
|
||||
// DeploymentStrategyTypeRecreate is a simple strategy suitable as a default.
|
||||
DeploymentStrategyTypeRecreate DeploymentStrategyType = "Recreate"
|
||||
// DeploymentStrategyTypeCustom is a user defined strategy. It is optional to set.
|
||||
DeploymentStrategyTypeCustom DeploymentStrategyType = "Custom"
|
||||
// DeploymentStrategyTypeRolling uses the Kubernetes RollingUpdater.
|
||||
DeploymentStrategyTypeRolling DeploymentStrategyType = "Rolling"
|
||||
)
|
||||
|
||||
// CustomDeploymentStrategyParams are the input to the Custom deployment strategy.
|
||||
type CustomDeploymentStrategyParams struct {
|
||||
// Image specifies a Docker image which can carry out a deployment.
|
||||
Image string
|
||||
// Environment holds the environment which will be given to the container for Image.
|
||||
Environment []kapi.EnvVar
|
||||
// Command is optional and overrides CMD in the container Image.
|
||||
Command []string
|
||||
}
|
||||
|
||||
// RecreateDeploymentStrategyParams are the input to the Recreate deployment
|
||||
// strategy.
|
||||
type RecreateDeploymentStrategyParams struct {
|
||||
// TimeoutSeconds is the time to wait for updates before giving up. If the
|
||||
// value is nil, a default will be used.
|
||||
TimeoutSeconds *int64
|
||||
// Pre is a lifecycle hook which is executed before the strategy manipulates
|
||||
// the deployment. All LifecycleHookFailurePolicy values are supported.
|
||||
Pre *LifecycleHook
|
||||
// Mid is a lifecycle hook which is executed while the deployment is scaled down to zero before the first new
|
||||
// pod is created. All LifecycleHookFailurePolicy values are supported.
|
||||
Mid *LifecycleHook
|
||||
// Post is a lifecycle hook which is executed after the strategy has
|
||||
// finished all deployment logic.
|
||||
Post *LifecycleHook
|
||||
}
|
||||
|
||||
// LifecycleHook defines a specific deployment lifecycle action. Only one type of action may be specified at any time.
|
||||
type LifecycleHook struct {
|
||||
// FailurePolicy specifies what action to take if the hook fails.
|
||||
FailurePolicy LifecycleHookFailurePolicy
|
||||
|
||||
// ExecNewPod specifies the options for a lifecycle hook backed by a pod.
|
||||
ExecNewPod *ExecNewPodHook
|
||||
|
||||
// TagImages instructs the deployer to tag the current image referenced under a container onto an image stream tag if the deployment succeeds.
|
||||
TagImages []TagImageHook
|
||||
}
|
||||
|
||||
// LifecycleHookFailurePolicy describes possibles actions to take if a hook fails.
|
||||
type LifecycleHookFailurePolicy string
|
||||
|
||||
const (
|
||||
// LifecycleHookFailurePolicyRetry means retry the hook until it succeeds.
|
||||
LifecycleHookFailurePolicyRetry LifecycleHookFailurePolicy = "Retry"
|
||||
// LifecycleHookFailurePolicyAbort means abort the deployment (if possible).
|
||||
LifecycleHookFailurePolicyAbort LifecycleHookFailurePolicy = "Abort"
|
||||
// LifecycleHookFailurePolicyIgnore means ignore failure and continue the deployment.
|
||||
LifecycleHookFailurePolicyIgnore LifecycleHookFailurePolicy = "Ignore"
|
||||
)
|
||||
|
||||
// ExecNewPodHook is a hook implementation which runs a command in a new pod
|
||||
// based on the specified container which is assumed to be part of the
|
||||
// deployment template.
|
||||
type ExecNewPodHook struct {
|
||||
// Command is the action command and its arguments.
|
||||
Command []string
|
||||
// Env is a set of environment variables to supply to the hook pod's container.
|
||||
Env []kapi.EnvVar
|
||||
// ContainerName is the name of a container in the deployment pod template
|
||||
// whose Docker image will be used for the hook pod's container.
|
||||
ContainerName string
|
||||
// Volumes is a list of named volumes from the pod template which should be
|
||||
// copied to the hook pod.
|
||||
Volumes []string
|
||||
}
|
||||
|
||||
// TagImageHook is a request to tag the image in a particular container onto an ImageStreamTag.
|
||||
type TagImageHook struct {
|
||||
// ContainerName is the name of a container in the deployment config whose image value will be used as the source of the tag
|
||||
ContainerName string
|
||||
// To is the target ImageStreamTag to set the image of
|
||||
To kapi.ObjectReference
|
||||
}
|
||||
|
||||
// RollingDeploymentStrategyParams are the input to the Rolling deployment
|
||||
// strategy.
|
||||
type RollingDeploymentStrategyParams struct {
|
||||
// UpdatePeriodSeconds is the time to wait between individual pod updates.
|
||||
// If the value is nil, a default will be used.
|
||||
UpdatePeriodSeconds *int64
|
||||
// IntervalSeconds is the time to wait between polling deployment status
|
||||
// after update. If the value is nil, a default will be used.
|
||||
IntervalSeconds *int64
|
||||
// TimeoutSeconds is the time to wait for updates before giving up. If the
|
||||
// value is nil, a default will be used.
|
||||
TimeoutSeconds *int64
|
||||
// The maximum number of pods that can be unavailable during the update.
|
||||
// Value can be an absolute number (ex: 5) or a percentage of total pods at the start of update (ex: 10%).
|
||||
// Absolute number is calculated from percentage by rounding up.
|
||||
// This can not be 0 if MaxSurge is 0.
|
||||
// By default, a fixed value of 1 is used.
|
||||
// Example: when this is set to 30%, the old RC can be scaled down by 30%
|
||||
// immediately when the rolling update starts. Once new pods are ready, old RC
|
||||
// can be scaled down further, followed by scaling up the new RC, ensuring
|
||||
// that at least 70% of original number of pods are available at all times
|
||||
// during the update.
|
||||
MaxUnavailable intstr.IntOrString
|
||||
// The maximum number of pods that can be scheduled above the original number of
|
||||
// pods.
|
||||
// Value can be an absolute number (ex: 5) or a percentage of total pods at
|
||||
// the start of the update (ex: 10%). This can not be 0 if MaxUnavailable is 0.
|
||||
// Absolute number is calculated from percentage by rounding up.
|
||||
// By default, a value of 1 is used.
|
||||
// Example: when this is set to 30%, the new RC can be scaled up by 30%
|
||||
// immediately when the rolling update starts. Once old pods have been killed,
|
||||
// new RC can be scaled up further, ensuring that total number of pods running
|
||||
// at any time during the update is atmost 130% of original pods.
|
||||
MaxSurge intstr.IntOrString
|
||||
// UpdatePercent is the percentage of replicas to scale up or down each
|
||||
// interval. If nil, one replica will be scaled up and down each interval.
|
||||
// If negative, the scale order will be down/up instead of up/down.
|
||||
// DEPRECATED: Use MaxUnavailable/MaxSurge instead.
|
||||
UpdatePercent *int32
|
||||
// Pre is a lifecycle hook which is executed before the deployment process
|
||||
// begins. All LifecycleHookFailurePolicy values are supported.
|
||||
Pre *LifecycleHook
|
||||
// Post is a lifecycle hook which is executed after the strategy has
|
||||
// finished all deployment logic.
|
||||
Post *LifecycleHook
|
||||
}
|
||||
|
||||
const (
|
||||
// DefaultRollingTimeoutSeconds is the default TimeoutSeconds for RollingDeploymentStrategyParams.
|
||||
DefaultRollingTimeoutSeconds int64 = 10 * 60
|
||||
// DefaultRollingIntervalSeconds is the default IntervalSeconds for RollingDeploymentStrategyParams.
|
||||
DefaultRollingIntervalSeconds int64 = 1
|
||||
// DefaultRollingUpdatePeriodSeconds is the default PeriodSeconds for RollingDeploymentStrategyParams.
|
||||
DefaultRollingUpdatePeriodSeconds int64 = 1
|
||||
)
|
||||
|
||||
// These constants represent keys used for correlating objects related to deployments.
|
||||
const (
|
||||
// DeploymentConfigAnnotation is an annotation name used to correlate a deployment with the
|
||||
// DeploymentConfig on which the deployment is based.
|
||||
DeploymentConfigAnnotation = "openshift.io/deployment-config.name"
|
||||
// DeploymentAnnotation is an annotation on a deployer Pod. The annotation value is the name
|
||||
// of the deployment (a ReplicationController) on which the deployer Pod acts.
|
||||
DeploymentAnnotation = "openshift.io/deployment.name"
|
||||
// DeploymentPodAnnotation is an annotation on a deployment (a ReplicationController). The
|
||||
// annotation value is the name of the deployer Pod which will act upon the ReplicationController
|
||||
// to implement the deployment behavior.
|
||||
DeploymentPodAnnotation = "openshift.io/deployer-pod.name"
|
||||
// DeploymentIgnorePodAnnotation is an annotation on a deployment config that will bypass creating
|
||||
// a deployment pod with the deployment. The caller is responsible for setting the deployment
|
||||
// status and running the deployment process.
|
||||
DeploymentIgnorePodAnnotation = "deploy.openshift.io/deployer-pod.ignore"
|
||||
// DeploymentPodTypeLabel is a label with which contains a type of deployment pod.
|
||||
DeploymentPodTypeLabel = "openshift.io/deployer-pod.type"
|
||||
// DeployerPodForDeploymentLabel is a label which groups pods related to a
|
||||
// deployment. The value is a deployment name. The deployer pod and hook pods
|
||||
// created by the internal strategies will have this label. Custom
|
||||
// strategies can apply this label to any pods they create, enabling
|
||||
// platform-provided cancellation and garbage collection support.
|
||||
DeployerPodForDeploymentLabel = "openshift.io/deployer-pod-for.name"
|
||||
// DeploymentStatusAnnotation is an annotation name used to retrieve the DeploymentPhase of
|
||||
// a deployment.
|
||||
DeploymentStatusAnnotation = "openshift.io/deployment.phase"
|
||||
// DeploymentEncodedConfigAnnotation is an annotation name used to retrieve specific encoded
|
||||
// DeploymentConfig on which a given deployment is based.
|
||||
DeploymentEncodedConfigAnnotation = "openshift.io/encoded-deployment-config"
|
||||
// DeploymentVersionAnnotation is an annotation on a deployment (a ReplicationController). The
|
||||
// annotation value is the LatestVersion value of the DeploymentConfig which was the basis for
|
||||
// the deployment.
|
||||
DeploymentVersionAnnotation = "openshift.io/deployment-config.latest-version"
|
||||
// DeploymentLabel is the name of a label used to correlate a deployment with the Pod created
|
||||
// to execute the deployment logic.
|
||||
// TODO: This is a workaround for upstream's lack of annotation support on PodTemplate. Once
|
||||
// annotations are available on PodTemplate, audit this constant with the goal of removing it.
|
||||
DeploymentLabel = "deployment"
|
||||
// DeploymentConfigLabel is the name of a label used to correlate a deployment with the
|
||||
// DeploymentConfigs on which the deployment is based.
|
||||
DeploymentConfigLabel = "deploymentconfig"
|
||||
// DesiredReplicasAnnotation represents the desired number of replicas for a
|
||||
// new deployment.
|
||||
// TODO: This should be made public upstream.
|
||||
DesiredReplicasAnnotation = "kubectl.kubernetes.io/desired-replicas"
|
||||
// DeploymentStatusReasonAnnotation represents the reason for deployment being in a given state
|
||||
// Used for specifying the reason for cancellation or failure of a deployment
|
||||
DeploymentStatusReasonAnnotation = "openshift.io/deployment.status-reason"
|
||||
// DeploymentCancelledAnnotation indicates that the deployment has been cancelled
|
||||
// The annotation value does not matter and its mere presence indicates cancellation
|
||||
DeploymentCancelledAnnotation = "openshift.io/deployment.cancelled"
|
||||
// DeploymentReplicasAnnotation is for internal use only and is for
|
||||
// detecting external modifications to deployment replica counts.
|
||||
DeploymentReplicasAnnotation = "openshift.io/deployment.replicas"
|
||||
// PostHookPodSuffix is the suffix added to all pre hook pods
|
||||
PreHookPodSuffix = "hook-pre"
|
||||
// PostHookPodSuffix is the suffix added to all mid hook pods
|
||||
MidHookPodSuffix = "hook-mid"
|
||||
// PostHookPodSuffix is the suffix added to all post hook pods
|
||||
PostHookPodSuffix = "hook-post"
|
||||
)
|
||||
|
||||
// These constants represent the various reasons for cancelling a deployment
|
||||
// or for a deployment being placed in a failed state
|
||||
const (
|
||||
DeploymentCancelledByUser = "cancelled by the user"
|
||||
DeploymentCancelledNewerDeploymentExists = "newer deployment was found running"
|
||||
DeploymentFailedUnrelatedDeploymentExists = "unrelated pod with the same name as this deployment is already running"
|
||||
DeploymentFailedDeployerPodNoLongerExists = "deployer pod no longer exists"
|
||||
)
|
||||
|
||||
// MaxDeploymentDurationSeconds represents the maximum duration that a deployment is allowed to run
|
||||
// This is set as the default value for ActiveDeadlineSeconds for the deployer pod
|
||||
// Currently set to 6 hours
|
||||
const MaxDeploymentDurationSeconds int64 = 21600
|
||||
|
||||
// DeploymentCancelledAnnotationValue represents the value for the DeploymentCancelledAnnotation
|
||||
// annotation that signifies that the deployment should be cancelled
|
||||
const DeploymentCancelledAnnotationValue = "true"
|
||||
|
||||
// DeploymentInstantiatedAnnotationValue represents the value for the DeploymentInstantiatedAnnotation
|
||||
// annotation that signifies that the deployment should be instantiated.
|
||||
const DeploymentInstantiatedAnnotationValue = "true"
|
||||
|
||||
// +genclient=true
|
||||
|
||||
// DeploymentConfig represents a configuration for a single deployment (represented as a
|
||||
// ReplicationController). It also contains details about changes which resulted in the current
|
||||
// state of the DeploymentConfig. Each change to the DeploymentConfig which should result in
|
||||
// a new deployment results in an increment of LatestVersion.
|
||||
type DeploymentConfig struct {
|
||||
unversioned.TypeMeta
|
||||
kapi.ObjectMeta
|
||||
|
||||
// Spec represents a desired deployment state and how to deploy to it.
|
||||
Spec DeploymentConfigSpec
|
||||
|
||||
// Status represents the current deployment state.
|
||||
Status DeploymentConfigStatus
|
||||
}
|
||||
|
||||
// DeploymentConfigSpec represents the desired state of the deployment.
|
||||
type DeploymentConfigSpec struct {
|
||||
// Strategy describes how a deployment is executed.
|
||||
Strategy DeploymentStrategy
|
||||
|
||||
// MinReadySeconds is the minimum number of seconds for which a newly created pod should
|
||||
// be ready without any of its container crashing, for it to be considered available.
|
||||
// Defaults to 0 (pod will be considered available as soon as it is ready)
|
||||
MinReadySeconds int32
|
||||
|
||||
// Triggers determine how updates to a DeploymentConfig result in new deployments. If no triggers
|
||||
// are defined, a new deployment can only occur as a result of an explicit client update to the
|
||||
// DeploymentConfig with a new LatestVersion.
|
||||
Triggers []DeploymentTriggerPolicy
|
||||
|
||||
// Replicas is the number of desired replicas.
|
||||
Replicas int32
|
||||
|
||||
// RevisionHistoryLimit is the number of old ReplicationControllers to retain to allow for rollbacks.
|
||||
// This field is a pointer to allow for differentiation between an explicit zero and not specified.
|
||||
RevisionHistoryLimit *int32
|
||||
|
||||
// Test ensures that this deployment config will have zero replicas except while a deployment is running. This allows the
|
||||
// deployment config to be used as a continuous deployment test - triggering on images, running the deployment, and then succeeding
|
||||
// or failing. Post strategy hooks and After actions can be used to integrate successful deployment with an action.
|
||||
Test bool
|
||||
|
||||
// Paused indicates that the deployment config is paused resulting in no new deployments on template
|
||||
// changes or changes in the template caused by other triggers.
|
||||
Paused bool
|
||||
|
||||
// Selector is a label query over pods that should match the Replicas count.
|
||||
Selector map[string]string
|
||||
|
||||
// Template is the object that describes the pod that will be created if
|
||||
// insufficient replicas are detected.
|
||||
Template *kapi.PodTemplateSpec
|
||||
}
|
||||
|
||||
// DeploymentConfigStatus represents the current deployment state.
|
||||
type DeploymentConfigStatus struct {
|
||||
// LatestVersion is used to determine whether the current deployment associated with a deployment
|
||||
// config is out of sync.
|
||||
LatestVersion int64
|
||||
// ObservedGeneration is the most recent generation observed by the deployment config controller.
|
||||
ObservedGeneration int64
|
||||
// Replicas is the total number of pods targeted by this deployment config.
|
||||
Replicas int32
|
||||
// UpdatedReplicas is the total number of non-terminated pods targeted by this deployment config
|
||||
// that have the desired template spec.
|
||||
UpdatedReplicas int32
|
||||
// AvailableReplicas is the total number of available pods targeted by this deployment config.
|
||||
AvailableReplicas int32
|
||||
// UnavailableReplicas is the total number of unavailable pods targeted by this deployment config.
|
||||
UnavailableReplicas int32
|
||||
// Details are the reasons for the update to this deployment config.
|
||||
// This could be based on a change made by the user or caused by an automatic trigger
|
||||
Details *DeploymentDetails
|
||||
}
|
||||
|
||||
// DeploymentTriggerPolicy describes a policy for a single trigger that results in a new deployment.
|
||||
type DeploymentTriggerPolicy struct {
|
||||
// Type of the trigger
|
||||
Type DeploymentTriggerType
|
||||
// ImageChangeParams represents the parameters for the ImageChange trigger.
|
||||
ImageChangeParams *DeploymentTriggerImageChangeParams
|
||||
}
|
||||
|
||||
// DeploymentTriggerType refers to a specific DeploymentTriggerPolicy implementation.
|
||||
type DeploymentTriggerType string
|
||||
|
||||
const (
|
||||
// DeploymentTriggerManual is a placeholder implementation which does nothing.
|
||||
DeploymentTriggerManual DeploymentTriggerType = "Manual"
|
||||
// DeploymentTriggerOnImageChange will create new deployments in response to updated tags from
|
||||
// a Docker image repository.
|
||||
DeploymentTriggerOnImageChange DeploymentTriggerType = "ImageChange"
|
||||
// DeploymentTriggerOnConfigChange will create new deployments in response to changes to
|
||||
// the ControllerTemplate of a DeploymentConfig.
|
||||
DeploymentTriggerOnConfigChange DeploymentTriggerType = "ConfigChange"
|
||||
)
|
||||
|
||||
// DeploymentTriggerImageChangeParams represents the parameters to the ImageChange trigger.
|
||||
type DeploymentTriggerImageChangeParams struct {
|
||||
// Automatic means that the detection of a new tag value should result in an image update
|
||||
// inside the pod template. Deployment configs that haven't been deployed yet will always
|
||||
// have their images updated. Deployment configs that have been deployed at least once, will
|
||||
// have their images updated only if this is set to true.
|
||||
Automatic bool
|
||||
// ContainerNames is used to restrict tag updates to the specified set of container names in a pod.
|
||||
ContainerNames []string
|
||||
// From is a reference to an image stream tag to watch for changes. From.Name is the only
|
||||
// required subfield - if From.Namespace is blank, the namespace of the current deployment
|
||||
// trigger will be used.
|
||||
From kapi.ObjectReference
|
||||
// LastTriggeredImage is the last image to be triggered.
|
||||
LastTriggeredImage string
|
||||
}
|
||||
|
||||
// DeploymentDetails captures information about the causes of a deployment.
|
||||
type DeploymentDetails struct {
|
||||
// Message is the user specified change message, if this deployment was triggered manually by the user
|
||||
Message string
|
||||
// Causes are extended data associated with all the causes for creating a new deployment
|
||||
Causes []DeploymentCause
|
||||
}
|
||||
|
||||
// DeploymentCause captures information about a particular cause of a deployment.
|
||||
type DeploymentCause struct {
|
||||
// Type is the type of the trigger that resulted in the creation of a new deployment
|
||||
Type DeploymentTriggerType
|
||||
// ImageTrigger contains the image trigger details, if this trigger was fired based on an image change
|
||||
ImageTrigger *DeploymentCauseImageTrigger
|
||||
}
|
||||
|
||||
// DeploymentCauseImageTrigger contains information about a deployment caused by an image trigger
|
||||
type DeploymentCauseImageTrigger struct {
|
||||
// From is a reference to the changed object which triggered a deployment. The field may have
|
||||
// the kinds DockerImage, ImageStreamTag, or ImageStreamImage.
|
||||
From kapi.ObjectReference
|
||||
}
|
||||
|
||||
// DeploymentConfigList is a collection of deployment configs.
|
||||
type DeploymentConfigList struct {
|
||||
unversioned.TypeMeta
|
||||
unversioned.ListMeta
|
||||
|
||||
// Items is a list of deployment configs
|
||||
Items []DeploymentConfig
|
||||
}
|
||||
|
||||
// DeploymentConfigRollback provides the input to rollback generation.
|
||||
type DeploymentConfigRollback struct {
|
||||
unversioned.TypeMeta
|
||||
// Name of the deployment config that will be rolled back.
|
||||
Name string
|
||||
// UpdatedAnnotations is a set of new annotations that will be added in the deployment config.
|
||||
UpdatedAnnotations map[string]string
|
||||
// Spec defines the options to rollback generation.
|
||||
Spec DeploymentConfigRollbackSpec
|
||||
}
|
||||
|
||||
// DeploymentConfigRollbackSpec represents the options for rollback generation.
|
||||
type DeploymentConfigRollbackSpec struct {
|
||||
// From points to a ReplicationController which is a deployment.
|
||||
From kapi.ObjectReference
|
||||
// Revision to rollback to. If set to 0, rollback to the last revision.
|
||||
Revision int64
|
||||
// IncludeTriggers specifies whether to include config Triggers.
|
||||
IncludeTriggers bool
|
||||
// IncludeTemplate specifies whether to include the PodTemplateSpec.
|
||||
IncludeTemplate bool
|
||||
// IncludeReplicationMeta specifies whether to include the replica count and selector.
|
||||
IncludeReplicationMeta bool
|
||||
// IncludeStrategy specifies whether to include the deployment Strategy.
|
||||
IncludeStrategy bool
|
||||
}
|
||||
|
||||
// DeploymentLog represents the logs for a deployment
|
||||
type DeploymentLog struct {
|
||||
unversioned.TypeMeta
|
||||
}
|
||||
|
||||
// DeploymentLogOptions is the REST options for a deployment log
|
||||
type DeploymentLogOptions struct {
|
||||
unversioned.TypeMeta
|
||||
|
||||
// Container for which to return logs
|
||||
Container string
|
||||
// Follow if true indicates that the deployment log should be streamed until
|
||||
// the deployment terminates.
|
||||
Follow bool
|
||||
// If true, return previous deployment logs
|
||||
Previous bool
|
||||
// A relative time in seconds before the current time from which to show logs. If this value
|
||||
// precedes the time a pod was started, only logs since the pod start will be returned.
|
||||
// If this value is in the future, no logs will be returned.
|
||||
// Only one of sinceSeconds or sinceTime may be specified.
|
||||
SinceSeconds *int64
|
||||
// An RFC3339 timestamp from which to show logs. If this value
|
||||
// precedes the time a pod was started, only logs since the pod start will be returned.
|
||||
// If this value is in the future, no logs will be returned.
|
||||
// Only one of sinceSeconds or sinceTime may be specified.
|
||||
SinceTime *unversioned.Time
|
||||
// If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line
|
||||
// of log output.
|
||||
Timestamps bool
|
||||
// If set, the number of lines from the end of the logs to show. If not specified,
|
||||
// logs are shown from the creation of the container or sinceSeconds or sinceTime
|
||||
TailLines *int64
|
||||
// If set, the number of bytes to read from the server before terminating the
|
||||
// log output. This may not display a complete final line of logging, and may return
|
||||
// slightly more or slightly less than the specified limit.
|
||||
LimitBytes *int64
|
||||
|
||||
// NoWait if true causes the call to return immediately even if the deployment
|
||||
// is not available yet. Otherwise the server will wait until the deployment has started.
|
||||
NoWait bool
|
||||
|
||||
// Version of the deployment for which to view logs.
|
||||
Version *int64
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/fsouza/go-dockerclient"
|
||||
|
||||
kapi "k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/conversion"
|
||||
)
|
||||
|
||||
func init() {
|
||||
err := kapi.Scheme.AddConversionFuncs(
|
||||
// Convert docker client object to internal object
|
||||
func(in *docker.Image, out *DockerImage, s conversion.Scope) error {
|
||||
if err := s.Convert(&in.Config, &out.Config, conversion.AllowDifferentFieldTypeNames); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.Convert(&in.ContainerConfig, &out.ContainerConfig, conversion.AllowDifferentFieldTypeNames); err != nil {
|
||||
return err
|
||||
}
|
||||
out.ID = in.ID
|
||||
out.Parent = in.Parent
|
||||
out.Comment = in.Comment
|
||||
out.Created = unversioned.NewTime(in.Created)
|
||||
out.Container = in.Container
|
||||
out.DockerVersion = in.DockerVersion
|
||||
out.Author = in.Author
|
||||
out.Architecture = in.Architecture
|
||||
out.Size = in.Size
|
||||
return nil
|
||||
},
|
||||
func(in *DockerImage, out *docker.Image, s conversion.Scope) error {
|
||||
if err := s.Convert(&in.Config, &out.Config, conversion.AllowDifferentFieldTypeNames); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.Convert(&in.ContainerConfig, &out.ContainerConfig, conversion.AllowDifferentFieldTypeNames); err != nil {
|
||||
return err
|
||||
}
|
||||
out.ID = in.ID
|
||||
out.Parent = in.Parent
|
||||
out.Comment = in.Comment
|
||||
out.Created = in.Created.Time
|
||||
out.Container = in.Container
|
||||
out.DockerVersion = in.DockerVersion
|
||||
out.Author = in.Author
|
||||
out.Architecture = in.Architecture
|
||||
out.Size = in.Size
|
||||
return nil
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
// If one of the conversion functions is malformed, detect it immediately.
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
+942
@@ -0,0 +1,942 @@
|
||||
// +build !ignore_autogenerated_openshift
|
||||
|
||||
// This file was autogenerated by deepcopy-gen. Do not edit it manually!
|
||||
|
||||
package api
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
|
||||
conversion "k8s.io/kubernetes/pkg/conversion"
|
||||
)
|
||||
|
||||
func init() {
|
||||
if err := api.Scheme.AddGeneratedDeepCopyFuncs(
|
||||
DeepCopy_api_Descriptor,
|
||||
DeepCopy_api_DockerConfig,
|
||||
DeepCopy_api_DockerConfigHistory,
|
||||
DeepCopy_api_DockerConfigRootFS,
|
||||
DeepCopy_api_DockerFSLayer,
|
||||
DeepCopy_api_DockerHistory,
|
||||
DeepCopy_api_DockerImage,
|
||||
DeepCopy_api_DockerImageConfig,
|
||||
DeepCopy_api_DockerImageManifest,
|
||||
DeepCopy_api_DockerImageReference,
|
||||
DeepCopy_api_DockerV1CompatibilityImage,
|
||||
DeepCopy_api_DockerV1CompatibilityImageSize,
|
||||
DeepCopy_api_Image,
|
||||
DeepCopy_api_ImageImportSpec,
|
||||
DeepCopy_api_ImageImportStatus,
|
||||
DeepCopy_api_ImageLayer,
|
||||
DeepCopy_api_ImageList,
|
||||
DeepCopy_api_ImageSignature,
|
||||
DeepCopy_api_ImageStream,
|
||||
DeepCopy_api_ImageStreamImage,
|
||||
DeepCopy_api_ImageStreamImport,
|
||||
DeepCopy_api_ImageStreamImportSpec,
|
||||
DeepCopy_api_ImageStreamImportStatus,
|
||||
DeepCopy_api_ImageStreamList,
|
||||
DeepCopy_api_ImageStreamMapping,
|
||||
DeepCopy_api_ImageStreamSpec,
|
||||
DeepCopy_api_ImageStreamStatus,
|
||||
DeepCopy_api_ImageStreamTag,
|
||||
DeepCopy_api_ImageStreamTagList,
|
||||
DeepCopy_api_RepositoryImportSpec,
|
||||
DeepCopy_api_RepositoryImportStatus,
|
||||
DeepCopy_api_SignatureCondition,
|
||||
DeepCopy_api_SignatureGenericEntity,
|
||||
DeepCopy_api_SignatureIssuer,
|
||||
DeepCopy_api_SignatureSubject,
|
||||
DeepCopy_api_TagEvent,
|
||||
DeepCopy_api_TagEventCondition,
|
||||
DeepCopy_api_TagEventList,
|
||||
DeepCopy_api_TagImportPolicy,
|
||||
DeepCopy_api_TagReference,
|
||||
); err != nil {
|
||||
// if one of the deep copy functions is malformed, detect it immediately.
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_api_Descriptor(in Descriptor, out *Descriptor, c *conversion.Cloner) error {
|
||||
out.MediaType = in.MediaType
|
||||
out.Size = in.Size
|
||||
out.Digest = in.Digest
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_DockerConfig(in DockerConfig, out *DockerConfig, c *conversion.Cloner) error {
|
||||
out.Hostname = in.Hostname
|
||||
out.Domainname = in.Domainname
|
||||
out.User = in.User
|
||||
out.Memory = in.Memory
|
||||
out.MemorySwap = in.MemorySwap
|
||||
out.CPUShares = in.CPUShares
|
||||
out.CPUSet = in.CPUSet
|
||||
out.AttachStdin = in.AttachStdin
|
||||
out.AttachStdout = in.AttachStdout
|
||||
out.AttachStderr = in.AttachStderr
|
||||
if in.PortSpecs != nil {
|
||||
in, out := in.PortSpecs, &out.PortSpecs
|
||||
*out = make([]string, len(in))
|
||||
copy(*out, in)
|
||||
} else {
|
||||
out.PortSpecs = nil
|
||||
}
|
||||
if in.ExposedPorts != nil {
|
||||
in, out := in.ExposedPorts, &out.ExposedPorts
|
||||
*out = make(map[string]struct{})
|
||||
for key, val := range in {
|
||||
if newVal, err := c.DeepCopy(val); err != nil {
|
||||
return err
|
||||
} else {
|
||||
(*out)[key] = newVal.(struct{})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.ExposedPorts = nil
|
||||
}
|
||||
out.Tty = in.Tty
|
||||
out.OpenStdin = in.OpenStdin
|
||||
out.StdinOnce = in.StdinOnce
|
||||
if in.Env != nil {
|
||||
in, out := in.Env, &out.Env
|
||||
*out = make([]string, len(in))
|
||||
copy(*out, in)
|
||||
} else {
|
||||
out.Env = nil
|
||||
}
|
||||
if in.Cmd != nil {
|
||||
in, out := in.Cmd, &out.Cmd
|
||||
*out = make([]string, len(in))
|
||||
copy(*out, in)
|
||||
} else {
|
||||
out.Cmd = nil
|
||||
}
|
||||
if in.DNS != nil {
|
||||
in, out := in.DNS, &out.DNS
|
||||
*out = make([]string, len(in))
|
||||
copy(*out, in)
|
||||
} else {
|
||||
out.DNS = nil
|
||||
}
|
||||
out.Image = in.Image
|
||||
if in.Volumes != nil {
|
||||
in, out := in.Volumes, &out.Volumes
|
||||
*out = make(map[string]struct{})
|
||||
for key, val := range in {
|
||||
if newVal, err := c.DeepCopy(val); err != nil {
|
||||
return err
|
||||
} else {
|
||||
(*out)[key] = newVal.(struct{})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Volumes = nil
|
||||
}
|
||||
out.VolumesFrom = in.VolumesFrom
|
||||
out.WorkingDir = in.WorkingDir
|
||||
if in.Entrypoint != nil {
|
||||
in, out := in.Entrypoint, &out.Entrypoint
|
||||
*out = make([]string, len(in))
|
||||
copy(*out, in)
|
||||
} else {
|
||||
out.Entrypoint = nil
|
||||
}
|
||||
out.NetworkDisabled = in.NetworkDisabled
|
||||
if in.SecurityOpts != nil {
|
||||
in, out := in.SecurityOpts, &out.SecurityOpts
|
||||
*out = make([]string, len(in))
|
||||
copy(*out, in)
|
||||
} else {
|
||||
out.SecurityOpts = nil
|
||||
}
|
||||
if in.OnBuild != nil {
|
||||
in, out := in.OnBuild, &out.OnBuild
|
||||
*out = make([]string, len(in))
|
||||
copy(*out, in)
|
||||
} else {
|
||||
out.OnBuild = nil
|
||||
}
|
||||
if in.Labels != nil {
|
||||
in, out := in.Labels, &out.Labels
|
||||
*out = make(map[string]string)
|
||||
for key, val := range in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
} else {
|
||||
out.Labels = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_DockerConfigHistory(in DockerConfigHistory, out *DockerConfigHistory, c *conversion.Cloner) error {
|
||||
if err := unversioned.DeepCopy_unversioned_Time(in.Created, &out.Created, c); err != nil {
|
||||
return err
|
||||
}
|
||||
out.Author = in.Author
|
||||
out.CreatedBy = in.CreatedBy
|
||||
out.Comment = in.Comment
|
||||
out.EmptyLayer = in.EmptyLayer
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_DockerConfigRootFS(in DockerConfigRootFS, out *DockerConfigRootFS, c *conversion.Cloner) error {
|
||||
out.Type = in.Type
|
||||
if in.DiffIDs != nil {
|
||||
in, out := in.DiffIDs, &out.DiffIDs
|
||||
*out = make([]string, len(in))
|
||||
copy(*out, in)
|
||||
} else {
|
||||
out.DiffIDs = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_DockerFSLayer(in DockerFSLayer, out *DockerFSLayer, c *conversion.Cloner) error {
|
||||
out.DockerBlobSum = in.DockerBlobSum
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_DockerHistory(in DockerHistory, out *DockerHistory, c *conversion.Cloner) error {
|
||||
out.DockerV1Compatibility = in.DockerV1Compatibility
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_DockerImage(in DockerImage, out *DockerImage, c *conversion.Cloner) error {
|
||||
if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
out.ID = in.ID
|
||||
out.Parent = in.Parent
|
||||
out.Comment = in.Comment
|
||||
if err := unversioned.DeepCopy_unversioned_Time(in.Created, &out.Created, c); err != nil {
|
||||
return err
|
||||
}
|
||||
out.Container = in.Container
|
||||
if err := DeepCopy_api_DockerConfig(in.ContainerConfig, &out.ContainerConfig, c); err != nil {
|
||||
return err
|
||||
}
|
||||
out.DockerVersion = in.DockerVersion
|
||||
out.Author = in.Author
|
||||
if in.Config != nil {
|
||||
in, out := in.Config, &out.Config
|
||||
*out = new(DockerConfig)
|
||||
if err := DeepCopy_api_DockerConfig(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Config = nil
|
||||
}
|
||||
out.Architecture = in.Architecture
|
||||
out.Size = in.Size
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_DockerImageConfig(in DockerImageConfig, out *DockerImageConfig, c *conversion.Cloner) error {
|
||||
out.ID = in.ID
|
||||
out.Parent = in.Parent
|
||||
out.Comment = in.Comment
|
||||
if err := unversioned.DeepCopy_unversioned_Time(in.Created, &out.Created, c); err != nil {
|
||||
return err
|
||||
}
|
||||
out.Container = in.Container
|
||||
if err := DeepCopy_api_DockerConfig(in.ContainerConfig, &out.ContainerConfig, c); err != nil {
|
||||
return err
|
||||
}
|
||||
out.DockerVersion = in.DockerVersion
|
||||
out.Author = in.Author
|
||||
if in.Config != nil {
|
||||
in, out := in.Config, &out.Config
|
||||
*out = new(DockerConfig)
|
||||
if err := DeepCopy_api_DockerConfig(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Config = nil
|
||||
}
|
||||
out.Architecture = in.Architecture
|
||||
out.Size = in.Size
|
||||
if in.RootFS != nil {
|
||||
in, out := in.RootFS, &out.RootFS
|
||||
*out = new(DockerConfigRootFS)
|
||||
if err := DeepCopy_api_DockerConfigRootFS(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.RootFS = nil
|
||||
}
|
||||
if in.History != nil {
|
||||
in, out := in.History, &out.History
|
||||
*out = make([]DockerConfigHistory, len(in))
|
||||
for i := range in {
|
||||
if err := DeepCopy_api_DockerConfigHistory(in[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.History = nil
|
||||
}
|
||||
out.OSVersion = in.OSVersion
|
||||
if in.OSFeatures != nil {
|
||||
in, out := in.OSFeatures, &out.OSFeatures
|
||||
*out = make([]string, len(in))
|
||||
copy(*out, in)
|
||||
} else {
|
||||
out.OSFeatures = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_DockerImageManifest(in DockerImageManifest, out *DockerImageManifest, c *conversion.Cloner) error {
|
||||
out.SchemaVersion = in.SchemaVersion
|
||||
out.MediaType = in.MediaType
|
||||
out.Name = in.Name
|
||||
out.Tag = in.Tag
|
||||
out.Architecture = in.Architecture
|
||||
if in.FSLayers != nil {
|
||||
in, out := in.FSLayers, &out.FSLayers
|
||||
*out = make([]DockerFSLayer, len(in))
|
||||
for i := range in {
|
||||
if err := DeepCopy_api_DockerFSLayer(in[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.FSLayers = nil
|
||||
}
|
||||
if in.History != nil {
|
||||
in, out := in.History, &out.History
|
||||
*out = make([]DockerHistory, len(in))
|
||||
for i := range in {
|
||||
if err := DeepCopy_api_DockerHistory(in[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.History = nil
|
||||
}
|
||||
if in.Layers != nil {
|
||||
in, out := in.Layers, &out.Layers
|
||||
*out = make([]Descriptor, len(in))
|
||||
for i := range in {
|
||||
if err := DeepCopy_api_Descriptor(in[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Layers = nil
|
||||
}
|
||||
if err := DeepCopy_api_Descriptor(in.Config, &out.Config, c); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_DockerImageReference(in DockerImageReference, out *DockerImageReference, c *conversion.Cloner) error {
|
||||
out.Registry = in.Registry
|
||||
out.Namespace = in.Namespace
|
||||
out.Name = in.Name
|
||||
out.Tag = in.Tag
|
||||
out.ID = in.ID
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_DockerV1CompatibilityImage(in DockerV1CompatibilityImage, out *DockerV1CompatibilityImage, c *conversion.Cloner) error {
|
||||
out.ID = in.ID
|
||||
out.Parent = in.Parent
|
||||
out.Comment = in.Comment
|
||||
if err := unversioned.DeepCopy_unversioned_Time(in.Created, &out.Created, c); err != nil {
|
||||
return err
|
||||
}
|
||||
out.Container = in.Container
|
||||
if err := DeepCopy_api_DockerConfig(in.ContainerConfig, &out.ContainerConfig, c); err != nil {
|
||||
return err
|
||||
}
|
||||
out.DockerVersion = in.DockerVersion
|
||||
out.Author = in.Author
|
||||
if in.Config != nil {
|
||||
in, out := in.Config, &out.Config
|
||||
*out = new(DockerConfig)
|
||||
if err := DeepCopy_api_DockerConfig(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Config = nil
|
||||
}
|
||||
out.Architecture = in.Architecture
|
||||
out.Size = in.Size
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_DockerV1CompatibilityImageSize(in DockerV1CompatibilityImageSize, out *DockerV1CompatibilityImageSize, c *conversion.Cloner) error {
|
||||
out.Size = in.Size
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_Image(in Image, out *Image, c *conversion.Cloner) error {
|
||||
if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
out.DockerImageReference = in.DockerImageReference
|
||||
if err := DeepCopy_api_DockerImage(in.DockerImageMetadata, &out.DockerImageMetadata, c); err != nil {
|
||||
return err
|
||||
}
|
||||
out.DockerImageMetadataVersion = in.DockerImageMetadataVersion
|
||||
out.DockerImageManifest = in.DockerImageManifest
|
||||
if in.DockerImageLayers != nil {
|
||||
in, out := in.DockerImageLayers, &out.DockerImageLayers
|
||||
*out = make([]ImageLayer, len(in))
|
||||
for i := range in {
|
||||
if err := DeepCopy_api_ImageLayer(in[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.DockerImageLayers = nil
|
||||
}
|
||||
if in.Signatures != nil {
|
||||
in, out := in.Signatures, &out.Signatures
|
||||
*out = make([]ImageSignature, len(in))
|
||||
for i := range in {
|
||||
if err := DeepCopy_api_ImageSignature(in[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Signatures = nil
|
||||
}
|
||||
if in.DockerImageSignatures != nil {
|
||||
in, out := in.DockerImageSignatures, &out.DockerImageSignatures
|
||||
*out = make([][]byte, len(in))
|
||||
for i := range in {
|
||||
if newVal, err := c.DeepCopy(in[i]); err != nil {
|
||||
return err
|
||||
} else {
|
||||
(*out)[i] = newVal.([]byte)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.DockerImageSignatures = nil
|
||||
}
|
||||
out.DockerImageManifestMediaType = in.DockerImageManifestMediaType
|
||||
out.DockerImageConfig = in.DockerImageConfig
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_ImageImportSpec(in ImageImportSpec, out *ImageImportSpec, c *conversion.Cloner) error {
|
||||
if err := api.DeepCopy_api_ObjectReference(in.From, &out.From, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if in.To != nil {
|
||||
in, out := in.To, &out.To
|
||||
*out = new(api.LocalObjectReference)
|
||||
if err := api.DeepCopy_api_LocalObjectReference(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.To = nil
|
||||
}
|
||||
if err := DeepCopy_api_TagImportPolicy(in.ImportPolicy, &out.ImportPolicy, c); err != nil {
|
||||
return err
|
||||
}
|
||||
out.IncludeManifest = in.IncludeManifest
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_ImageImportStatus(in ImageImportStatus, out *ImageImportStatus, c *conversion.Cloner) error {
|
||||
out.Tag = in.Tag
|
||||
if err := unversioned.DeepCopy_unversioned_Status(in.Status, &out.Status, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if in.Image != nil {
|
||||
in, out := in.Image, &out.Image
|
||||
*out = new(Image)
|
||||
if err := DeepCopy_api_Image(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Image = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_ImageLayer(in ImageLayer, out *ImageLayer, c *conversion.Cloner) error {
|
||||
out.Name = in.Name
|
||||
out.LayerSize = in.LayerSize
|
||||
out.MediaType = in.MediaType
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_ImageList(in ImageList, out *ImageList, c *conversion.Cloner) error {
|
||||
if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if in.Items != nil {
|
||||
in, out := in.Items, &out.Items
|
||||
*out = make([]Image, len(in))
|
||||
for i := range in {
|
||||
if err := DeepCopy_api_Image(in[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Items = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_ImageSignature(in ImageSignature, out *ImageSignature, c *conversion.Cloner) error {
|
||||
out.Type = in.Type
|
||||
if in.Content != nil {
|
||||
in, out := in.Content, &out.Content
|
||||
*out = make([]byte, len(in))
|
||||
copy(*out, in)
|
||||
} else {
|
||||
out.Content = nil
|
||||
}
|
||||
if in.Conditions != nil {
|
||||
in, out := in.Conditions, &out.Conditions
|
||||
*out = make([]SignatureCondition, len(in))
|
||||
for i := range in {
|
||||
if err := DeepCopy_api_SignatureCondition(in[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Conditions = nil
|
||||
}
|
||||
out.ImageIdentity = in.ImageIdentity
|
||||
if in.SignedClaims != nil {
|
||||
in, out := in.SignedClaims, &out.SignedClaims
|
||||
*out = make(map[string]string)
|
||||
for key, val := range in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
} else {
|
||||
out.SignedClaims = nil
|
||||
}
|
||||
if in.Created != nil {
|
||||
in, out := in.Created, &out.Created
|
||||
*out = new(unversioned.Time)
|
||||
if err := unversioned.DeepCopy_unversioned_Time(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Created = nil
|
||||
}
|
||||
if in.IssuedBy != nil {
|
||||
in, out := in.IssuedBy, &out.IssuedBy
|
||||
*out = new(SignatureIssuer)
|
||||
if err := DeepCopy_api_SignatureIssuer(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.IssuedBy = nil
|
||||
}
|
||||
if in.IssuedTo != nil {
|
||||
in, out := in.IssuedTo, &out.IssuedTo
|
||||
*out = new(SignatureSubject)
|
||||
if err := DeepCopy_api_SignatureSubject(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.IssuedTo = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_ImageStream(in ImageStream, out *ImageStream, c *conversion.Cloner) error {
|
||||
if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := DeepCopy_api_ImageStreamSpec(in.Spec, &out.Spec, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := DeepCopy_api_ImageStreamStatus(in.Status, &out.Status, c); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_ImageStreamImage(in ImageStreamImage, out *ImageStreamImage, c *conversion.Cloner) error {
|
||||
if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := DeepCopy_api_Image(in.Image, &out.Image, c); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_ImageStreamImport(in ImageStreamImport, out *ImageStreamImport, c *conversion.Cloner) error {
|
||||
if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := DeepCopy_api_ImageStreamImportSpec(in.Spec, &out.Spec, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := DeepCopy_api_ImageStreamImportStatus(in.Status, &out.Status, c); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_ImageStreamImportSpec(in ImageStreamImportSpec, out *ImageStreamImportSpec, c *conversion.Cloner) error {
|
||||
out.Import = in.Import
|
||||
if in.Repository != nil {
|
||||
in, out := in.Repository, &out.Repository
|
||||
*out = new(RepositoryImportSpec)
|
||||
if err := DeepCopy_api_RepositoryImportSpec(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Repository = nil
|
||||
}
|
||||
if in.Images != nil {
|
||||
in, out := in.Images, &out.Images
|
||||
*out = make([]ImageImportSpec, len(in))
|
||||
for i := range in {
|
||||
if err := DeepCopy_api_ImageImportSpec(in[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Images = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_ImageStreamImportStatus(in ImageStreamImportStatus, out *ImageStreamImportStatus, c *conversion.Cloner) error {
|
||||
if in.Import != nil {
|
||||
in, out := in.Import, &out.Import
|
||||
*out = new(ImageStream)
|
||||
if err := DeepCopy_api_ImageStream(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Import = nil
|
||||
}
|
||||
if in.Repository != nil {
|
||||
in, out := in.Repository, &out.Repository
|
||||
*out = new(RepositoryImportStatus)
|
||||
if err := DeepCopy_api_RepositoryImportStatus(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Repository = nil
|
||||
}
|
||||
if in.Images != nil {
|
||||
in, out := in.Images, &out.Images
|
||||
*out = make([]ImageImportStatus, len(in))
|
||||
for i := range in {
|
||||
if err := DeepCopy_api_ImageImportStatus(in[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Images = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_ImageStreamList(in ImageStreamList, out *ImageStreamList, c *conversion.Cloner) error {
|
||||
if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if in.Items != nil {
|
||||
in, out := in.Items, &out.Items
|
||||
*out = make([]ImageStream, len(in))
|
||||
for i := range in {
|
||||
if err := DeepCopy_api_ImageStream(in[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Items = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_ImageStreamMapping(in ImageStreamMapping, out *ImageStreamMapping, c *conversion.Cloner) error {
|
||||
if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
out.DockerImageRepository = in.DockerImageRepository
|
||||
if err := DeepCopy_api_Image(in.Image, &out.Image, c); err != nil {
|
||||
return err
|
||||
}
|
||||
out.Tag = in.Tag
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_ImageStreamSpec(in ImageStreamSpec, out *ImageStreamSpec, c *conversion.Cloner) error {
|
||||
out.DockerImageRepository = in.DockerImageRepository
|
||||
if in.Tags != nil {
|
||||
in, out := in.Tags, &out.Tags
|
||||
*out = make(map[string]TagReference)
|
||||
for key, val := range in {
|
||||
newVal := new(TagReference)
|
||||
if err := DeepCopy_api_TagReference(val, newVal, c); err != nil {
|
||||
return err
|
||||
}
|
||||
(*out)[key] = *newVal
|
||||
}
|
||||
} else {
|
||||
out.Tags = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_ImageStreamStatus(in ImageStreamStatus, out *ImageStreamStatus, c *conversion.Cloner) error {
|
||||
out.DockerImageRepository = in.DockerImageRepository
|
||||
if in.Tags != nil {
|
||||
in, out := in.Tags, &out.Tags
|
||||
*out = make(map[string]TagEventList)
|
||||
for key, val := range in {
|
||||
newVal := new(TagEventList)
|
||||
if err := DeepCopy_api_TagEventList(val, newVal, c); err != nil {
|
||||
return err
|
||||
}
|
||||
(*out)[key] = *newVal
|
||||
}
|
||||
} else {
|
||||
out.Tags = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_ImageStreamTag(in ImageStreamTag, out *ImageStreamTag, c *conversion.Cloner) error {
|
||||
if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if in.Tag != nil {
|
||||
in, out := in.Tag, &out.Tag
|
||||
*out = new(TagReference)
|
||||
if err := DeepCopy_api_TagReference(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.Tag = nil
|
||||
}
|
||||
out.Generation = in.Generation
|
||||
if in.Conditions != nil {
|
||||
in, out := in.Conditions, &out.Conditions
|
||||
*out = make([]TagEventCondition, len(in))
|
||||
for i := range in {
|
||||
if err := DeepCopy_api_TagEventCondition(in[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Conditions = nil
|
||||
}
|
||||
if err := DeepCopy_api_Image(in.Image, &out.Image, c); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_ImageStreamTagList(in ImageStreamTagList, out *ImageStreamTagList, c *conversion.Cloner) error {
|
||||
if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if in.Items != nil {
|
||||
in, out := in.Items, &out.Items
|
||||
*out = make([]ImageStreamTag, len(in))
|
||||
for i := range in {
|
||||
if err := DeepCopy_api_ImageStreamTag(in[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Items = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_RepositoryImportSpec(in RepositoryImportSpec, out *RepositoryImportSpec, c *conversion.Cloner) error {
|
||||
if err := api.DeepCopy_api_ObjectReference(in.From, &out.From, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := DeepCopy_api_TagImportPolicy(in.ImportPolicy, &out.ImportPolicy, c); err != nil {
|
||||
return err
|
||||
}
|
||||
out.IncludeManifest = in.IncludeManifest
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_RepositoryImportStatus(in RepositoryImportStatus, out *RepositoryImportStatus, c *conversion.Cloner) error {
|
||||
if err := unversioned.DeepCopy_unversioned_Status(in.Status, &out.Status, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if in.Images != nil {
|
||||
in, out := in.Images, &out.Images
|
||||
*out = make([]ImageImportStatus, len(in))
|
||||
for i := range in {
|
||||
if err := DeepCopy_api_ImageImportStatus(in[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Images = nil
|
||||
}
|
||||
if in.AdditionalTags != nil {
|
||||
in, out := in.AdditionalTags, &out.AdditionalTags
|
||||
*out = make([]string, len(in))
|
||||
copy(*out, in)
|
||||
} else {
|
||||
out.AdditionalTags = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_SignatureCondition(in SignatureCondition, out *SignatureCondition, c *conversion.Cloner) error {
|
||||
out.Type = in.Type
|
||||
out.Status = in.Status
|
||||
if err := unversioned.DeepCopy_unversioned_Time(in.LastProbeTime, &out.LastProbeTime, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := unversioned.DeepCopy_unversioned_Time(in.LastTransitionTime, &out.LastTransitionTime, c); err != nil {
|
||||
return err
|
||||
}
|
||||
out.Reason = in.Reason
|
||||
out.Message = in.Message
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_SignatureGenericEntity(in SignatureGenericEntity, out *SignatureGenericEntity, c *conversion.Cloner) error {
|
||||
out.Organization = in.Organization
|
||||
out.CommonName = in.CommonName
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_SignatureIssuer(in SignatureIssuer, out *SignatureIssuer, c *conversion.Cloner) error {
|
||||
if err := DeepCopy_api_SignatureGenericEntity(in.SignatureGenericEntity, &out.SignatureGenericEntity, c); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_SignatureSubject(in SignatureSubject, out *SignatureSubject, c *conversion.Cloner) error {
|
||||
if err := DeepCopy_api_SignatureGenericEntity(in.SignatureGenericEntity, &out.SignatureGenericEntity, c); err != nil {
|
||||
return err
|
||||
}
|
||||
out.PublicKeyID = in.PublicKeyID
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_TagEvent(in TagEvent, out *TagEvent, c *conversion.Cloner) error {
|
||||
if err := unversioned.DeepCopy_unversioned_Time(in.Created, &out.Created, c); err != nil {
|
||||
return err
|
||||
}
|
||||
out.DockerImageReference = in.DockerImageReference
|
||||
out.Image = in.Image
|
||||
out.Generation = in.Generation
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_TagEventCondition(in TagEventCondition, out *TagEventCondition, c *conversion.Cloner) error {
|
||||
out.Type = in.Type
|
||||
out.Status = in.Status
|
||||
if err := unversioned.DeepCopy_unversioned_Time(in.LastTransitionTime, &out.LastTransitionTime, c); err != nil {
|
||||
return err
|
||||
}
|
||||
out.Reason = in.Reason
|
||||
out.Message = in.Message
|
||||
out.Generation = in.Generation
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_TagEventList(in TagEventList, out *TagEventList, c *conversion.Cloner) error {
|
||||
if in.Items != nil {
|
||||
in, out := in.Items, &out.Items
|
||||
*out = make([]TagEvent, len(in))
|
||||
for i := range in {
|
||||
if err := DeepCopy_api_TagEvent(in[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Items = nil
|
||||
}
|
||||
if in.Conditions != nil {
|
||||
in, out := in.Conditions, &out.Conditions
|
||||
*out = make([]TagEventCondition, len(in))
|
||||
for i := range in {
|
||||
if err := DeepCopy_api_TagEventCondition(in[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Conditions = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_TagImportPolicy(in TagImportPolicy, out *TagImportPolicy, c *conversion.Cloner) error {
|
||||
out.Insecure = in.Insecure
|
||||
out.Scheduled = in.Scheduled
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_TagReference(in TagReference, out *TagReference, c *conversion.Cloner) error {
|
||||
out.Name = in.Name
|
||||
if in.Annotations != nil {
|
||||
in, out := in.Annotations, &out.Annotations
|
||||
*out = make(map[string]string)
|
||||
for key, val := range in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
} else {
|
||||
out.Annotations = nil
|
||||
}
|
||||
if in.From != nil {
|
||||
in, out := in.From, &out.From
|
||||
*out = new(api.ObjectReference)
|
||||
if err := api.DeepCopy_api_ObjectReference(*in, *out, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.From = nil
|
||||
}
|
||||
out.Reference = in.Reference
|
||||
if in.Generation != nil {
|
||||
in, out := in.Generation, &out.Generation
|
||||
*out = new(int64)
|
||||
**out = *in
|
||||
} else {
|
||||
out.Generation = nil
|
||||
}
|
||||
if err := DeepCopy_api_TagImportPolicy(in.ImportPolicy, &out.ImportPolicy, c); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
+157
@@ -0,0 +1,157 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
)
|
||||
|
||||
// DockerImage is the type representing a docker image and its various properties when
|
||||
// retrieved from the Docker client API.
|
||||
type DockerImage struct {
|
||||
unversioned.TypeMeta `json:",inline"`
|
||||
|
||||
ID string `json:"Id"`
|
||||
Parent string `json:"Parent,omitempty"`
|
||||
Comment string `json:"Comment,omitempty"`
|
||||
Created unversioned.Time `json:"Created,omitempty"`
|
||||
Container string `json:"Container,omitempty"`
|
||||
ContainerConfig DockerConfig `json:"ContainerConfig,omitempty"`
|
||||
DockerVersion string `json:"DockerVersion,omitempty"`
|
||||
Author string `json:"Author,omitempty"`
|
||||
Config *DockerConfig `json:"Config,omitempty"`
|
||||
Architecture string `json:"Architecture,omitempty"`
|
||||
Size int64 `json:"Size,omitempty"`
|
||||
}
|
||||
|
||||
// DockerConfig is the list of configuration options used when creating a container.
|
||||
type DockerConfig struct {
|
||||
Hostname string `json:"Hostname,omitempty"`
|
||||
Domainname string `json:"Domainname,omitempty"`
|
||||
User string `json:"User,omitempty"`
|
||||
Memory int64 `json:"Memory,omitempty"`
|
||||
MemorySwap int64 `json:"MemorySwap,omitempty"`
|
||||
CPUShares int64 `json:"CpuShares,omitempty"`
|
||||
CPUSet string `json:"Cpuset,omitempty"`
|
||||
AttachStdin bool `json:"AttachStdin,omitempty"`
|
||||
AttachStdout bool `json:"AttachStdout,omitempty"`
|
||||
AttachStderr bool `json:"AttachStderr,omitempty"`
|
||||
PortSpecs []string `json:"PortSpecs,omitempty"`
|
||||
ExposedPorts map[string]struct{} `json:"ExposedPorts,omitempty"`
|
||||
Tty bool `json:"Tty,omitempty"`
|
||||
OpenStdin bool `json:"OpenStdin,omitempty"`
|
||||
StdinOnce bool `json:"StdinOnce,omitempty"`
|
||||
Env []string `json:"Env,omitempty"`
|
||||
Cmd []string `json:"Cmd,omitempty"`
|
||||
DNS []string `json:"Dns,omitempty"` // For Docker API v1.9 and below only
|
||||
Image string `json:"Image,omitempty"`
|
||||
Volumes map[string]struct{} `json:"Volumes,omitempty"`
|
||||
VolumesFrom string `json:"VolumesFrom,omitempty"`
|
||||
WorkingDir string `json:"WorkingDir,omitempty"`
|
||||
Entrypoint []string `json:"Entrypoint,omitempty"`
|
||||
NetworkDisabled bool `json:"NetworkDisabled,omitempty"`
|
||||
SecurityOpts []string `json:"SecurityOpts,omitempty"`
|
||||
OnBuild []string `json:"OnBuild,omitempty"`
|
||||
Labels map[string]string `json:"Labels,omitempty"`
|
||||
}
|
||||
|
||||
// Descriptor describes targeted content. Used in conjunction with a blob
|
||||
// store, a descriptor can be used to fetch, store and target any kind of
|
||||
// blob. The struct also describes the wire protocol format. Fields should
|
||||
// only be added but never changed.
|
||||
type Descriptor struct {
|
||||
// MediaType describe the type of the content. All text based formats are
|
||||
// encoded as utf-8.
|
||||
MediaType string `json:"mediaType,omitempty"`
|
||||
|
||||
// Size in bytes of content.
|
||||
Size int64 `json:"size,omitempty"`
|
||||
|
||||
// Digest uniquely identifies the content. A byte stream can be verified
|
||||
// against against this digest.
|
||||
Digest string `json:"digest,omitempty"`
|
||||
}
|
||||
|
||||
// DockerImageManifest represents the Docker v2 image format.
|
||||
type DockerImageManifest struct {
|
||||
SchemaVersion int `json:"schemaVersion"`
|
||||
MediaType string `json:"mediaType,omitempty"`
|
||||
|
||||
// schema1
|
||||
Name string `json:"name"`
|
||||
Tag string `json:"tag"`
|
||||
Architecture string `json:"architecture"`
|
||||
FSLayers []DockerFSLayer `json:"fsLayers"`
|
||||
History []DockerHistory `json:"history"`
|
||||
|
||||
// schema2
|
||||
Layers []Descriptor `json:"layers"`
|
||||
Config Descriptor `json:"config"`
|
||||
}
|
||||
|
||||
// DockerFSLayer is a container struct for BlobSums defined in an image manifest
|
||||
type DockerFSLayer struct {
|
||||
// DockerBlobSum is the tarsum of the referenced filesystem image layer
|
||||
// TODO make this digest.Digest once docker/distribution is in Godeps
|
||||
DockerBlobSum string `json:"blobSum"`
|
||||
}
|
||||
|
||||
// DockerHistory stores unstructured v1 compatibility information
|
||||
type DockerHistory struct {
|
||||
// DockerV1Compatibility is the raw v1 compatibility information
|
||||
DockerV1Compatibility string `json:"v1Compatibility"`
|
||||
}
|
||||
|
||||
// DockerV1CompatibilityImage represents the structured v1
|
||||
// compatibility information.
|
||||
type DockerV1CompatibilityImage struct {
|
||||
ID string `json:"id"`
|
||||
Parent string `json:"parent,omitempty"`
|
||||
Comment string `json:"comment,omitempty"`
|
||||
Created unversioned.Time `json:"created"`
|
||||
Container string `json:"container,omitempty"`
|
||||
ContainerConfig DockerConfig `json:"container_config,omitempty"`
|
||||
DockerVersion string `json:"docker_version,omitempty"`
|
||||
Author string `json:"author,omitempty"`
|
||||
Config *DockerConfig `json:"config,omitempty"`
|
||||
Architecture string `json:"architecture,omitempty"`
|
||||
Size int64 `json:"size,omitempty"`
|
||||
}
|
||||
|
||||
// DockerV1CompatibilityImageSize represents the structured v1
|
||||
// compatibility information for size
|
||||
type DockerV1CompatibilityImageSize struct {
|
||||
Size int64 `json:"size,omitempty"`
|
||||
}
|
||||
|
||||
// DockerImageConfig stores the image configuration
|
||||
type DockerImageConfig struct {
|
||||
ID string `json:"id"`
|
||||
Parent string `json:"parent,omitempty"`
|
||||
Comment string `json:"comment,omitempty"`
|
||||
Created unversioned.Time `json:"created"`
|
||||
Container string `json:"container,omitempty"`
|
||||
ContainerConfig DockerConfig `json:"container_config,omitempty"`
|
||||
DockerVersion string `json:"docker_version,omitempty"`
|
||||
Author string `json:"author,omitempty"`
|
||||
Config *DockerConfig `json:"config,omitempty"`
|
||||
Architecture string `json:"architecture,omitempty"`
|
||||
Size int64 `json:"size,omitempty"`
|
||||
RootFS *DockerConfigRootFS `json:"rootfs,omitempty"`
|
||||
History []DockerConfigHistory `json:"history,omitempty"`
|
||||
OSVersion string `json:"os.version,omitempty"`
|
||||
OSFeatures []string `json:"os.features,omitempty"`
|
||||
}
|
||||
|
||||
// DockerConfigHistory stores build commands that were used to create an image
|
||||
type DockerConfigHistory struct {
|
||||
Created unversioned.Time `json:"created"`
|
||||
Author string `json:"author,omitempty"`
|
||||
CreatedBy string `json:"created_by,omitempty"`
|
||||
Comment string `json:"comment,omitempty"`
|
||||
EmptyLayer bool `json:"empty_layer,omitempty"`
|
||||
}
|
||||
|
||||
// DockerConfigRootFS describes images root filesystem
|
||||
type DockerConfigRootFS struct {
|
||||
Type string `json:"type"`
|
||||
DiffIDs []string `json:"diff_ids,omitempty"`
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package api
|
||||
|
||||
import "k8s.io/kubernetes/pkg/fields"
|
||||
|
||||
// ImageToSelectableFields returns a label set that represents the object.
|
||||
func ImageToSelectableFields(image *Image) fields.Set {
|
||||
return fields.Set{
|
||||
"metadata.name": image.Name,
|
||||
"metadata.namespace": image.Namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// ImageStreamToSelectableFields returns a label set that represents the object.
|
||||
func ImageStreamToSelectableFields(ir *ImageStream) fields.Set {
|
||||
return fields.Set{
|
||||
"metadata.name": ir.Name,
|
||||
"metadata.namespace": ir.Namespace,
|
||||
"spec.dockerImageRepository": ir.Spec.DockerImageRepository,
|
||||
"status.dockerImageRepository": ir.Status.DockerImageRepository,
|
||||
}
|
||||
}
|
||||
+1005
File diff suppressed because it is too large
Load Diff
+53
@@ -0,0 +1,53 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
)
|
||||
|
||||
const GroupName = ""
|
||||
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal}
|
||||
|
||||
// Kind takes an unqualified kind and returns back a Group qualified GroupKind
|
||||
func Kind(kind string) unversioned.GroupKind {
|
||||
return SchemeGroupVersion.WithKind(kind).GroupKind()
|
||||
}
|
||||
|
||||
// Resource takes an unqualified resource and returns back a Group qualified GroupResource
|
||||
func Resource(resource string) unversioned.GroupResource {
|
||||
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||||
}
|
||||
|
||||
func AddToScheme(scheme *runtime.Scheme) {
|
||||
// Add the API to Scheme.
|
||||
addKnownTypes(scheme)
|
||||
}
|
||||
|
||||
// Adds the list of known types to api.Scheme.
|
||||
func addKnownTypes(scheme *runtime.Scheme) {
|
||||
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||
&Image{},
|
||||
&ImageList{},
|
||||
&DockerImage{},
|
||||
&ImageStream{},
|
||||
&ImageStreamList{},
|
||||
&ImageStreamMapping{},
|
||||
&ImageStreamTag{},
|
||||
&ImageStreamTagList{},
|
||||
&ImageStreamImage{},
|
||||
&ImageStreamImport{},
|
||||
)
|
||||
}
|
||||
|
||||
func (obj *Image) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
||||
func (obj *ImageList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
||||
func (obj *DockerImage) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
||||
func (obj *ImageStream) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
||||
func (obj *ImageStreamList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
||||
func (obj *ImageStreamMapping) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
||||
func (obj *ImageStreamTag) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
||||
func (obj *ImageStreamTagList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
||||
func (obj *ImageStreamImage) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
||||
func (obj *ImageStreamImport) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"sort"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
)
|
||||
|
||||
type tag struct {
|
||||
Name string
|
||||
Created unversioned.Time
|
||||
}
|
||||
|
||||
type byCreationTimestamp []tag
|
||||
|
||||
func (t byCreationTimestamp) Len() int {
|
||||
return len(t)
|
||||
}
|
||||
|
||||
func (t byCreationTimestamp) Less(i, j int) bool {
|
||||
return t[i].Created.Time.After(t[j].Created.Time)
|
||||
}
|
||||
|
||||
func (t byCreationTimestamp) Swap(i, j int) {
|
||||
t[i], t[j] = t[j], t[i]
|
||||
}
|
||||
|
||||
// SortStatusTags sorts the status tags of an image stream based on
|
||||
// the latest created
|
||||
func SortStatusTags(tags map[string]TagEventList) []string {
|
||||
tagSlice := make([]tag, len(tags))
|
||||
index := 0
|
||||
for tag, list := range tags {
|
||||
tagSlice[index].Name = tag
|
||||
if len(list.Items) > 0 {
|
||||
tagSlice[index].Created = list.Items[0].Created
|
||||
}
|
||||
index++
|
||||
}
|
||||
|
||||
sort.Sort(byCreationTimestamp(tagSlice))
|
||||
|
||||
actual := make([]string, len(tagSlice))
|
||||
for i, tag := range tagSlice {
|
||||
actual[i] = tag.Name
|
||||
}
|
||||
|
||||
return actual
|
||||
}
|
||||
+434
@@ -0,0 +1,434 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
kapi "k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
)
|
||||
|
||||
// ImageList is a list of Image objects.
|
||||
type ImageList struct {
|
||||
unversioned.TypeMeta
|
||||
unversioned.ListMeta
|
||||
|
||||
Items []Image
|
||||
}
|
||||
|
||||
const (
|
||||
// ManagedByOpenShiftAnnotation indicates that an image is managed by OpenShift's registry.
|
||||
ManagedByOpenShiftAnnotation = "openshift.io/image.managed"
|
||||
|
||||
// DockerImageRepositoryCheckAnnotation indicates that OpenShift has
|
||||
// attempted to import tag and image information from an external Docker
|
||||
// image repository.
|
||||
DockerImageRepositoryCheckAnnotation = "openshift.io/image.dockerRepositoryCheck"
|
||||
|
||||
// InsecureRepositoryAnnotation may be set true on an image stream to allow insecure access to pull content.
|
||||
InsecureRepositoryAnnotation = "openshift.io/image.insecureRepository"
|
||||
|
||||
// ExcludeImageSecretAnnotation indicates that a secret should not be returned by imagestream/secrets.
|
||||
ExcludeImageSecretAnnotation = "openshift.io/image.excludeSecret"
|
||||
|
||||
// DefaultImageTag is used when an image tag is needed and the configuration does not specify a tag to use.
|
||||
DefaultImageTag = "latest"
|
||||
|
||||
// ResourceImageStreams represents a number of image streams in a project.
|
||||
ResourceImageStreams kapi.ResourceName = "openshift.io/imagestreams"
|
||||
|
||||
// ResourceImageStreamImages represents a number of unique references to images in all image stream
|
||||
// statuses of a project.
|
||||
ResourceImageStreamImages kapi.ResourceName = "openshift.io/images"
|
||||
|
||||
// ResourceImageStreamTags represents a number of unique references to images in all image stream specs
|
||||
// of a project.
|
||||
ResourceImageStreamTags kapi.ResourceName = "openshift.io/image-tags"
|
||||
|
||||
// Limit that applies to images. Used with a max["storage"] LimitRangeItem to set
|
||||
// the maximum size of an image.
|
||||
LimitTypeImage kapi.LimitType = "openshift.io/Image"
|
||||
|
||||
// Limit that applies to image streams. Used with a max[resource] LimitRangeItem to set the maximum number
|
||||
// of resource. Where the resource is one of "openshift.io/images" and "openshift.io/image-tags".
|
||||
LimitTypeImageStream kapi.LimitType = "openshift.io/ImageStream"
|
||||
)
|
||||
|
||||
// +genclient=true
|
||||
|
||||
// Image is an immutable representation of a Docker image and metadata at a point in time.
|
||||
type Image struct {
|
||||
unversioned.TypeMeta
|
||||
kapi.ObjectMeta
|
||||
|
||||
// The string that can be used to pull this image.
|
||||
DockerImageReference string
|
||||
// Metadata about this image
|
||||
DockerImageMetadata DockerImage
|
||||
// This attribute conveys the version of docker metadata the JSON should be stored in, which if empty defaults to "1.0"
|
||||
DockerImageMetadataVersion string
|
||||
// The raw JSON of the manifest
|
||||
DockerImageManifest string
|
||||
// DockerImageLayers represents the layers in the image. May not be set if the image does not define that data.
|
||||
DockerImageLayers []ImageLayer
|
||||
// Signatures holds all signatures of the image.
|
||||
Signatures []ImageSignature
|
||||
// DockerImageSignatures provides the signatures as opaque blobs. This is a part of manifest schema v1.
|
||||
DockerImageSignatures [][]byte
|
||||
// DockerImageManifestMediaType specifies the mediaType of manifest. This is a part of manifest schema v2.
|
||||
DockerImageManifestMediaType string
|
||||
// DockerImageConfig is a JSON blob that the runtime uses to set up the container. This is a part of manifest schema v2.
|
||||
DockerImageConfig string
|
||||
}
|
||||
|
||||
// ImageLayer represents a single layer of the image. Some images may have multiple layers. Some may have none.
|
||||
type ImageLayer struct {
|
||||
// Name of the layer as defined by the underlying store.
|
||||
Name string
|
||||
// LayerSize of the layer as defined by the underlying store.
|
||||
LayerSize int64
|
||||
// MediaType of the referenced object.
|
||||
MediaType string
|
||||
}
|
||||
|
||||
const (
|
||||
// The supported type of image signature.
|
||||
ImageSignatureTypeAtomicImageV1 string = "AtomicImageV1"
|
||||
)
|
||||
|
||||
// ImageSignature holds a signature of an image. It allows to verify image identity and possibly other claims
|
||||
// as long as the signature is trusted. Based on this information it is possible to restrict runnable images
|
||||
// to those matching cluster-wide policy.
|
||||
// There are two mandatory fields provided by client: Type and Content. They should be parsed by clients doing
|
||||
// image verification. The others are parsed from signature's content by the server. They serve just an
|
||||
// informative purpose.
|
||||
type ImageSignature struct {
|
||||
// Required: Describes a type of stored blob.
|
||||
Type string
|
||||
// Required: An opaque binary string which is an image's signature.
|
||||
Content []byte
|
||||
// Conditions represent the latest available observations of a signature's current state.
|
||||
Conditions []SignatureCondition
|
||||
|
||||
// Following metadata fields will be set by server if the signature content is successfully parsed and
|
||||
// the information available.
|
||||
|
||||
// A human readable string representing image's identity. It could be a product name and version, or an
|
||||
// image pull spec (e.g. "registry.access.redhat.com/rhel7/rhel:7.2").
|
||||
ImageIdentity string
|
||||
// Contains claims from the signature.
|
||||
SignedClaims map[string]string
|
||||
// If specified, it is the time of signature's creation.
|
||||
Created *unversioned.Time
|
||||
// If specified, it holds information about an issuer of signing certificate or key (a person or entity
|
||||
// who signed the signing certificate or key).
|
||||
IssuedBy *SignatureIssuer
|
||||
// If specified, it holds information about a subject of signing certificate or key (a person or entity
|
||||
// who signed the image).
|
||||
IssuedTo *SignatureSubject
|
||||
}
|
||||
|
||||
// These are valid conditions of an image signature.
|
||||
const (
|
||||
// SignatureTrusted means the signing key or certificate was valid and the signature matched the image at
|
||||
// the probe time.
|
||||
SignatureTrusted = "Trusted"
|
||||
// SignatureForImage means the signature matches image object containing it.
|
||||
SignatureForImage = "ForImage"
|
||||
// SignatureExpired means the signature or its signing key or certificate had been expired at the probe
|
||||
// time.
|
||||
SignatureExpired = "Expired"
|
||||
// SignatureRevoked means the signature or its signing key or certificate has been revoked.
|
||||
SignatureRevoked = "Revoked"
|
||||
)
|
||||
|
||||
/// SignatureConditionType is a type of image signature condition.
|
||||
type SignatureConditionType string
|
||||
|
||||
// SignatureCondition describes an image signature condition of particular kind at particular probe time.
|
||||
type SignatureCondition struct {
|
||||
// Type of job condition, Complete or Failed.
|
||||
Type SignatureConditionType
|
||||
// Status of the condition, one of True, False, Unknown.
|
||||
Status kapi.ConditionStatus
|
||||
// Last time the condition was checked.
|
||||
LastProbeTime unversioned.Time
|
||||
// Last time the condition transit from one status to another.
|
||||
LastTransitionTime unversioned.Time
|
||||
// (brief) reason for the condition's last transition.
|
||||
Reason string
|
||||
// Human readable message indicating details about last transition.
|
||||
Message string
|
||||
}
|
||||
|
||||
// SignatureGenericEntity holds a generic information about a person or entity who is an issuer or a subject
|
||||
// of signing certificate or key.
|
||||
type SignatureGenericEntity struct {
|
||||
// Organization name.
|
||||
Organization string
|
||||
// Common name (e.g. openshift-signing-service).
|
||||
CommonName string
|
||||
}
|
||||
|
||||
// SignatureIssuer holds information about an issuer of signing certificate or key.
|
||||
type SignatureIssuer struct {
|
||||
SignatureGenericEntity
|
||||
}
|
||||
|
||||
// SignatureSubject holds information about a person or entity who created the signature.
|
||||
type SignatureSubject struct {
|
||||
SignatureGenericEntity
|
||||
// If present, it is a human readable key id of public key belonging to the subject used to verify image
|
||||
// signature. It should contain at least 64 lowest bits of public key's fingerprint (e.g.
|
||||
// 0x685ebe62bf278440).
|
||||
PublicKeyID string
|
||||
}
|
||||
|
||||
// ImageStreamList is a list of ImageStream objects.
|
||||
type ImageStreamList struct {
|
||||
unversioned.TypeMeta
|
||||
unversioned.ListMeta
|
||||
|
||||
Items []ImageStream
|
||||
}
|
||||
|
||||
// ImageStream stores a mapping of tags to images, metadata overrides that are applied
|
||||
// when images are tagged in a stream, and an optional reference to a Docker image
|
||||
// repository on a registry.
|
||||
type ImageStream struct {
|
||||
unversioned.TypeMeta
|
||||
kapi.ObjectMeta
|
||||
|
||||
// Spec describes the desired state of this stream
|
||||
Spec ImageStreamSpec
|
||||
// Status describes the current state of this stream
|
||||
Status ImageStreamStatus
|
||||
}
|
||||
|
||||
// ImageStreamSpec represents options for ImageStreams.
|
||||
type ImageStreamSpec struct {
|
||||
// Optional, if specified this stream is backed by a Docker repository on this server
|
||||
DockerImageRepository string
|
||||
// Tags map arbitrary string values to specific image locators
|
||||
Tags map[string]TagReference
|
||||
}
|
||||
|
||||
// TagReference specifies optional annotations for images using this tag and an optional reference to
|
||||
// an ImageStreamTag, ImageStreamImage, or DockerImage this tag should track.
|
||||
type TagReference struct {
|
||||
// Name of the tag
|
||||
Name string
|
||||
// Optional; if specified, annotations that are applied to images retrieved via ImageStreamTags.
|
||||
Annotations map[string]string
|
||||
// Optional; if specified, a reference to another image that this tag should point to. Valid values
|
||||
// are ImageStreamTag, ImageStreamImage, and DockerImage.
|
||||
From *kapi.ObjectReference
|
||||
// Reference states if the tag will be imported. Default value is false, which means the tag will
|
||||
// be imported.
|
||||
Reference bool
|
||||
// Generation is a counter that tracks mutations to the spec tag (user intent). When a tag reference
|
||||
// is changed the generation is set to match the current stream generation (which is incremented every
|
||||
// time spec is changed). Other processes in the system like the image importer observe that the
|
||||
// generation of spec tag is newer than the generation recorded in the status and use that as a trigger
|
||||
// to import the newest remote tag. To trigger a new import, clients may set this value to zero which
|
||||
// will reset the generation to the latest stream generation. Legacy clients will send this value as
|
||||
// nil which will be merged with the current tag generation.
|
||||
Generation *int64
|
||||
// ImportPolicy is information that controls how images may be imported by the server.
|
||||
ImportPolicy TagImportPolicy
|
||||
}
|
||||
|
||||
type TagImportPolicy struct {
|
||||
// Insecure is true if the server may bypass certificate verification or connect directly over HTTP during image import.
|
||||
Insecure bool
|
||||
// Scheduled indicates to the server that this tag should be periodically checked to ensure it is up to date, and imported
|
||||
Scheduled bool
|
||||
}
|
||||
|
||||
// ImageStreamStatus contains information about the state of this image stream.
|
||||
type ImageStreamStatus struct {
|
||||
// DockerImageRepository represents the effective location this stream may be accessed at. May be empty until the server
|
||||
// determines where the repository is located
|
||||
DockerImageRepository string
|
||||
// A historical record of images associated with each tag. The first entry in the TagEvent array is
|
||||
// the currently tagged image.
|
||||
Tags map[string]TagEventList
|
||||
}
|
||||
|
||||
// TagEventList contains a historical record of images associated with a tag.
|
||||
type TagEventList struct {
|
||||
Items []TagEvent
|
||||
// Conditions is an array of conditions that apply to the tag event list.
|
||||
Conditions []TagEventCondition
|
||||
}
|
||||
|
||||
// TagEvent is used by ImageRepositoryStatus to keep a historical record of images associated with a tag.
|
||||
type TagEvent struct {
|
||||
// When the TagEvent was created
|
||||
Created unversioned.Time
|
||||
// The string that can be used to pull this image
|
||||
DockerImageReference string
|
||||
// The image
|
||||
Image string
|
||||
// Generation is the spec tag generation that resulted in this tag being updated
|
||||
Generation int64
|
||||
}
|
||||
|
||||
type TagEventConditionType string
|
||||
|
||||
// These are valid conditions of TagEvents.
|
||||
const (
|
||||
// ImportSuccess with status False means the import of the specific tag failed
|
||||
ImportSuccess TagEventConditionType = "ImportSuccess"
|
||||
)
|
||||
|
||||
// TagEventCondition contains condition information for a tag event.
|
||||
type TagEventCondition struct {
|
||||
// Type of tag event condition, currently only ImportSuccess
|
||||
Type TagEventConditionType
|
||||
// Status of the condition, one of True, False, Unknown.
|
||||
Status kapi.ConditionStatus
|
||||
// LastTransitionTIme is the time the condition transitioned from one status to another.
|
||||
LastTransitionTime unversioned.Time
|
||||
// Reason is a brief machine readable explanation for the condition's last transition.
|
||||
Reason string
|
||||
// Message is a human readable description of the details about last transition, complementing reason.
|
||||
Message string
|
||||
// Generation is the spec tag generation that this status corresponds to. If this value is
|
||||
// older than the spec tag generation, the user has requested this status tag be updated.
|
||||
// This value is set to zero for older versions of streams, which means that no generation
|
||||
// was recorded.
|
||||
Generation int64
|
||||
}
|
||||
|
||||
// ImageStreamMapping represents a mapping from a single tag to a Docker image as
|
||||
// well as the reference to the Docker image repository the image came from.
|
||||
type ImageStreamMapping struct {
|
||||
unversioned.TypeMeta
|
||||
kapi.ObjectMeta
|
||||
|
||||
// The Docker image repository the specified image is located in
|
||||
// DEPRECATED: remove once v1beta1 support is dropped
|
||||
DockerImageRepository string
|
||||
// A Docker image.
|
||||
Image Image
|
||||
// A string value this image can be located with inside the repository.
|
||||
Tag string
|
||||
}
|
||||
|
||||
// ImageStreamTag has a .Name in the format <stream name>:<tag>.
|
||||
type ImageStreamTag struct {
|
||||
unversioned.TypeMeta
|
||||
kapi.ObjectMeta
|
||||
|
||||
// Tag is the spec tag associated with this image stream tag, and it may be null
|
||||
// if only pushes have occurred to this image stream.
|
||||
Tag *TagReference
|
||||
|
||||
// Generation is the current generation of the tagged image - if tag is provided
|
||||
// and this value is not equal to the tag generation, a user has requested an
|
||||
// import that has not completed, or Conditions will be filled out indicating any
|
||||
// error.
|
||||
Generation int64
|
||||
|
||||
// Conditions is an array of conditions that apply to the image stream tag.
|
||||
Conditions []TagEventCondition
|
||||
|
||||
// The Image associated with the ImageStream and tag.
|
||||
Image Image
|
||||
}
|
||||
|
||||
// ImageStreamTagList is a list of ImageStreamTag objects.
|
||||
type ImageStreamTagList struct {
|
||||
unversioned.TypeMeta
|
||||
unversioned.ListMeta
|
||||
|
||||
Items []ImageStreamTag
|
||||
}
|
||||
|
||||
// ImageStreamImage represents an Image that is retrieved by image name from an ImageStream.
|
||||
type ImageStreamImage struct {
|
||||
unversioned.TypeMeta
|
||||
kapi.ObjectMeta
|
||||
|
||||
// The Image associated with the ImageStream and image name.
|
||||
Image Image
|
||||
}
|
||||
|
||||
// DockerImageReference points to a Docker image.
|
||||
type DockerImageReference struct {
|
||||
Registry string
|
||||
Namespace string
|
||||
Name string
|
||||
Tag string
|
||||
ID string
|
||||
}
|
||||
|
||||
// ImageStreamImport allows a caller to request information about a set of images for possible
|
||||
// import into an image stream, or actually tag the images into the image stream.
|
||||
type ImageStreamImport struct {
|
||||
unversioned.TypeMeta
|
||||
// ObjectMeta must identify the name of the image stream to create or update. If resourceVersion
|
||||
// or UID are set, they must match the image stream that will be loaded from the server.
|
||||
kapi.ObjectMeta
|
||||
|
||||
// Spec is the set of items desired to be imported
|
||||
Spec ImageStreamImportSpec
|
||||
// Status is the result of the import
|
||||
Status ImageStreamImportStatus
|
||||
}
|
||||
|
||||
// ImageStreamImportSpec defines what images should be imported.
|
||||
type ImageStreamImportSpec struct {
|
||||
// Import indicates whether to perform an import - if so, the specified tags are set on the spec
|
||||
// and status of the image stream defined by the type meta.
|
||||
Import bool
|
||||
// Repository is an optional import of an entire Docker image repository. A maximum limit on the
|
||||
// number of tags imported this way is imposed by the server.
|
||||
Repository *RepositoryImportSpec
|
||||
// Images are a list of individual images to import.
|
||||
Images []ImageImportSpec
|
||||
}
|
||||
|
||||
// ImageStreamImportStatus contains information about the status of an image stream import.
|
||||
type ImageStreamImportStatus struct {
|
||||
// Import is the image stream that was successfully updated or created when 'to' was set.
|
||||
Import *ImageStream
|
||||
// Repository is set if spec.repository was set to the outcome of the import
|
||||
Repository *RepositoryImportStatus
|
||||
// Images is set with the result of importing spec.images
|
||||
Images []ImageImportStatus
|
||||
}
|
||||
|
||||
// RepositoryImport indicates to load a set of tags from a given Docker image repository
|
||||
type RepositoryImportSpec struct {
|
||||
// The source of the import, only kind DockerImage is supported
|
||||
From kapi.ObjectReference
|
||||
|
||||
ImportPolicy TagImportPolicy
|
||||
IncludeManifest bool
|
||||
}
|
||||
|
||||
// RepositoryImportStatus describes the outcome of the repository import
|
||||
type RepositoryImportStatus struct {
|
||||
// Status reflects whether any failure occurred during import
|
||||
Status unversioned.Status
|
||||
// Images is the list of imported images
|
||||
Images []ImageImportStatus
|
||||
// AdditionalTags are tags that exist in the repository but were not imported because
|
||||
// a maximum limit of automatic imports was applied.
|
||||
AdditionalTags []string
|
||||
}
|
||||
|
||||
// ImageImportSpec defines how an image is imported.
|
||||
type ImageImportSpec struct {
|
||||
From kapi.ObjectReference
|
||||
To *kapi.LocalObjectReference
|
||||
|
||||
ImportPolicy TagImportPolicy
|
||||
IncludeManifest bool
|
||||
}
|
||||
|
||||
// ImageImportStatus describes the result of an image import.
|
||||
type ImageImportStatus struct {
|
||||
Tag string
|
||||
Status unversioned.Status
|
||||
Image *Image
|
||||
}
|
||||
Reference in New Issue
Block a user