Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored post-installation framework labels #6341

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/antctl/raw/check/cluster/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func Run() error {

func (t *testContext) setup(ctx context.Context) error {
t.Log("Creating Namespace %s for pre installation tests...", t.namespace)
_, err := t.client.CoreV1().Namespaces().Create(ctx, &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: t.namespace}}, metav1.CreateOptions{})
_, err := t.client.CoreV1().Namespaces().Create(ctx, &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: t.namespace, Labels: map[string]string{"app": "antrea", "component": "cluster-checker"}}}, metav1.CreateOptions{})
if err != nil {
return fmt.Errorf("unable to create Namespace %s: %s", t.namespace, err)
}
Expand Down
14 changes: 7 additions & 7 deletions pkg/antctl/raw/check/installation/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func (t *testContext) setup(ctx context.Context) error {
return fmt.Errorf("unable to determine status of Antrea DaemonSet: %w", err)
}
t.Log("Creating Namespace %s for post installation tests...", t.namespace)
_, err = t.client.CoreV1().Namespaces().Create(ctx, &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: t.namespace}}, metav1.CreateOptions{})
_, err = t.client.CoreV1().Namespaces().Create(ctx, &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: t.namespace, Labels: map[string]string{"app": "antrea", "component": "installation-checker"}}}, metav1.CreateOptions{})
if err != nil {
return fmt.Errorf("unable to create Namespace %s: %s", t.namespace, err)
}
Expand All @@ -190,7 +190,7 @@ func (t *testContext) setup(ctx context.Context) error {
Effect: "NoSchedule",
},
}
echoDeployment := check.NewDeployment(check.DeploymentParameters{
echoSameNodeDeployment := check.NewDeployment(check.DeploymentParameters{
Name: echoSameNodeDeploymentName,
Role: kindEchoName,
Port: 80,
Expand All @@ -215,9 +215,9 @@ func (t *testContext) setup(ctx context.Context) error {
},
},
Tolerations: commonToleration,
Labels: map[string]string{"app": echoSameNodeDeploymentName},
Labels: map[string]string{"app": "antrea", "component": "installation-checker", "name": echoSameNodeDeploymentName},
kanha-gupta marked this conversation as resolved.
Show resolved Hide resolved
})
_, err = t.client.AppsV1().Deployments(t.namespace).Create(ctx, echoDeployment, metav1.CreateOptions{})
_, err = t.client.AppsV1().Deployments(t.namespace).Create(ctx, echoSameNodeDeployment, metav1.CreateOptions{})
if err != nil {
return fmt.Errorf("unable to create Deployment %s: %s", echoSameNodeDeploymentName, err)
}
Expand All @@ -229,7 +229,7 @@ func (t *testContext) setup(ctx context.Context) error {
Command: []string{"/agnhost", "pause"},
Port: 80,
Tolerations: commonToleration,
Labels: map[string]string{"app": clientDeploymentName},
Labels: map[string]string{"app": "antrea", "component": "installation-checker", "name": clientDeploymentName},
})
_, err = t.client.AppsV1().Deployments(t.namespace).Create(ctx, clientDeployment, metav1.CreateOptions{})
if err != nil {
Expand All @@ -256,7 +256,7 @@ func (t *testContext) setup(ctx context.Context) error {
},
},
Tolerations: commonToleration,
Labels: map[string]string{"app": echoOtherNodeDeploymentName},
Labels: map[string]string{"app": "antrea", "component": "installation-checker", "name": echoOtherNodeDeploymentName},
})
nodes, err := t.client.CoreV1().Nodes().List(ctx, metav1.ListOptions{})
if err != nil {
Expand Down Expand Up @@ -289,7 +289,7 @@ func (t *testContext) setup(ctx context.Context) error {
return err
}
}
podList, err := t.client.CoreV1().Pods(t.namespace).List(ctx, metav1.ListOptions{LabelSelector: "kind=" + kindClientName})
podList, err := t.client.CoreV1().Pods(t.namespace).List(ctx, metav1.ListOptions{LabelSelector: "name=" + clientDeploymentName})
if err != nil {
return fmt.Errorf("unable to list client Pods: %s", err)
}
Expand Down
2 changes: 0 additions & 2 deletions pkg/antctl/raw/check/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ func NewDeployment(p DeploymentParameters) *appsv1.Deployment {
if p.Labels == nil {
p.Labels = make(map[string]string)
}
p.Labels["name"] = p.Name
p.Labels["kind"] = p.Role
return &appsv1.Deployment{
ObjectMeta: metav1.ObjectMeta{
Name: p.Name,
Expand Down
Loading