Skip to content

Commit b76e12a

Browse files
committed
Start osin operator
Signed-off-by: Monis Khan <[email protected]>
1 parent 3cd295e commit b76e12a

File tree

8,908 files changed

+3068865
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

8,908 files changed

+3068865
-0
lines changed

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/_output
2+
/third-party
3+
/.project
4+
/.vagrant
5+
/.vscode
6+
/.settings
7+
/cpu.pprof
8+
/os-version-defs
9+
/.make/
10+
*.swp
11+
.vimrc
12+
.DS_Store
13+
.idea
14+
origin.iml
15+
*.pyc
16+
.tag*
17+
.project
18+
*.go~
19+
tags
20+
.envrc

.travis.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
language: go
2+
3+
go:
4+
- 1.9
5+
6+
script:
7+
- make build test-unit
8+
9+
notifications:
10+
irc: "chat.freenode.net#openshift-dev"
11+
12+
sudo: false

Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#
2+
# The standard name for this image is openshift/origin-cluster-osin-operator
3+
#
4+
FROM openshift/origin-release:golang-1.10
5+
COPY . /go/src/github.com/openshift/cluster-osin-operator
6+
RUN cd /go/src/github.com/openshift/cluster-osin-operator && go build ./cmd/osin-operator
7+
8+
FROM centos:7
9+
COPY --from=0 /go/src/github.com/openshift/cluster-osin-operator/osin-operator /usr/bin/osin-operator
10+
11+
COPY manifests /manifests
12+
LABEL io.openshift.release.operator true

Makefile

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# Old-skool build tools.
2+
#
3+
# Targets (see each target for more information):
4+
# all: Build code.
5+
# build: Build code.
6+
# check: Run verify, build, unit tests and cmd tests.
7+
# test: Run all tests.
8+
# run: Run all-in-one server
9+
# clean: Clean up.
10+
11+
OUT_DIR = _output
12+
OS_OUTPUT_GOPATH ?= 1
13+
14+
export GOFLAGS
15+
export TESTFLAGS
16+
# If set to 1, create an isolated GOPATH inside _output using symlinks to avoid
17+
# other packages being accidentally included. Defaults to on.
18+
export OS_OUTPUT_GOPATH
19+
# May be used to set additional arguments passed to the image build commands for
20+
# mounting secrets specific to a build environment.
21+
export OS_BUILD_IMAGE_ARGS
22+
23+
# Tests run using `make` are most often run by the CI system, so we are OK to
24+
# assume the user wants jUnit output and will turn it off if they don't.
25+
JUNIT_REPORT ?= true
26+
27+
# Build code.
28+
#
29+
# Args:
30+
# WHAT: Directory names to build. If any of these directories has a 'main'
31+
# package, the build will produce executable files under $(OUT_DIR)/local/bin.
32+
# If not specified, "everything" will be built.
33+
# GOFLAGS: Extra flags to pass to 'go' when building.
34+
# TESTFLAGS: Extra flags that should only be passed to hack/test-go.sh
35+
#
36+
# Example:
37+
# make
38+
# make all
39+
# make all WHAT=cmd/oc GOFLAGS=-v
40+
all build:
41+
hack/build-go.sh $(WHAT) $(GOFLAGS)
42+
.PHONY: all build
43+
44+
# Run core verification and all self contained tests.
45+
#
46+
# Example:
47+
# make check
48+
check: | verify test-unit
49+
.PHONY: check
50+
51+
52+
# Verify code conventions are properly setup.
53+
#
54+
# Example:
55+
# make verify
56+
verify:
57+
{ \
58+
hack/verify-gofmt.sh ||r=1;\
59+
hack/verify-govet.sh ||r=1;\
60+
hack/verify-imports.sh ||r=1;\
61+
exit $$r ;\
62+
}
63+
.PHONY: verify
64+
65+
66+
# Verify commit comments.
67+
#
68+
# Example:
69+
# make verify-commits
70+
verify-commits:
71+
hack/verify-upstream-commits.sh
72+
.PHONY: verify-commits
73+
74+
# Run unit tests.
75+
#
76+
# Args:
77+
# WHAT: Directory names to test. All *_test.go files under these
78+
# directories will be run. If not specified, "everything" will be tested.
79+
# TESTS: Same as WHAT.
80+
# GOFLAGS: Extra flags to pass to 'go' when building.
81+
# TESTFLAGS: Extra flags that should only be passed to hack/test-go.sh
82+
#
83+
# Example:
84+
# make test-unit
85+
# make test-unit WHAT=pkg/build TESTFLAGS=-v
86+
test-unit:
87+
GOTEST_FLAGS="$(TESTFLAGS)" hack/test-go.sh $(WHAT) $(TESTS)
88+
.PHONY: test-unit
89+
90+
# Run e2e tests.
91+
#
92+
# Args:
93+
#
94+
# Example:
95+
# make test-e2e
96+
test-e2e:
97+
echo "needs e2e"
98+
.PHONY: test-e2e
99+
100+
# Remove all build artifacts.
101+
#
102+
# Example:
103+
# make clean
104+
clean:
105+
rm -rf $(OUT_DIR)
106+
.PHONY: clean
107+
108+
# Build the cross compiled release binaries
109+
#
110+
# Example:
111+
# make build-cross
112+
build-cross:
113+
hack/build-cross.sh
114+
.PHONY: build-cross
115+
116+
# Build RPMs only for the Linux AMD64 target
117+
#
118+
# Args:
119+
#
120+
# Example:
121+
# make build-rpms
122+
build-rpms:
123+
OS_ONLY_BUILD_PLATFORMS='linux/amd64' hack/build-rpms.sh
124+
.PHONY: build-rpms
125+
126+
# Build images from the official RPMs
127+
#
128+
# Args:
129+
#
130+
# Example:
131+
# make build-images
132+
build-images:
133+
hack/build-images.sh
134+
.PHONY: build-images

