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

output object's namespace and name for preflight and driver #1922

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions pkg/client/preflight.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ func nsCheck(getter nsGetFunc, ns string) error {
case apierrors.IsNotFound(err):
return nil
case err != nil:
return errors.Wrap(err, "error checking for namespace")
return errors.Wrap(err, fmt.Sprintf("error checking for namespace %s", ns))
case err == nil:
return errors.New("namespace already exists")
return errors.New(fmt.Sprintf("namespace %s already exists", ns))
}
return nil
}
4 changes: 2 additions & 2 deletions pkg/plugin/driver/daemonset/daemonset.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,11 @@ func (p *Plugin) Run(kubeclient kubernetes.Interface, hostname string, cert *tls
}

if _, err := kubeclient.CoreV1().Secrets(p.Namespace).Create(context.TODO(), secret, metav1.CreateOptions{}); err != nil {
return errors.Wrapf(err, "couldn't create TLS secret for daemonset plugin %v", p.GetName())
return errors.Wrapf(err, "couldn't create TLS secret for daemonset plugin %v, secret name is %s", p.GetName(), secret.Namespace+"/"+secret.Name)
}

if _, err := kubeclient.AppsV1().DaemonSets(p.Namespace).Create(context.TODO(), &daemonSet, metav1.CreateOptions{}); err != nil {
return errors.Wrapf(err, "could not create DaemonSet for daemonset plugin %v", p.GetName())
return errors.Wrapf(err, "could not create DaemonSet for daemonset plugin %v, daemonset name is %s", p.GetName(), daemonSet.Namespace+"/"+daemonSet.Name)
}

return nil
Expand Down
4 changes: 2 additions & 2 deletions pkg/plugin/driver/job/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ func (p *Plugin) Run(kubeclient kubernetes.Interface, hostname string, cert *tls
}

if _, err := kubeclient.CoreV1().Secrets(p.Namespace).Create(context.TODO(), secret, metav1.CreateOptions{}); err != nil {
return errors.Wrapf(err, "couldn't create TLS secret for job plugin %v", p.GetName())
return errors.Wrapf(err, "couldn't create TLS secret for job plugin %v, secret name is %s", p.GetName(), secret.Namespace+"/"+secret.Name)
}

if _, err := kubeclient.CoreV1().Pods(p.Namespace).Create(context.TODO(), &job, metav1.CreateOptions{}); err != nil {
return errors.Wrapf(err, "could not create Job resource for Job plugin %v", p.GetName())
return errors.Wrapf(err, "could not create Job resource for Job plugin %v, pod name is %s", p.GetName(), job.Namespace+"/"+job.Name)
}

return nil
Expand Down
Loading