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

SPLAT-1341: bump CAPI to 1.6 and IPAM APIs to v1beta1 #19

Closed
wants to merge 5 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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
- name: Set Up Go
uses: actions/setup-go@v3
with:
go-version: 1.20
go-version: 1.20.0
# - name: Pull Secret
# run: echo '${{ secrets.PULLSECRET }}' > ~/.docker/config.json
- name: Go Mod
run: go mod vendor
# - name: Build
# run: go build -v --mod=vendor -ldflags "-X github.com/rvanderp3/mapi-static-ip-controller/pkg/version.Raw=${{ vars.GITHUB_REF_NAME }} -X github.com/rvanderp3/mapi-static-ip-controller/pkg/version.Commit=${{ vars.GITHUB_SHA }}" -o "bin/mapi-static-ip-controller" ./cmd/mapi-static-ip-controller
# run: go build -v --mod=vendor -ldflags "-X github.com/openshift-splat-team/mapi-static-ip-controller/pkg/version.Raw=${{ vars.GITHUB_REF_NAME }} -X github.com/openshift-splat-team/mapi-static-ip-controller/pkg/version.Commit=${{ vars.GITHUB_SHA }}" -o "bin/mapi-static-ip-controller" ./cmd/mapi-static-ip-controller
- name: Build Image
id: build-image
uses: redhat-actions/[email protected]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
- name: Set Up Go
uses: actions/setup-go@v3
with:
go-version: 1.20
go-version: 1.20.0
- name: Go Mod
run: go mod vendor
- name: Go Build
run: go build -v --mod=vendor -ldflags "-X github.com/rvanderp3/mapi-static-ip-controller/pkg/version.Raw=${{ vars.GITHUB_REF_NAME }} -X github.com/rvanderp3/mapi-static-ip-controller/pkg/version.Commit=${{ vars.GITHUB_SHA }}" -o "bin/mapi-static-ip-controller" ./cmd/mapi-static-ip-controller
run: go build -v --mod=vendor -ldflags "-X github.com/openshift-splat-team/mapi-static-ip-controller/pkg/version.Raw=${{ vars.GITHUB_REF_NAME }} -X github.com/openshift-splat-team/mapi-static-ip-controller/pkg/version.Commit=${{ vars.GITHUB_SHA }}" -o "bin/mapi-static-ip-controller" ./cmd/mapi-static-ip-controller

8 changes: 8 additions & 0 deletions .idea/.gitignore

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

9 changes: 9 additions & 0 deletions .idea/ip-mgmt-controller.iml

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

8 changes: 8 additions & 0 deletions .idea/modules.xml

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

7 changes: 7 additions & 0 deletions .idea/vcs.xml

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

4 changes: 2 additions & 2 deletions DEV.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ curl https://patch-diff.githubusercontent.com/raw/openshift/installer/pull/6512.

