Skip to content

Commit

Permalink
random stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
sreya committed Jan 31, 2024
1 parent 01c9b7f commit 50af8fb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
5 changes: 0 additions & 5 deletions reporter/reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ type K8sReporter struct {
factory informers.SharedInformerFactory
}

type WorkspaceAgent struct {
Image string
Token string
}

func (k *K8sReporter) Init(ctx context.Context) error {
k.factory = informers.NewSharedInformerFactoryWithOptions(k.Client, 0, informers.WithNamespace(k.Namespace), informers.WithTweakListOptions(func(lo *v1.ListOptions) {
lo.FieldSelector = k.FieldSelector
Expand Down
12 changes: 7 additions & 5 deletions root.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ func root() *cobra.Command {
}

if artifactoryURL == "" {
return xerrors.New("--coder-url is required")
return xerrors.New("--artifactory-url is required")
}

_, err = url.Parse(artifactoryURL)
if err != nil {
return fmt.Errorf("parse coder URL: %w", err)
return fmt.Errorf("parse artifactory URL: %w", err)
}

if artifactoryUser == "" {
Expand All @@ -75,13 +75,13 @@ func root() *cobra.Command {
}

coderClient := reporter.NewClient(coderParsed, coderToken)

logger := slog.Make(sloghuman.Sink(cmd.ErrOrStderr()))
kr := reporter.K8sReporter{
Client: kclient,
JFrogClient: jclient,
CoderClient: coderClient,
Namespace: namespace,
Logger: slog.Make(sloghuman.Sink(cmd.ErrOrStderr())),
Logger: logger,
}

err = kr.Init(cmd.Context())
Expand All @@ -91,9 +91,11 @@ func root() *cobra.Command {

stopCh := make(chan struct{})
defer close(stopCh)
go kr.Start(stopCh)
kr.Start(stopCh)
<-cmd.Context().Done()

logger.Info(cmd.Context(), "exiting")

return nil
},
}
Expand Down

0 comments on commit 50af8fb

Please sign in to comment.