diff --git a/pkg/templates/weave/weave-net.go b/pkg/templates/weave/weave-net.go index cf94e2d0b..2a0dd49f9 100644 --- a/pkg/templates/weave/weave-net.go +++ b/pkg/templates/weave/weave-net.go @@ -82,14 +82,13 @@ func Deploy(s *state.State) error { err = s.DynamicClient.Get(ctx, key, secCopy) switch { case k8serrors.IsNotFound(err): + err = s.DynamicClient.Create(ctx, sec) + if err != nil { + return errors.Wrap(err, "failed to create weave-net Secret") + } case err != nil: return errors.Wrap(err, "failed to get weave-net Secret") } - - err = s.DynamicClient.Create(ctx, sec) - if err != nil { - return errors.Wrap(err, "failed to create weave-net Secret") - } } var peers []string