Skip to content

Commit

Permalink
refactored post-installation framework labels
Browse files Browse the repository at this point in the history
Signed-off-by: Kanha gupta <[email protected]>
  • Loading branch information
kanha-gupta committed May 17, 2024
1 parent 3d6a29c commit a1c86c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 6 additions & 6 deletions pkg/antctl/raw/check/installation/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
})
_, 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

0 comments on commit a1c86c7

Please sign in to comment.