Labels and annotation support for functions and environments (#2113)
1. Support for adding labels and annotations to functions & environment via fission CLI through create & update command. 2. Change ensures labels and annotations assigned to the environment would reflect on pods created via executor type pool manager and new deploy. Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
@@ -36,7 +36,7 @@ func Commands() *cobra.Command {
|
||||
flag.FnExecutorType, flag.FnCfgMap, flag.FnSecret,
|
||||
flag.FnSpecializationTimeout, flag.FnExecutionTimeout,
|
||||
flag.FnIdleTimeout, flag.FnConcurrency, flag.FnRequestsPerPod,
|
||||
flag.FnOnceOnly,
|
||||
flag.FnOnceOnly, flag.Labels, flag.Annotation,
|
||||
|
||||
// TODO retired pkg & trigger related flags from function cmd
|
||||
flag.PkgCode, flag.PkgSrcArchive, flag.PkgDeployArchive,
|
||||
@@ -88,7 +88,7 @@ func Commands() *cobra.Command {
|
||||
flag.FnExecutorType, flag.FnSecret, flag.FnCfgMap,
|
||||
flag.FnSpecializationTimeout, flag.FnExecutionTimeout,
|
||||
flag.FnIdleTimeout, flag.FnConcurrency, flag.FnRequestsPerPod,
|
||||
flag.FnOnceOnly,
|
||||
flag.FnOnceOnly, flag.Labels, flag.Annotation,
|
||||
|
||||
flag.PkgCode, flag.PkgSrcArchive, flag.PkgDeployArchive,
|
||||
flag.PkgSrcChecksum, flag.PkgDeployChecksum, flag.PkgInsecure,
|
||||
|
||||
@@ -309,6 +309,11 @@ func (opts *CreateSubCommand) complete(input cli.Input) error {
|
||||
},
|
||||
}
|
||||
|
||||
err = util.ApplyLabelsAndAnnotations(input, &opts.function.ObjectMeta)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -243,6 +243,11 @@ func (opts *UpdateSubCommand) complete(input cli.Input) error {
|
||||
|
||||
opts.function = function
|
||||
|
||||
err = util.ApplyLabelsAndAnnotations(input, &opts.function.ObjectMeta)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user