OWNERS

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
reviewers:
2+
- enj
3+
- mrogers950
4+
- ericavonb
5+
- stlaz
6+
approvers:
7+
- enj
8+
- mrogers950
9+
- ericavonb
10+
- stlaz

cmd/osin-operator/main.go

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package main
2+
3+
import (
4+
goflag "flag"
5+
"fmt"
6+
"math/rand"
7+
"os"
8+
"time"
9+
10+
"github.com/spf13/cobra"
11+
"github.com/spf13/pflag"
12+
13+
utilflag "k8s.io/apiserver/pkg/util/flag"
14+
"k8s.io/apiserver/pkg/util/logs"
15+
16+
"github.com/openshift/cluster-osin-operator/pkg/cmd/operator"
17+
)
18+
19+
func main() {
20+
rand.Seed(time.Now().UTC().UnixNano())
21+
22+
pflag.CommandLine.SetNormalizeFunc(utilflag.WordSepNormalizeFunc)
23+
pflag.CommandLine.AddGoFlagSet(goflag.CommandLine)
24+
25+
logs.InitLogs()
26+
defer logs.FlushLogs()
27+
28+
command := NewOsinOperatorCommand()
29+
if err := command.Execute(); err != nil {
30+
fmt.Fprintf(os.Stderr, "%v\n", err)
31+
os.Exit(1)
32+
}
33+
}
34+
35+
func NewOsinOperatorCommand() *cobra.Command {
36+
cmd := &cobra.Command{
37+
Use: "osin-operator",
38+
Short: "OpenShift osin OAuth server operator",
39+
Run: func(cmd *cobra.Command, args []string) {
40+
cmd.Help()
41+
os.Exit(1)
42+
},
43+
}
44+
45+
cmd.AddCommand(operator.NewOperator())
46+
47+
return cmd
48+
}

0 commit comments

Comments
 (0)