Skip to content

Commit

Permalink
Remove v2 for luigi and hostplumber, updates go-to-1.22 , deps, alpin…
Browse files Browse the repository at this point in the history
…e. Backport fixes. (#259)

* Updated to go1.22, Alpine 3.20, latest controller-tools controller-gen and setup-envtest

* Backport : Added metricsPort to hostplumber plugin (#230)

* Backport : Update sampleplugins.yaml (#241)

* Backport : [PMK-6474] : Restrict TLS cipher suites for kube-rbac-proxy container (#213)

* [Backport for PMK 5.10] Added ability to customize hostplumber metrics port  (#216)

* Added ability to customize hostplumber metrics port (#211)

* Added ability to customize hostplumber metrics port

* Removing unused packages

* RUN apk update && apk upgrade from hostplumber/Dockerfile

---------

Co-authored-by: Jayanth_Reddy_0916 <[email protected]>
Co-authored-by: Manasa Bellamkonda <[email protected]>
  • Loading branch information
3 people committed Nov 25, 2024
1 parent 21f0ddf commit ae09991
Show file tree
Hide file tree
Showing 140 changed files with 911 additions and 5,786 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: actions/setup-go@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
go-version: 1.21
go-version: 1.22
check-latest: true
cache: true
- name: Print the version of golang
Expand All @@ -37,7 +37,7 @@ jobs:
uses: actions/setup-go@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
go-version: 1.21
go-version: 1.22
check-latest: true
cache: true
- name: Print the version of golang
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/hostplumber-multiarch-build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
env:
USERNAME: ${{ secrets.QUAY_USERNAME }}
PASSWORD: ${{ secrets.QUAY_PASSWORD }}
OVERRIDE_HOSTPLUMBER_VERSION: ${{ secrets.OVERRIDE_HOSTPLUMBER_VERSION || '' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/luigi-build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
env:
USERNAME: ${{ secrets.QUAY_USERNAME }}
PASSWORD: ${{ secrets.QUAY_PASSWORD }}
OVERRIDE_LUIGI_VERSION: ${{ secrets.OVERRIDE_LUIGI_VERSION || '' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.21 as builder
FROM golang:1.22 AS builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand All @@ -23,7 +23,7 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go
# Refer to https://github.com/GoogleContainerTools/distroless for more details
#FROM gcr.io/distroless/static:nonroot

FROM alpine:3.18
FROM alpine:3.20
RUN apk add --no-cache bash
WORKDIR /
COPY --from=builder /workspace/manager .
Expand Down
20 changes: 11 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
SHELL=/bin/bash
# Image URL to use all building/pushing image targets
#IMG ?= controller:latest

ifndef OVERRIDE_LUIGI_VERSION
IMG_TAG = $(shell ./get-label.bash)
IMG_TAG = $(shell ./get-label.bash)
else
IMG_TAG ?= $(OVERRIDE_LUIGI_VERSION)
ifneq ($(strip $(OVERRIDE_LUIGI_VERSION)),)
IMG_TAG ?= $(OVERRIDE_LUIGI_VERSION)
else
IMG_TAG = $(shell ./get-label.bash)
endif
endif

IMG = quay.io/platform9/luigi-plugins:$(IMG_TAG)
IMG ?= quay.io/platform9/luigi-plugins:$(IMG_TAG)
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.27
ENVTEST_K8S_VERSION = 1.29

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down Expand Up @@ -134,7 +136,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest

## Tool Versions
KUSTOMIZE_VERSION ?= v3.8.7
CONTROLLER_TOOLS_VERSION ?= v0.8.0
CONTROLLER_TOOLS_VERSION ?= v0.16.3

KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
Expand All @@ -150,10 +152,10 @@ $(CONTROLLER_GEN): $(LOCALBIN)
.PHONY: envtest
envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
$(ENVTEST): $(LOCALBIN)
GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@v0.0.0-20230216140739-c98506dc3b8e
GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest

img-test:
docker run --rm -v $(SRCROOT):/luigi -w /luigi golang:1.21 bash -c "GOFLAGS=-buildvcs=false make test"
docker run --rm -v $(SRCROOT):/luigi -w /luigi golang:1.22 bash -c "GOFLAGS=-buildvcs=false make test"

img-build: $(BUILD_DIR) img-test
docker build --network host . -t ${IMG}
Expand Down
1 change: 0 additions & 1 deletion api/v1/zz_generated.deepcopy.go

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

97 changes: 97 additions & 0 deletions config/crd/bases/dhcp.plumber.k8s.pf9.io_dhcpservers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.3
name: dhcpservers.dhcp.plumber.k8s.pf9.io
spec:
group: dhcp.plumber.k8s.pf9.io
names:
kind: DHCPServer
listKind: DHCPServerList
plural: dhcpservers
singular: dhcpserver
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: DHCPServer is the Schema for the dhcpservers API
properties:
apiVersion:
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: DHCPServerSpec defines the desired state of DHCPServer
properties:
networks:
description: Details of Networks
items:
properties:
cidr:
description: refers to CIDR of server
properties:
gateway:
description: refers to gateway IP
type: string
range:
description: refers to cidr range
type: string
range_end:
description: refers to end IP of range
type: string
range_start:
description: refers to start IP of range
type: string
required:
- range
type: object
interfaceIp:
description: refers to IP address to bind interface to
type: string
leaseDuration:
description: refers to leasetime of IP
type: string
networkName:
description: refers to net-attach-def to be served
type: string
vlanId:
description: refers to vlan
type: string
required:
- cidr
- interfaceIp
- networkName
type: object
type: array
nodeSelector:
additionalProperties:
type: string
description: Node Selector for the DHCPServer VM
type: object
required:
- networks
type: object
status:
description: DHCPServerStatus defines the observed state of DHCPServer
type: object
type: object
served: true
storage: true
subresources:
status: {}
68 changes: 68 additions & 0 deletions config/crd/bases/dhcp.plumber.k8s.pf9.io_ipallocations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.3
name: ipallocations.dhcp.plumber.k8s.pf9.io
spec:
group: dhcp.plumber.k8s.pf9.io
names:
kind: IPAllocation
listKind: IPAllocationList
plural: ipallocations
singular: ipallocation
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: IPAllocation is the Schema for the ipallocations API
properties:
apiVersion:
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: IPAllocationSpec defines the desired state of IPAllocation
properties:
entityRef:
description: EntityRef is the name of the VMI or pod who owns the
lease
type: string
leaseExpiry:
description: LeaseExpiry is the epoch time when the IP was set to
expire in the leasefile
type: string
macAddr:
description: MacAddr is the mac address of interface
type: string
vlanId:
description: VlanID is the epoch time when the IP was set to expire
in the leasefile
type: string
required:
- leaseExpiry
- vlanId
type: object
status:
description: IPAllocationStatus defines the observed state of IPAllocation
type: object
type: object
served: true
storage: true
subresources:
status: {}
Loading

0 comments on commit ae09991

Please sign in to comment.