Skip to content
This repository has been archived by the owner on May 6, 2021. It is now read-only.

WIP: Single user Idler v for test/debug purpose #284

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aslakknutsen
Copy link
Contributor

Input: Namespace Basename, OSIO User UUID, CLuster URL and OS User Token

Watches builds and deployments in a single namespace relying only on a User token
(require admin/edit of -jenkins ns to perform Idle/Unidle)

See cmd/fabric8-jenkins-idler-test/main.go for "var"s required.

Run on cli

go install -ldflags="-X github.com/fabric8-services/fabric8-jenkins-idler/internal/version.version=c931081" ./cmd/fabric8-jenkins-idler-test && fabric8-jenkins-idler-test

Or run/debug the test TestSingleIdler in cmd/fabric8-jenkins-idler-test/main_test.go

Currently uses a copied and modified v of idler.go. The changes are only related to passing in the namespace and switch between calling the 'WatchNamespaceXXX' Openshift Client to watch the Cluster or a given Client. (Trying to avoid changing the original code as much as possible during debugging)

@aslakknutsen
Copy link
Contributor Author

In addition to this, it would be nice to maybe flip the 'ShouldIdle' toggle or introduce another toggle to 'IgnoreUser' in prod. That way you could temporarily disable the prod idler for a given user while you run a local debug session to not have it interfere.

"testing"
)

func XTestSingleIdler(t *testing.T) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

XTestSingleIdler is unused

Input: Namespace Basename, OSIO User UUID, CLuster URL and OS User Token

Watches builds and deployments in a single namespace relying only on a User token
(require admin/edit of -jenkins ns to perform Idle/Unidle)

See cmd/fabric8-jenkins-idler-test/main.go for "var"s required.

Run on cli

    go install -ldflags="-X github.com/fabric8-services/fabric8-jenkins-idler/internal/version.version=c931081" ./cmd/fabric8-jenkins-idler-test && fabric8-jenkins-idler-test

Or run/debug the test TestSingleIdler in cmd/fabric8-jenkins-idler-test/main_test.go
}
}()

for {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should use for range instead of for { select {} }

}
}()

for {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should use for range instead of for { select {} }

@sthaha sthaha requested a review from chmouel October 15, 2018 00:26
@hrishin hrishin added this to the M milestone Dec 21, 2018
@chmouel chmouel removed their request for review September 17, 2019 08:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants