Skip to content

Update sdk 1.x #186

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

Closed
wants to merge 3 commits into from
Closed
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
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.git
testbin
9 changes: 4 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
devworkspace-crds
config/crd/bases/workspace.devfile.io_devworkspaces.yaml
testbin
.vscode

# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
_output
vendor
devworkspace-crds
config/devfiles
.e2e/
bin

# Test binary, build with `go test -c`
Expand Down
406 changes: 173 additions & 233 deletions Makefile

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
domain: devfile.io
layout: go.kubebuilder.io/v2
multigroup: true
projectName: devworkspace-operator-migration
repo: github.com/devfile/devworkspace-operator
resources:
- group: controller
kind: Component
version: v1alpha1
- group: controller
kind: WorkspaceRouting
version: v1alpha1
- group: workspace
kind: DevWorkspace
version: v1alpha1
version: 3-alpha
plugins:
go.sdk.operatorframework.io/v2-alpha: {}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
// Red Hat, Inc. - initial API and implementation
//

// NOTE: Boilerplate only. Ignore this file.

// Package v1alpha1 contains API Schema definitions for the controller v1alpha1 API group
// +k8s:deepcopy-gen=package,register
// +kubebuilder:object:generate=true
// +groupName=controller.devfile.io
package v1alpha1

Expand All @@ -23,9 +21,12 @@ import (
)

var (
// SchemeGroupVersion is group version used to register these objects
SchemeGroupVersion = schema.GroupVersion{Group: "controller.devfile.io", Version: "v1alpha1"}
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "controller.devfile.io", Version: "v1alpha1"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
)

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 17 additions & 10 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,36 @@
FROM golang:1.13.7-alpine3.11 as builder
# Build the manager binary
FROM golang:1.13 as builder

RUN go env GOPROXY
WORKDIR /devworkspace-operator

# Populate the module cache based on the go.{mod,sum} files.
COPY go.mod .
COPY go.sum .
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download

# copy the rest of the sources code
# Copy the go source
COPY . .

# compile workspace controller binaries
RUN CGO_ENABLED=0 GOOS=linux go build \
-o _output/bin/devworkspace-controller \
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build \
-a -o _output/bin/devworkspace-controller \
-gcflags all=-trimpath=/ \
-asmflags all=-trimpath=/ \
cmd/manager/main.go
main.go

# Compile webhook binaries
RUN CGO_ENABLED=0 GOOS=linux go build \
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build \
-o _output/bin/webhook-server \
-gcflags all=-trimpath=/ \
-asmflags all=-trimpath=/ \
webhook/main.go

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM registry.access.redhat.com/ubi8-minimal:8.2-349
WORKDIR /
COPY --from=builder /devworkspace-operator/_output/bin/devworkspace-controller /usr/local/bin/devworkspace-controller
COPY --from=builder /devworkspace-operator/_output/bin/webhook-server /usr/local/bin/webhook-server
COPY --from=builder /devworkspace-operator/internal-registry internal-registry
Expand Down
Loading