mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-08-20 22:26:07 +00:00
Merge branch 'main' into 5048-CSI-snapshot-timeout-configurable
This commit is contained in:
@@ -17,9 +17,11 @@ limitations under the License.
|
||||
package builder
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"strings"
|
||||
|
||||
corev1api "k8s.io/api/core/v1"
|
||||
apimachineryRuntime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// ContainerBuilder builds Container objects
|
||||
@@ -89,6 +91,17 @@ func (b *ContainerBuilder) Result() *corev1api.Container {
|
||||
return b.object
|
||||
}
|
||||
|
||||
// ResultRawExtension returns the Container as runtime.RawExtension.
|
||||
func (b *ContainerBuilder) ResultRawExtension() apimachineryRuntime.RawExtension {
|
||||
result, err := json.Marshal(b.object)
|
||||
if err != nil {
|
||||
return apimachineryRuntime.RawExtension{}
|
||||
}
|
||||
return apimachineryRuntime.RawExtension{
|
||||
Raw: result,
|
||||
}
|
||||
}
|
||||
|
||||
// Args sets the container's Args.
|
||||
func (b *ContainerBuilder) Args(args ...string) *ContainerBuilder {
|
||||
b.object.Args = append(b.object.Args, args...)
|
||||
|
||||
Reference in New Issue
Block a user