Skip to content

Commit

Permalink
Remove the obsolete namespacenattingtable API
Browse files Browse the repository at this point in the history
  • Loading branch information
giorio94 committed Jul 29, 2021
1 parent 9c56586 commit e9e0055
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 258 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Expand Up @@ -96,7 +96,7 @@ linters:
# - testpackage
- typecheck
- unconvert
# - unparam
- unparam
- unused
- varcheck
- whitespace
Expand Down
49 changes: 0 additions & 49 deletions apis/virtualKubelet/v1alpha1/namespaceNattingTableClient.go

This file was deleted.

65 changes: 0 additions & 65 deletions apis/virtualKubelet/v1alpha1/namespacenattingtable_types.go

This file was deleted.

105 changes: 1 addition & 104 deletions apis/virtualKubelet/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion cmd/virtual-kubelet/register.go
Expand Up @@ -17,7 +17,6 @@ func registerKubernetes(ctx context.Context, s *provider.Store) error {
cfg.InternalIP,
cfg.DaemonPort,
cfg.HomeKubeConfig,
cfg.RemoteKubeConfig,
cfg.InformerResyncPeriod,
cfg.LiqoIpamServer,
)
Expand Down
1 change: 0 additions & 1 deletion cmd/virtual-kubelet/root/flag.go
Expand Up @@ -26,7 +26,6 @@ func InstallFlags(flags *pflag.FlagSet, c *Opts) {
flags.StringVar(&c.KubeClusterDomain, "cluster-domain", c.KubeClusterDomain, "kubernetes cluster-domain (default is 'cluster.local')")
flags.StringVar(&c.NodeName, "nodename", c.NodeName, "kubernetes node name")
flags.StringVar(&c.Provider, "provider", c.Provider, "cloud provider")
flags.StringVar(&c.ForeignKubeconfig, "foreign-kubeconfig", c.ForeignKubeconfig, "cloud provider kubeconfig")
flags.StringVar(&c.MetricsAddr, "metrics-addr", c.MetricsAddr, "address to listen for metrics/stats requests")

flags.IntVar(&c.PodSyncWorkers, "pod-sync-workers", c.PodSyncWorkers, `set the number of pod synchronization workers`)
Expand Down
3 changes: 1 addition & 2 deletions cmd/virtual-kubelet/root/opts.go
Expand Up @@ -56,8 +56,7 @@ type Opts struct {

Provider string

HomeKubeconfig string
ForeignKubeconfig string
HomeKubeconfig string

MetricsAddr string

Expand Down
5 changes: 0 additions & 5 deletions cmd/virtual-kubelet/root/root.go
Expand Up @@ -68,10 +68,6 @@ func runRootCommand(ctx context.Context, s *provider.Store, c *Opts) error {
ctx, cancel := context.WithCancel(ctx)
defer cancel()

if c.ForeignKubeconfig == "" {
return errors.New("provider kubeconfig is mandatory")
}

if c.ForeignClusterID == "" {
return errors.New("cluster id is mandatory")
}
Expand Down Expand Up @@ -128,7 +124,6 @@ func runRootCommand(ctx context.Context, s *provider.Store, c *Opts) error {
KubeClusterDomain: c.KubeClusterDomain,
RemoteClusterID: c.ForeignClusterID,
HomeClusterID: c.HomeClusterID,
RemoteKubeConfig: c.ForeignKubeconfig,
InformerResyncPeriod: c.InformerResyncPeriod,
LiqoIpamServer: c.LiqoIpamServer,
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/virtualKubelet/provider/pods.go
Expand Up @@ -64,7 +64,7 @@ func (p *LiqoProvider) CreatePod(ctx context.Context, homePod *corev1.Pod) error
`{"metadata":{"labels":{"%s":"%s"},"finalizers":["%s"]}}`,
liqoconst.LocalPodLabelKey, liqoconst.LocalPodLabelValue, virtualKubelet.HomePodFinalizer))

_, err = p.nntClient.Client().CoreV1().Pods(homePod.Namespace).Patch(context.TODO(),
_, err = p.homeClient.CoreV1().Pods(homePod.Namespace).Patch(context.TODO(),
homePod.Name,
types.StrategicMergePatchType,
homePodPatch,
Expand Down Expand Up @@ -249,7 +249,7 @@ func (p *LiqoProvider) RunInContainer(ctx context.Context, homeNamespace, homePo
TTY: true,
}, scheme.ParameterCodec)

exec, err := remotecommandclient.NewSPDYExecutor(p.restConfig, "POST", req.URL())
exec, err := remotecommandclient.NewSPDYExecutor(p.foreignRestConfig, "POST", req.URL())
if err != nil {
return fmt.Errorf("could not make remote command: %v", err)
}
Expand Down

0 comments on commit e9e0055

Please sign in to comment.