This repository has been archived by the owner on Dec 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
delete guest cluster nodes from Kubernetes API #484
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
fb19da7
updates vendor deps
xh3b4sd ed72cb5
wip
xh3b4sd 31dc39b
updates vendor deps
xh3b4sd c642cb3
wip
xh3b4sd c32eb73
Merge branch 'master' into nodes
xh3b4sd bc4f2fc
updates vendor deps
xh3b4sd 8fa2d31
Merge branch 'master' into nodes
xh3b4sd 3e007ba
moves new resource to v13
xh3b4sd 986aae0
updates vendor deps
xh3b4sd e478b4c
compiles
xh3b4sd d19173c
adds more logging
xh3b4sd 9aeb4e2
removes deployment of node controller
xh3b4sd f41debc
comments
xh3b4sd a45cb36
comments
xh3b4sd 971b6b4
naming
xh3b4sd 67d51d6
tests
xh3b4sd 5ab4c4e
defaults
xh3b4sd eb01bed
naming
xh3b4sd a573499
compiles
xh3b4sd f902072
removes unused error
xh3b4sd 59937b6
updates vendor deps
xh3b4sd a9cd0e3
removes unnecessary cloud provider
xh3b4sd 0c09a7f
adds missing configuration
xh3b4sd 00edc97
brings back service test
xh3b4sd 1112b14
exposes latest version bundle
xh3b4sd e0bb1d9
wires controllers
xh3b4sd 8b9d671
fixes controller rest client
xh3b4sd eb9fcc8
cancels resource when guest API not ready
xh3b4sd 71d8c19
extends error handling
xh3b4sd 92e0a82
improves logging
xh3b4sd ca9e906
checks if pod of node is running
xh3b4sd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
package controller | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/giantswarm/apiextensions/pkg/apis/provider/v1alpha1" | ||
"github.com/giantswarm/apiextensions/pkg/clientset/versioned" | ||
"github.com/giantswarm/certs" | ||
|
@@ -19,6 +17,8 @@ import ( | |
"github.com/giantswarm/kvm-operator/service/controller/v11" | ||
"github.com/giantswarm/kvm-operator/service/controller/v12" | ||
v12cloudconfig "github.com/giantswarm/kvm-operator/service/controller/v12/cloudconfig" | ||
"github.com/giantswarm/kvm-operator/service/controller/v13" | ||
v13cloudconfig "github.com/giantswarm/kvm-operator/service/controller/v13/cloudconfig" | ||
"github.com/giantswarm/kvm-operator/service/controller/v2" | ||
"github.com/giantswarm/kvm-operator/service/controller/v3" | ||
"github.com/giantswarm/kvm-operator/service/controller/v4" | ||
|
@@ -30,10 +30,11 @@ import ( | |
) | ||
|
||
type ClusterConfig struct { | ||
G8sClient versioned.Interface | ||
K8sClient kubernetes.Interface | ||
K8sExtClient apiextensionsclient.Interface | ||
Logger micrologger.Logger | ||
CertsSearcher certs.Interface | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is some refactoring because of the injection of the certs searcher. This is because different controllers need it. |
||
G8sClient versioned.Interface | ||
K8sClient kubernetes.Interface | ||
K8sExtClient apiextensionsclient.Interface | ||
Logger micrologger.Logger | ||
|
||
GuestUpdateEnabled bool | ||
OIDC ClusterConfigOIDC | ||
|
@@ -73,21 +74,6 @@ func NewCluster(config ClusterConfig) (*Cluster, error) { | |
} | ||
} | ||
|
||
var certsSearcher certs.Interface | ||
{ | ||
c := certs.Config{ | ||
K8sClient: config.K8sClient, | ||
Logger: config.Logger, | ||
|
||
WatchTimeout: 5 * time.Second, | ||
} | ||
|
||
certsSearcher, err = certs.NewSearcher(c) | ||
if err != nil { | ||
return nil, microerror.Mask(err) | ||
} | ||
} | ||
|
||
var randomkeysSearcher randomkeys.Interface | ||
{ | ||
keyConfig := randomkeys.DefaultConfig() | ||
|
@@ -118,7 +104,7 @@ func NewCluster(config ClusterConfig) (*Cluster, error) { | |
var resourceSetV2 *controller.ResourceSet | ||
{ | ||
c := v2.ResourceSetConfig{ | ||
CertsSearcher: certsSearcher, | ||
CertsSearcher: config.CertsSearcher, | ||
K8sClient: config.K8sClient, | ||
Logger: config.Logger, | ||
RandomkeysSearcher: randomkeysSearcher, | ||
|
@@ -140,7 +126,7 @@ func NewCluster(config ClusterConfig) (*Cluster, error) { | |
var resourceSetV3 *controller.ResourceSet | ||
{ | ||
c := v3.ResourceSetConfig{ | ||
CertsSearcher: certsSearcher, | ||
CertsSearcher: config.CertsSearcher, | ||
K8sClient: config.K8sClient, | ||
Logger: config.Logger, | ||
RandomkeysSearcher: randomkeysSearcher, | ||
|
@@ -158,7 +144,7 @@ func NewCluster(config ClusterConfig) (*Cluster, error) { | |
var resourceSetV4 *controller.ResourceSet | ||
{ | ||
c := v4.ResourceSetConfig{ | ||
CertsSearcher: certsSearcher, | ||
CertsSearcher: config.CertsSearcher, | ||
K8sClient: config.K8sClient, | ||
Logger: config.Logger, | ||
RandomkeysSearcher: randomkeysSearcher, | ||
|
@@ -176,7 +162,7 @@ func NewCluster(config ClusterConfig) (*Cluster, error) { | |
var resourceSetV5 *controller.ResourceSet | ||
{ | ||
c := v5.ResourceSetConfig{ | ||
CertsSearcher: certsSearcher, | ||
CertsSearcher: config.CertsSearcher, | ||
K8sClient: config.K8sClient, | ||
Logger: config.Logger, | ||
RandomkeysSearcher: randomkeysSearcher, | ||
|
@@ -194,7 +180,7 @@ func NewCluster(config ClusterConfig) (*Cluster, error) { | |
var resourceSetV6 *controller.ResourceSet | ||
{ | ||
c := v6.ResourceSetConfig{ | ||
CertsSearcher: certsSearcher, | ||
CertsSearcher: config.CertsSearcher, | ||
K8sClient: config.K8sClient, | ||
Logger: config.Logger, | ||
RandomkeysSearcher: randomkeysSearcher, | ||
|
@@ -212,7 +198,7 @@ func NewCluster(config ClusterConfig) (*Cluster, error) { | |
var resourceSetV7 *controller.ResourceSet | ||
{ | ||
c := v7.ResourceSetConfig{ | ||
CertsSearcher: certsSearcher, | ||
CertsSearcher: config.CertsSearcher, | ||
K8sClient: config.K8sClient, | ||
Logger: config.Logger, | ||
RandomkeysSearcher: randomkeysSearcher, | ||
|
@@ -230,7 +216,7 @@ func NewCluster(config ClusterConfig) (*Cluster, error) { | |
var resourceSetV8 *controller.ResourceSet | ||
{ | ||
c := v8.ResourceSetConfig{ | ||
CertsSearcher: certsSearcher, | ||
CertsSearcher: config.CertsSearcher, | ||
K8sClient: config.K8sClient, | ||
Logger: config.Logger, | ||
RandomkeysSearcher: randomkeysSearcher, | ||
|
@@ -248,7 +234,7 @@ func NewCluster(config ClusterConfig) (*Cluster, error) { | |
var resourceSetV9 *controller.ResourceSet | ||
{ | ||
c := v9.ResourceSetConfig{ | ||
CertsSearcher: certsSearcher, | ||
CertsSearcher: config.CertsSearcher, | ||
K8sClient: config.K8sClient, | ||
Logger: config.Logger, | ||
RandomkeysSearcher: randomkeysSearcher, | ||
|
@@ -266,7 +252,7 @@ func NewCluster(config ClusterConfig) (*Cluster, error) { | |
var resourceSetV10 *controller.ResourceSet | ||
{ | ||
c := v10.ResourceSetConfig{ | ||
CertsSearcher: certsSearcher, | ||
CertsSearcher: config.CertsSearcher, | ||
K8sClient: config.K8sClient, | ||
Logger: config.Logger, | ||
RandomkeysSearcher: randomkeysSearcher, | ||
|
@@ -284,7 +270,7 @@ func NewCluster(config ClusterConfig) (*Cluster, error) { | |
var resourceSetV11 *controller.ResourceSet | ||
{ | ||
c := v11.ClusterResourceSetConfig{ | ||
CertsSearcher: certsSearcher, | ||
CertsSearcher: config.CertsSearcher, | ||
K8sClient: config.K8sClient, | ||
Logger: config.Logger, | ||
RandomkeysSearcher: randomkeysSearcher, | ||
|
@@ -302,7 +288,7 @@ func NewCluster(config ClusterConfig) (*Cluster, error) { | |
var resourceSetV12 *controller.ResourceSet | ||
{ | ||
c := v12.ClusterResourceSetConfig{ | ||
CertsSearcher: certsSearcher, | ||
CertsSearcher: config.CertsSearcher, | ||
K8sClient: config.K8sClient, | ||
Logger: config.Logger, | ||
RandomkeysSearcher: randomkeysSearcher, | ||
|
@@ -323,6 +309,30 @@ func NewCluster(config ClusterConfig) (*Cluster, error) { | |
} | ||
} | ||
|
||
var resourceSetV13 *controller.ResourceSet | ||
{ | ||
c := v13.ClusterResourceSetConfig{ | ||
CertsSearcher: config.CertsSearcher, | ||
K8sClient: config.K8sClient, | ||
Logger: config.Logger, | ||
RandomkeysSearcher: randomkeysSearcher, | ||
|
||
GuestUpdateEnabled: config.GuestUpdateEnabled, | ||
ProjectName: config.ProjectName, | ||
OIDC: v13cloudconfig.OIDCConfig{ | ||
ClientID: config.OIDC.ClientID, | ||
IssuerURL: config.OIDC.IssuerURL, | ||
UsernameClaim: config.OIDC.UsernameClaim, | ||
GroupsClaim: config.OIDC.GroupsClaim, | ||
}, | ||
} | ||
|
||
resourceSetV13, err = v13.NewClusterResourceSet(c) | ||
if err != nil { | ||
return nil, microerror.Mask(err) | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When the latest resource package got introduced it was not properly wired. Doing this here to get going. |
||
|
||
var resourceRouter *controller.ResourceRouter | ||
{ | ||
c := controller.ResourceRouterConfig{ | ||
|
@@ -340,6 +350,7 @@ func NewCluster(config ClusterConfig) (*Cluster, error) { | |
resourceSetV10, | ||
resourceSetV11, | ||
resourceSetV12, | ||
resourceSetV13, | ||
}, | ||
} | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to pin this. There was no other way I found to get the stupid deps right. This maybe improves again with the move to
1.10.4
.