88 "crypto/x509"
99 "crypto/x509/pkix"
1010 "fmt"
11- "time"
1211
1312 apinetv1alpha1 "github.com/ironcore-dev/ironcore-net/api/core/v1alpha1"
1413 networkingv1alpha1 "github.com/ironcore-dev/ironcore/api/networking/v1alpha1"
@@ -21,7 +20,6 @@ import (
2120 "k8s.io/apimachinery/pkg/runtime"
2221 utilruntime "k8s.io/apimachinery/pkg/util/runtime"
2322 clientgoscheme "k8s.io/client-go/kubernetes/scheme"
24- "sigs.k8s.io/controller-runtime/pkg/client"
2523)
2624
2725var scheme = runtime .NewScheme ()
@@ -32,9 +30,7 @@ func init() {
3230}
3331
3432type apinetOptions struct {
35- APInetNodeName string
36- PollingDuration time.Duration
37- PollingInterval time.Duration
33+ APInetNodeName string
3834
3935 GetConfigOptions config.GetConfigOptions
4036}
@@ -45,8 +41,6 @@ func (o *apinetOptions) PluginName() string {
4541
4642func (o * apinetOptions ) AddFlags (fs * pflag.FlagSet ) {
4743 fs .StringVar (& o .APInetNodeName , "apinet-node-name" , "" , "APInet node name" )
48- fs .DurationVar (& o .PollingDuration , "apinet-polling-duration" , 30 * time .Second , "Duration to poll for apinet network interface readiness" )
49- fs .DurationVar (& o .PollingInterval , "apinet-polling-interval" , 1 * time .Second , "Interval between apinet network interface readiness polls" )
5044 o .GetConfigOptions .BindFlags (fs , config .WithNamePrefix ("apinet-" ))
5145}
5246
@@ -80,12 +74,7 @@ func (o *apinetOptions) NetworkInterfacePlugin(ctx context.Context) (
8074 return nil , nil , nil , fmt .Errorf ("error getting apinet config: %w" , err )
8175 }
8276
83- apinetClient , err := client .New (cfg , client.Options {Scheme : scheme })
84- if err != nil {
85- return nil , nil , nil , fmt .Errorf ("error creating apinet client: %w" , err )
86- }
87-
88- return apinet .NewPlugin (o .APInetNodeName , apinetClient , o .PollingDuration , o .PollingInterval ), configCtrl , nil , nil
77+ return apinet .NewPlugin (o .APInetNodeName , cfg ), configCtrl , nil , nil
8978}
9079
9180func init () {
0 commit comments