From a68cf85aba149f32461e18a32ad9291f003b8172 Mon Sep 17 00:00:00 2001 From: chrislovecnm Date: Wed, 14 Feb 2018 16:10:19 -0700 Subject: [PATCH] modifying generator to create SetLifecycle --- upup/tools/generators/fitask/generator.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/upup/tools/generators/fitask/generator.go b/upup/tools/generators/fitask/generator.go index cf6e57d51a..7eb65296ff 100644 --- a/upup/tools/generators/fitask/generator.go +++ b/upup/tools/generators/fitask/generator.go @@ -30,7 +30,7 @@ type FitaskGenerator struct { var _ codegen.Generator = &FitaskGenerator{} const fileHeaderDef = `/* -Copyright 2016 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -86,6 +86,11 @@ func (o *{{.Name}}) GetLifecycle() *fi.Lifecycle { return o.Lifecycle } +// SetLifecycle sets the Lifecycle of the object, implementing fi.SetLifecycle +func (o *{{.Name}}) SetLifecycle(lifecycle fi.Lifecycle) { + o.Lifecycle = &lifecycle +} + var _ fi.HasName = &{{.Name}}{} // GetName returns the Name of the object, implementing fi.HasName