@@ -17,6 +17,7 @@ limitations under the License.
1717package options
1818
1919import (
20+ "context"
2021 "fmt"
2122 "net"
2223 "strings"
@@ -45,27 +46,27 @@ type CompletedOptions struct {
4546
4647// Complete set default ServerRunOptions.
4748// Should be called after kube-apiserver flags parsed.
48- func (opts * ServerRunOptions ) Complete () (CompletedOptions , error ) {
49- if opts == nil {
49+ func (s * ServerRunOptions ) Complete (ctx context. Context ) (CompletedOptions , error ) {
50+ if s == nil {
5051 return CompletedOptions {completedOptions : & completedOptions {}}, nil
5152 }
5253
53- // process opts .ServiceClusterIPRange from list to Primary and Secondary
54+ // process s .ServiceClusterIPRange from list to Primary and Secondary
5455 // we process secondary only if provided by user
55- apiServerServiceIP , primaryServiceIPRange , secondaryServiceIPRange , err := getServiceIPAndRanges (opts .ServiceClusterIPRanges )
56+ apiServerServiceIP , primaryServiceIPRange , secondaryServiceIPRange , err := getServiceIPAndRanges (s .ServiceClusterIPRanges )
5657 if err != nil {
5758 return CompletedOptions {}, err
5859 }
59- controlplane , err := opts .Options .Complete ([]string {"kubernetes.default.svc" , "kubernetes.default" , "kubernetes" }, []net.IP {apiServerServiceIP })
60+ controlplane , err := s .Options .Complete (ctx , []string {"kubernetes.default.svc" , "kubernetes.default" , "kubernetes" }, []net.IP {apiServerServiceIP })
6061 if err != nil {
6162 return CompletedOptions {}, err
6263 }
6364
6465 completed := completedOptions {
6566 CompletedOptions : controlplane ,
66- CloudProvider : opts .CloudProvider ,
67+ CloudProvider : s .CloudProvider ,
6768
68- Extra : opts .Extra ,
69+ Extra : s .Extra ,
6970 }
7071
7172 completed .PrimaryServiceClusterIPRange = primaryServiceIPRange
0 commit comments