Skip to content

Commit

Permalink
Updates to fix the CI (#89)
Browse files Browse the repository at this point in the history
* Updates to fix the CI

* Switch to the last ironic-image branch that had inspector
* Use a more recent version of Go

* Update golangci-lint and fix detected issues
  • Loading branch information
dtantsur authored Jul 23, 2024
1 parent a38ad7e commit 8a5e7ee
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.21

- name: Check formatting
run: make fmt
Expand All @@ -30,7 +30,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.21

- name: Install dependencies
run: sudo apt-get install -y genisoimage podman netcat
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ lint :$(GOPATH)/golangci-lint
GOLANGCI_LINT_CACHE=/tmp/golangci-lint-cache/ $(GOPATH)/golangci-lint run ironic

$(GOPATH)/golangci-lint:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH) v1.50.0
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH) v1.59.1

test:
go test -tags "${TAGS}" -v ./ironic
Expand Down
9 changes: 6 additions & 3 deletions hack/local_ironic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ else
CONTAINER_RUNTIME=docker
fi

IMAGE=${IMAGE:-quay.io/metal3-io/ironic:main}
# NOTE(dtantsur): release-24.1 is the last branch to support inspector
IMAGE=${IMAGE:-quay.io/metal3-io/ironic:release-24.1}

sudo $CONTAINER_RUNTIME run -d --net host --privileged --name ironic \
--entrypoint /bin/runironic -e "PROVISIONING_IP=127.0.0.1" $IMAGE
--entrypoint /bin/runironic -e "PROVISIONING_IP=127.0.0.1" \
-e "USE_IRONIC_INSPECTOR=true" $IMAGE
sudo $CONTAINER_RUNTIME run -d --net host --privileged --name ironic-inspector \
--entrypoint /bin/runironic-inspector -e "PROVISIONING_IP=127.0.0.1" $IMAGE
--entrypoint /bin/runironic-inspector -e "PROVISIONING_IP=127.0.0.1" \
-e "USE_IRONIC_INSPECTOR=true" $IMAGE

for attempt in {1..30}; do
sleep 2
Expand Down
4 changes: 2 additions & 2 deletions ironic/resource_ironic_node_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func resourceNodeV1() *schema.Resource {
"driver_info": {
Type: schema.TypeMap,
Optional: true,
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
DiffSuppressFunc: func(k, old, _ string, _ *schema.ResourceData) bool {
/* FIXME: Password updates aren't considered. How can I know if the *local* data changed? */
/* FIXME: Support drivers other than IPMI */
if k == "driver_info.ipmi_password" && old == "******" {
Expand Down Expand Up @@ -168,7 +168,7 @@ func resourceNodeV1() *schema.Resource {
Optional: true,

// If power_state is same as target_power_state, we have no changes to apply
DiffSuppressFunc: func(_, old, new string, d *schema.ResourceData) bool {
DiffSuppressFunc: func(_, _, new string, d *schema.ResourceData) bool {
return new == d.Get("power_state").(string)
},
},
Expand Down
4 changes: 2 additions & 2 deletions ironic/resource_ironic_port_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ func resourcePortV1Read(d *schema.ResourceData, meta interface{}) error {
return d.Set("is_smart_nic", port.IsSmartNIC)
}

func resourcePortV1Update(d *schema.ResourceData, meta interface{}) error {
func resourcePortV1Update(_ *schema.ResourceData, _ interface{}) error {
return nil

}

func resourcePortV1Delete(d *schema.ResourceData, meta interface{}) error {
func resourcePortV1Delete(_ *schema.ResourceData, _ interface{}) error {
return nil

}
Expand Down

0 comments on commit 8a5e7ee

Please sign in to comment.