Skip to content

Commit

Permalink
Revert "fixes bsc#1157338 (#860)"
Browse files Browse the repository at this point in the history
This reverts commit 5502630.

Because of SUSE/avant-garde#1257 we need to
revert #860

(cherry picked from commit 59e1993)
  • Loading branch information
jordimassaguerpla committed Jan 27, 2020
1 parent 2512306 commit 7399731
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 879 deletions.
10 changes: 0 additions & 10 deletions internal/pkg/skuba/addons/addons.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import (
"k8s.io/klog"

"github.com/SUSE/skuba/internal/pkg/skuba/kubernetes"
"github.com/SUSE/skuba/internal/pkg/skuba/replica"
"github.com/SUSE/skuba/internal/pkg/skuba/skuba"
skubaconstants "github.com/SUSE/skuba/pkg/skuba"
)
Expand Down Expand Up @@ -258,15 +257,6 @@ func (addon Addon) Apply(client clientset.Interface, addonConfiguration AddonCon
klog.Errorf("failed to run kubectl apply: %s", combinedOutput)
return err
}

replicaHelper, err := replica.NewHelper(client)
if err != nil {
return err
}
if err := replicaHelper.UpdateNodes(); err != nil {
return err
}

if addon.callbacks != nil {
if err := addon.callbacks.afterApply(addonConfiguration, skubaConfiguration); err != nil {
// TODO: should we rollback here?
Expand Down
4 changes: 0 additions & 4 deletions internal/pkg/skuba/addons/dex.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,8 @@ kind: Deployment
metadata:
name: oidc-dex
namespace: kube-system
labels:
app: oidc-dex
caasp.suse.com/skuba-replica-ha: "true"
spec:
replicas: 3
revisionHistoryLimit: 0
selector:
matchLabels:
app: oidc-dex
Expand Down
2 changes: 0 additions & 2 deletions internal/pkg/skuba/addons/gangway.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,8 @@ metadata:
namespace: kube-system
labels:
app: oidc-gangway
caasp.suse.com/skuba-replica-ha: "true"
spec:
replicas: 3
revisionHistoryLimit: 0
selector:
matchLabels:
app: oidc-gangway
Expand Down
5 changes: 0 additions & 5 deletions internal/pkg/skuba/kubernetes/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ import (
kubectldrain "k8s.io/kubernetes/pkg/kubectl/drain"
)

// GetAllNodes returns the list of nodes
func GetAllNodes(client clientset.Interface) (*corev1.NodeList, error) {
return client.CoreV1().Nodes().List(metav1.ListOptions{})
}

// GetControlPlaneNodes returns the list of master nodes by matching
// "node-role.kubernetes.io/master" label.
func GetControlPlaneNodes(client clientset.Interface) (*corev1.NodeList, error) {
Expand Down
56 changes: 0 additions & 56 deletions internal/pkg/skuba/kubernetes/nodes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,62 +82,6 @@ func createNode(name string, isControlPlane bool, machineID string) corev1.Node
}
}

func TestGetAllNodes(t *testing.T) {
tests := []struct {
name string
fakeClientset *fake.Clientset
expect int
}{
{
name: "get nodes when cluster has 1 master",
fakeClientset: fake.NewSimpleClientset(
&corev1.NodeList{
Items: []corev1.Node{
m1,
},
},
),
expect: 1,
},
{
name: "get control plane node when cluster has 1 master, 1 worker",
fakeClientset: fake.NewSimpleClientset(
&corev1.NodeList{
Items: []corev1.Node{
m1,
w1,
},
},
),
expect: 2,
},
{
name: "get all node when cluster has 2 master, 2 worker",
fakeClientset: fake.NewSimpleClientset(
&corev1.NodeList{
Items: []corev1.Node{
m1, m2,
w1, w2,
},
},
),
expect: 4,
},
}

for _, tt := range tests {
tt := tt // Parallel testing
t.Run(tt.name, func(t *testing.T) {
actual, _ := GetAllNodes(tt.fakeClientset)
actualSize := len(actual.Items)
if actualSize != tt.expect {
t.Errorf("returned node number (%d) does not match the expected one (%d)", actualSize, tt.expect)
return
}
})
}
}

func TestGetControlPlaneNodes(t *testing.T) {
tests := []struct {
name string
Expand Down
8 changes: 4 additions & 4 deletions internal/pkg/skuba/kubernetes/versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ var (
AddonsVersion: AddonsVersion{
Cilium: &AddonVersion{"1.5.3", 1},
Kured: &AddonVersion{"1.2.0-rev4", 1},
Dex: &AddonVersion{"2.16.0", 4},
Gangway: &AddonVersion{"3.1.0-rev4", 4},
Dex: &AddonVersion{"2.16.0", 3},
Gangway: &AddonVersion{"3.1.0-rev4", 3},
PSP: &AddonVersion{"", 1},
},
},
Expand All @@ -113,8 +113,8 @@ var (
AddonsVersion: AddonsVersion{
Cilium: &AddonVersion{"1.5.3", 1},
Kured: &AddonVersion{"1.2.0-rev4", 1},
Dex: &AddonVersion{"2.16.0", 4},
Gangway: &AddonVersion{"3.1.0-rev4", 4},
Dex: &AddonVersion{"2.16.0", 3},
Gangway: &AddonVersion{"3.1.0-rev4", 3},
PSP: &AddonVersion{"", 1},
},
},
Expand Down
Loading

0 comments on commit 7399731

Please sign in to comment.