var deploymentLong … var deploymentExample … type CreateDeploymentOptions … // NewCreateDeploymentOptions returns an initialized CreateDeploymentOptions instance func NewCreateDeploymentOptions(ioStreams genericiooptions.IOStreams) *CreateDeploymentOptions { … } // NewCmdCreateDeployment is a macro command to create a new deployment. // This command is better known to users as `kubectl create deployment`. func NewCmdCreateDeployment(f cmdutil.Factory, ioStreams genericiooptions.IOStreams) *cobra.Command { … } // Complete completes all the options func (o *CreateDeploymentOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string) error { … } // Validate makes sure there is no discrepency in provided option values func (o *CreateDeploymentOptions) Validate() error { … } // Run performs the execution of 'create deployment' sub command func (o *CreateDeploymentOptions) Run() error { … } func (o *CreateDeploymentOptions) createDeployment() *appsv1.Deployment { … } // buildPodSpec parses the image strings and assemble them into the Containers // of a PodSpec. This is all you need to create the PodSpec for a deployment. func (o *CreateDeploymentOptions) buildPodSpec() corev1.PodSpec { … } // sanitizeAndUniquify replaces characters like "." or "_" into "-" to follow DNS1123 rules. // Then add random suffix to make it uniquified. func sanitizeAndUniquify(name string) string { … }