3. Update go.mod to use API extensions in [api#1338](https://github.com/openshift/api/pull/1338)
~~~go
replace github.com/openshift/api => github.com/rvanderp3/api v0.0.0-20230320203849-e0ab19eba3b2
replace github.com/openshift/api => github.com/openshift-splat-team/api v0.0.0-20230320203849-e0ab19eba3b2
~~~
4. Revendor
~~~sh
Expand All @@ -53,7 +53,7 @@ curl https://patch-diff.githubusercontent.com/raw/openshift/machine-api-operator

3. Update go.mod to use API extensions in [api#1338](https://github.com/openshift/api/pull/1338)
~~~go
replace github.com/openshift/api => github.com/rvanderp3/api v0.0.0-20230425185222-828ab2f6180c
replace github.com/openshift/api => github.com/openshift-splat-team/api v0.0.0-20230425185222-828ab2f6180c
~~~
4. Revendor
~~~sh
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM registry.ci.openshift.org/openshift/release:golang-1.19 AS builder
WORKDIR /go/src/github.com/rvanderp3/machine-ipam-controller
WORKDIR /go/src/github.com/openshift-splat-team/machine-ipam-controller
COPY . .
ENV GO_PACKAGE github.com/rvanderp3/machine-ipam-controller
ENV GO_PACKAGE github.com/openshift-splat-team/machine-ipam-controller
RUN NO_DOCKER=1 make build

# FROM registry.ci.openshift.org/openshift/origin-v4.0:base
# FROM registry.ci.openshift.org/ocp/4.13:base
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.7-1107
COPY --from=builder /go/src/github.com/rvanderp3/machine-ipam-controller/install manifests
COPY --from=builder /go/src/github.com/rvanderp3/machine-ipam-controller/bin/mapi-static-ip-controller /usr/bin/mapi-static-ip-controller
COPY --from=builder /go/src/github.com/openshift-splat-team/machine-ipam-controller/install manifests
COPY --from=builder /go/src/github.com/openshift-splat-team/machine-ipam-controller/bin/mapi-static-ip-controller /usr/bin/mapi-static-ip-controller
ENTRYPOINT ["/usr/bin/mapi-static-ip-controller"]
LABEL io.openshift.release.operator=true
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ ifeq ($(NO_DOCKER), 1)
DOCKER_CMD =
IMAGE_BUILD_CMD = imagebuilder
else
DOCKER_CMD := $(ENGINE) run --env GO111MODULE=$(GO111MODULE) --env GOFLAGS=$(GOFLAGS) --rm -v "$(PWD)":/go/src/github.com/rvanderp3/machine-ipam-controller:Z -w /go/src/github.com/rvanderp3/machine-ipam-controller $(BUILD_IMAGE)
DOCKER_CMD := $(ENGINE) run --env GO111MODULE=$(GO111MODULE) --env GOFLAGS=$(GOFLAGS) --rm -v "$(PWD)":/go/src/github.com/openshift-splat-team/machine-ipam-controller:Z -w /go/src/github.com/openshift-splat-team/machine-ipam-controller $(BUILD_IMAGE)
# The command below is for building/testing with the actual image that Openshift uses. Uncomment/comment out to use instead of above command. CI registry pull secret is required to use this image.
# DOCKER_CMD := $(ENGINE) run --env GO111MODULE=$(GO111MODULE) --env GOFLAGS=$(GOFLAGS) --rm -v "$(PWD)":/go/src/github.com/rvanderp3/machine-ipam-controller:Z -w /go/src/github.com/rvanderp3/machine-ipam-controller registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.19-openshift-4.11
# DOCKER_CMD := $(ENGINE) run --env GO111MODULE=$(GO111MODULE) --env GOFLAGS=$(GOFLAGS) --rm -v "$(PWD)":/go/src/github.com/openshift-splat-team/machine-ipam-controller:Z -w /go/src/github.com/openshift-splat-team/machine-ipam-controller registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.19-openshift-4.11
IMAGE_BUILD_CMD = $(ENGINE) build
endif

Expand Down
Binary file added bin/mapi-static-ip-controller
Binary file not shown.
11 changes: 6 additions & 5 deletions cmd/mapi-static-ip-controller/mapi-static-ip-controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,27 @@ package main
import (
"context"
"fmt"
"github.com/pkg/errors"
corev1 "k8s.io/api/core/v1"
"os"
"strings"
"sync"

"github.com/pkg/errors"
corev1 "k8s.io/api/core/v1"

osclientset "github.com/openshift/client-go/config/clientset/versioned"
mapiclientset "github.com/openshift/client-go/machine/clientset/versioned"
log "github.com/sirupsen/logrus"
"k8s.io/apimachinery/pkg/types"
ipamv1 "sigs.k8s.io/cluster-api/exp/ipam/api/v1alpha1"
ipamv1 "sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1"
"sigs.k8s.io/controller-runtime/pkg/builder"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/config"
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/manager/signals"
"sigs.k8s.io/controller-runtime/pkg/reconcile"

ipamcontrollerv1 "github.com/rvanderp3/machine-ipam-controller/pkg/apis/ipamcontroller.openshift.io/v1"
"github.com/rvanderp3/machine-ipam-controller/pkg/mgmt"
ipamcontrollerv1 "github.com/openshift-splat-team/machine-ipam-controller/pkg/apis/ipamcontroller.openshift.io/v1"
"github.com/openshift-splat-team/machine-ipam-controller/pkg/mgmt"
)

var (
Expand Down
Loading