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

[th/hack-scripts-cleanup] cleanup hack scripts #194

Merged
merged 3 commits into from
Nov 5, 2024

Conversation

thom311
Copy link
Contributor

@thom311 thom311 commented Oct 25, 2024

  • hack: make scripts executable and add shebang
  • hack: use "set -e" to fail scripts on error
  • Makefile: directly call scripts instead of using variables

@openshift-ci openshift-ci bot requested review from SalDaniele and vrindle October 25, 2024 07:18
Copy link

openshift-ci bot commented Oct 25, 2024

Hi @thom311. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 25, 2024
@SalDaniele
Copy link
Contributor

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 25, 2024
@openshift-ci-robot
Copy link

/test remaining-required

@SalDaniele
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 25, 2024
hack/prepare.sh Outdated Show resolved Hide resolved
@SalDaniele
Copy link
Contributor

/approve

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 1, 2024
Copy link

openshift-ci bot commented Nov 1, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: SalDaniele, thom311

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 1, 2024
@thom311 thom311 force-pushed the th/hack-scripts-cleanup branch from cf4849e to 0d65690 Compare November 4, 2024 08:42
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Nov 4, 2024
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 4, 2024
@SalDaniele
Copy link
Contributor

/retest

@SalDaniele
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 4, 2024
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 3dfc39d and 2 for PR HEAD 0d65690 in total

It's error prone when scripts don't check for the success of their
commands. Don't do that, use `set -e`.

If you find that a step in the scripts can fail for valid reasons and
you don't want that to abort the script, then catch the exit code (for
example with `|| true`).
These variables serve no purpose as they are only used once. Drop them,
and call the scripts directly.

This also fixes some of the unnecessary inconsistencies like

  PREPARE_SCRIPT = hack/prepare.sh
  MAKE_E2E_FAST = hack/deploy_fast.sh

  prepare-e2e-test:
      bash $(PREPARE_SCRIPT)
  fast_e2e_test: prepare-e2e-test
      bash $(MAKE_E2E_FAST)

where the variable names, the script names and the Make targets have no
obvious resemblance (with the change, the Make targets are still
inconsistent with the underlying scripts).

Also, the scripts are executable and have a shebang. They choose their
interpreter themselves and the Makefile should not assume that this is
always "bash".
@thom311 thom311 force-pushed the th/hack-scripts-cleanup branch from 0d65690 to 3f88263 Compare November 4, 2024 16:41
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Nov 4, 2024
@SalDaniele
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 4, 2024
@openshift-ci-robot
Copy link

/test remaining-required

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD e6b5261 and 2 for PR HEAD 3f88263 in total

Copy link

openshift-ci bot commented Nov 5, 2024

@thom311: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit e58a9c9 into openshift:main Nov 5, 2024
9 checks passed
@openshift-bot
Copy link

[ART PR BUILD NOTIFIER]

Distgit: dpu-cni
This PR has been included in build dpu-cni-container-v4.18.0-202411050638.p0.ge58a9c9.assembly.stream.el9.
All builds following this will include this PR.

@openshift-bot
Copy link

[ART PR BUILD NOTIFIER]

Distgit: dpu-operator
This PR has been included in build dpu-operator-container-v4.18.0-202411050638.p0.ge58a9c9.assembly.stream.el9.
All builds following this will include this PR.

@openshift-bot
Copy link

[ART PR BUILD NOTIFIER]

Distgit: dpu-daemon
This PR has been included in build dpu-daemon-container-v4.18.0-202411050638.p0.ge58a9c9.assembly.stream.el9.
All builds following this will include this PR.

@thom311 thom311 deleted the th/hack-scripts-cleanup branch November 5, 2024 08:38
thom311 added a commit to thom311/dpu-operator that referenced this pull request Nov 5, 2024
We have multiple go.mod files, this does not seem to agree with operator-sdk.
operator-sdk will generate files and call `make generate`. However, that will then
fail because we didn't call `go mod tidy` for api/ directory.

Note that compared to sriov-network-operator, in dpu-operator we have
several go.mod files. That does not seem to agree with operator-sdk, or
at least, something is not hooked up right.

Hack `make generate` to call `go mod tidy` first.

Otherwise:

  $ git checkout -B C origin/main && \
    git reset --hard HEAD && \
    git clean -fdx && \
    make operator-sdk && \
    ./bin/operator-sdk create webhook --group config --version v1 --kind DpuOperatorConfig --defaulting --programmatic-validation
  branch 'C' set up to track 'origin/main'.
  Reset branch 'C'
  Your branch is up to date with 'origin/main'.
  HEAD is now at e58a9c9 Merge pull request openshift#194 from thom311/th/hack-scripts-cleanup
  INFO[0000] Writing kustomize manifests for you to edit...
  ERRO[0000] Unable to find the target #- path: manager_webhook_patch.yaml to uncomment in the file config/default/kustomization.yaml.
  INFO[0000] Writing scaffold for you to edit...
  INFO[0000] api/v1/dpuoperatorconfig_webhook.go
  INFO[0000] api/v1/dpuoperatorconfig_webhook_test.go
  INFO[0000] api/v1/webhook_suite_test.go
  INFO[0000] Update dependencies:
  $ go mod tidy
  INFO[0000] Running make:
  $ make generate
  test -s /data/src/dpu-operator/bin/controller-gen && /data/src/dpu-operator/bin/controller-gen --version | grep -q v0.15.0 || \
  GOBIN=/data/src/dpu-operator/bin GOFLAGS='' go install sigs.k8s.io/controller-tools/cmd/[email protected]
  GOFLAGS='' /data/src/dpu-operator/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
  Error: load packages in root "/data/src/dpu-operator/api": err: exit status 1: stderr: go: updates to go.mod needed; to update it:
          go mod tidy
thom311 added a commit to thom311/dpu-operator that referenced this pull request Nov 5, 2024
We have multiple go.mod files, this does not seem to agree with operator-sdk.
operator-sdk will generate files and call `make generate`. However, that will then
fail because we didn't call `go mod tidy` for api/ directory.

Note that compared to sriov-network-operator, in dpu-operator we have
several go.mod files. That does not seem to agree with operator-sdk, or
at least, something is not hooked up right.

Hack `make generate` to call `go mod tidy` first.

Otherwise:

  $ git checkout -B C origin/main && \
    git reset --hard HEAD && \
    git clean -fdx && \
    make operator-sdk && \
    ./bin/operator-sdk create webhook --group config --version v1 --kind DpuOperatorConfig --defaulting --programmatic-validation
  branch 'C' set up to track 'origin/main'.
  Reset branch 'C'
  Your branch is up to date with 'origin/main'.
  HEAD is now at e58a9c9 Merge pull request openshift#194 from thom311/th/hack-scripts-cleanup
  INFO[0000] Writing kustomize manifests for you to edit...
  ERRO[0000] Unable to find the target #- path: manager_webhook_patch.yaml to uncomment in the file config/default/kustomization.yaml.
  INFO[0000] Writing scaffold for you to edit...
  INFO[0000] api/v1/dpuoperatorconfig_webhook.go
  INFO[0000] api/v1/dpuoperatorconfig_webhook_test.go
  INFO[0000] api/v1/webhook_suite_test.go
  INFO[0000] Update dependencies:
  $ go mod tidy
  INFO[0000] Running make:
  $ make generate
  test -s /data/src/dpu-operator/bin/controller-gen && /data/src/dpu-operator/bin/controller-gen --version | grep -q v0.15.0 || \
  GOBIN=/data/src/dpu-operator/bin GOFLAGS='' go install sigs.k8s.io/controller-tools/cmd/[email protected]
  GOFLAGS='' /data/src/dpu-operator/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
  Error: load packages in root "/data/src/dpu-operator/api": err: exit status 1: stderr: go: updates to go.mod needed; to update it:
          go mod tidy
thom311 added a commit to thom311/dpu-operator that referenced this pull request Nov 5, 2024
We have multiple go.mod files, this does not seem to agree with operator-sdk.
operator-sdk will generate files and call `make generate`. However, that will then
fail because we didn't call `go mod tidy` for api/ directory.

Note that compared to sriov-network-operator, in dpu-operator we have
several go.mod files. That does not seem to agree with operator-sdk, or
at least, something is not hooked up right.

Hack `make generate` to call `go mod tidy` first.

Otherwise:

  $ git checkout -B C origin/main && \
    git reset --hard HEAD && \
    git clean -fdx && \
    make operator-sdk && \
    ./bin/operator-sdk create webhook --group config --version v1 --kind DpuOperatorConfig --defaulting --programmatic-validation
  branch 'C' set up to track 'origin/main'.
  Reset branch 'C'
  Your branch is up to date with 'origin/main'.
  HEAD is now at e58a9c9 Merge pull request openshift#194 from thom311/th/hack-scripts-cleanup
  INFO[0000] Writing kustomize manifests for you to edit...
  ERRO[0000] Unable to find the target #- path: manager_webhook_patch.yaml to uncomment in the file config/default/kustomization.yaml.
  INFO[0000] Writing scaffold for you to edit...
  INFO[0000] api/v1/dpuoperatorconfig_webhook.go
  INFO[0000] api/v1/dpuoperatorconfig_webhook_test.go
  INFO[0000] api/v1/webhook_suite_test.go
  INFO[0000] Update dependencies:
  $ go mod tidy
  INFO[0000] Running make:
  $ make generate
  test -s /data/src/dpu-operator/bin/controller-gen && /data/src/dpu-operator/bin/controller-gen --version | grep -q v0.15.0 || \
  GOBIN=/data/src/dpu-operator/bin GOFLAGS='' go install sigs.k8s.io/controller-tools/cmd/[email protected]
  GOFLAGS='' /data/src/dpu-operator/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
  Error: load packages in root "/data/src/dpu-operator/api": err: exit status 1: stderr: go: updates to go.mod needed; to update it:
          go mod tidy
thom311 added a commit to thom311/dpu-operator that referenced this pull request Nov 5, 2024
We have multiple go.mod files, this does not seem to agree with operator-sdk.
operator-sdk will generate files and call `make generate`. However, that will then
fail because we didn't call `go mod tidy` for api/ directory.

Note that compared to sriov-network-operator, in dpu-operator we have
several go.mod files. That does not seem to agree with operator-sdk, or
at least, something is not hooked up right.

Hack `make generate` to call `go mod tidy` first.

Otherwise:

  $ git checkout -B C origin/main && \
    git reset --hard HEAD && \
    git clean -fdx && \
    make operator-sdk && \
    ./bin/operator-sdk create webhook --group config --version v1 --kind DpuOperatorConfig --defaulting --programmatic-validation
  branch 'C' set up to track 'origin/main'.
  Reset branch 'C'
  Your branch is up to date with 'origin/main'.
  HEAD is now at e58a9c9 Merge pull request openshift#194 from thom311/th/hack-scripts-cleanup
  INFO[0000] Writing kustomize manifests for you to edit...
  ERRO[0000] Unable to find the target #- path: manager_webhook_patch.yaml to uncomment in the file config/default/kustomization.yaml.
  INFO[0000] Writing scaffold for you to edit...
  INFO[0000] api/v1/dpuoperatorconfig_webhook.go
  INFO[0000] api/v1/dpuoperatorconfig_webhook_test.go
  INFO[0000] api/v1/webhook_suite_test.go
  INFO[0000] Update dependencies:
  $ go mod tidy
  INFO[0000] Running make:
  $ make generate
  test -s /data/src/dpu-operator/bin/controller-gen && /data/src/dpu-operator/bin/controller-gen --version | grep -q v0.15.0 || \
  GOBIN=/data/src/dpu-operator/bin GOFLAGS='' go install sigs.k8s.io/controller-tools/cmd/[email protected]
  GOFLAGS='' /data/src/dpu-operator/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
  Error: load packages in root "/data/src/dpu-operator/api": err: exit status 1: stderr: go: updates to go.mod needed; to update it:
          go mod tidy
thom311 added a commit to thom311/dpu-operator that referenced this pull request Nov 5, 2024
We have multiple go.mod files, this does not seem to agree with operator-sdk.
operator-sdk will generate files and call `make generate`. However, that will then
fail because we didn't call `go mod tidy` for api/ directory.

Note that compared to sriov-network-operator, in dpu-operator we have
several go.mod files. That does not seem to agree with operator-sdk, or
at least, something is not hooked up right.

Hack `make generate` to call `go mod tidy` first.

Otherwise:

  $ git checkout -B C origin/main && \
    git reset --hard HEAD && \
    git clean -fdx && \
    make operator-sdk && \
    ./bin/operator-sdk create webhook --group config --version v1 --kind DpuOperatorConfig --defaulting --programmatic-validation
  branch 'C' set up to track 'origin/main'.
  Reset branch 'C'
  Your branch is up to date with 'origin/main'.
  HEAD is now at e58a9c9 Merge pull request openshift#194 from thom311/th/hack-scripts-cleanup
  INFO[0000] Writing kustomize manifests for you to edit...
  ERRO[0000] Unable to find the target #- path: manager_webhook_patch.yaml to uncomment in the file config/default/kustomization.yaml.
  INFO[0000] Writing scaffold for you to edit...
  INFO[0000] api/v1/dpuoperatorconfig_webhook.go
  INFO[0000] api/v1/dpuoperatorconfig_webhook_test.go
  INFO[0000] api/v1/webhook_suite_test.go
  INFO[0000] Update dependencies:
  $ go mod tidy
  INFO[0000] Running make:
  $ make generate
  test -s /data/src/dpu-operator/bin/controller-gen && /data/src/dpu-operator/bin/controller-gen --version | grep -q v0.15.0 || \
  GOBIN=/data/src/dpu-operator/bin GOFLAGS='' go install sigs.k8s.io/controller-tools/cmd/[email protected]
  GOFLAGS='' /data/src/dpu-operator/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
  Error: load packages in root "/data/src/dpu-operator/api": err: exit status 1: stderr: go: updates to go.mod needed; to update it:
          go mod tidy
thom311 added a commit to thom311/dpu-operator that referenced this pull request Nov 5, 2024
We have multiple go.mod files, this does not seem to agree with operator-sdk.
operator-sdk will generate files and call `make generate`. However, that will then
fail because we didn't call `go mod tidy` for api/ directory.

Note that compared to sriov-network-operator, in dpu-operator we have
several go.mod files. That does not seem to agree with operator-sdk, or
at least, something is not hooked up right.

Hack `make generate` to call `go mod tidy` first.

Otherwise:

  $ git checkout -B C origin/main && \
    git reset --hard HEAD && \
    git clean -fdx && \
    make operator-sdk && \
    ./bin/operator-sdk create webhook --group config --version v1 --kind DpuOperatorConfig --defaulting --programmatic-validation
  branch 'C' set up to track 'origin/main'.
  Reset branch 'C'
  Your branch is up to date with 'origin/main'.
  HEAD is now at e58a9c9 Merge pull request openshift#194 from thom311/th/hack-scripts-cleanup
  INFO[0000] Writing kustomize manifests for you to edit...
  ERRO[0000] Unable to find the target #- path: manager_webhook_patch.yaml to uncomment in the file config/default/kustomization.yaml.
  INFO[0000] Writing scaffold for you to edit...
  INFO[0000] api/v1/dpuoperatorconfig_webhook.go
  INFO[0000] api/v1/dpuoperatorconfig_webhook_test.go
  INFO[0000] api/v1/webhook_suite_test.go
  INFO[0000] Update dependencies:
  $ go mod tidy
  INFO[0000] Running make:
  $ make generate
  test -s /data/src/dpu-operator/bin/controller-gen && /data/src/dpu-operator/bin/controller-gen --version | grep -q v0.15.0 || \
  GOBIN=/data/src/dpu-operator/bin GOFLAGS='' go install sigs.k8s.io/controller-tools/cmd/[email protected]
  GOFLAGS='' /data/src/dpu-operator/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
  Error: load packages in root "/data/src/dpu-operator/api": err: exit status 1: stderr: go: updates to go.mod needed; to update it:
          go mod tidy
thom311 added a commit to thom311/dpu-operator that referenced this pull request Nov 12, 2024
We have multiple go.mod files, this does not seem to agree with operator-sdk.
operator-sdk will generate files and call `make generate`. However, that will then
fail because we didn't call `go mod tidy` for api/ directory.

Note that compared to sriov-network-operator, in dpu-operator we have
several go.mod files. That does not seem to agree with operator-sdk, or
at least, something is not hooked up right.

Hack `make generate` to call `go mod tidy` first.

Otherwise:

  $ git checkout -B C origin/main && \
    git reset --hard HEAD && \
    git clean -fdx && \
    make operator-sdk && \
    ./bin/operator-sdk create webhook --group config --version v1 --kind DpuOperatorConfig --defaulting --programmatic-validation
  branch 'C' set up to track 'origin/main'.
  Reset branch 'C'
  Your branch is up to date with 'origin/main'.
  HEAD is now at e58a9c9 Merge pull request openshift#194 from thom311/th/hack-scripts-cleanup
  INFO[0000] Writing kustomize manifests for you to edit...
  ERRO[0000] Unable to find the target #- path: manager_webhook_patch.yaml to uncomment in the file config/default/kustomization.yaml.
  INFO[0000] Writing scaffold for you to edit...
  INFO[0000] api/v1/dpuoperatorconfig_webhook.go
  INFO[0000] api/v1/dpuoperatorconfig_webhook_test.go
  INFO[0000] api/v1/webhook_suite_test.go
  INFO[0000] Update dependencies:
  $ go mod tidy
  INFO[0000] Running make:
  $ make generate
  test -s /data/src/dpu-operator/bin/controller-gen && /data/src/dpu-operator/bin/controller-gen --version | grep -q v0.15.0 || \
  GOBIN=/data/src/dpu-operator/bin GOFLAGS='' go install sigs.k8s.io/controller-tools/cmd/[email protected]
  GOFLAGS='' /data/src/dpu-operator/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
  Error: load packages in root "/data/src/dpu-operator/api": err: exit status 1: stderr: go: updates to go.mod needed; to update it:
          go mod tidy
thom311 added a commit to thom311/dpu-operator that referenced this pull request Nov 18, 2024
We have multiple go.mod files, this does not seem to agree with operator-sdk.
operator-sdk will generate files and call `make generate`. However, that will then
fail because we didn't call `go mod tidy` for api/ directory.

Note that compared to sriov-network-operator, in dpu-operator we have
several go.mod files. That does not seem to agree with operator-sdk, or
at least, something is not hooked up right.

Hack `make generate` to call `go mod tidy` first.

Otherwise:

  $ git checkout -B C origin/main && \
    git reset --hard HEAD && \
    git clean -fdx && \
    make operator-sdk && \
    ./bin/operator-sdk create webhook --group config --version v1 --kind DpuOperatorConfig --defaulting --programmatic-validation
  branch 'C' set up to track 'origin/main'.
  Reset branch 'C'
  Your branch is up to date with 'origin/main'.
  HEAD is now at e58a9c9 Merge pull request openshift#194 from thom311/th/hack-scripts-cleanup
  INFO[0000] Writing kustomize manifests for you to edit...
  ERRO[0000] Unable to find the target #- path: manager_webhook_patch.yaml to uncomment in the file config/default/kustomization.yaml.
  INFO[0000] Writing scaffold for you to edit...
  INFO[0000] api/v1/dpuoperatorconfig_webhook.go
  INFO[0000] api/v1/dpuoperatorconfig_webhook_test.go
  INFO[0000] api/v1/webhook_suite_test.go
  INFO[0000] Update dependencies:
  $ go mod tidy
  INFO[0000] Running make:
  $ make generate
  test -s /data/src/dpu-operator/bin/controller-gen && /data/src/dpu-operator/bin/controller-gen --version | grep -q v0.15.0 || \
  GOBIN=/data/src/dpu-operator/bin GOFLAGS='' go install sigs.k8s.io/controller-tools/cmd/[email protected]
  GOFLAGS='' /data/src/dpu-operator/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
  Error: load packages in root "/data/src/dpu-operator/api": err: exit status 1: stderr: go: updates to go.mod needed; to update it:
          go mod tidy
thom311 added a commit to thom311/dpu-operator that referenced this pull request Nov 18, 2024
We have multiple go.mod files, this does not seem to agree with operator-sdk.
operator-sdk will generate files and call `make generate`. However, that will then
fail because we didn't call `go mod tidy` for api/ directory.

Hack `make generate` to call `go mod tidy` first.

Otherwise:

  $ git checkout -B C origin/main && \
    git reset --hard HEAD && \
    git clean -fdx && \
    make operator-sdk && \
    ./bin/operator-sdk create webhook --group config --version v1 --kind DpuOperatorConfig --defaulting --programmatic-validation
  branch 'C' set up to track 'origin/main'.
  Reset branch 'C'
  Your branch is up to date with 'origin/main'.
  HEAD is now at e58a9c9 Merge pull request openshift#194 from thom311/th/hack-scripts-cleanup
  INFO[0000] Writing kustomize manifests for you to edit...
  ERRO[0000] Unable to find the target #- path: manager_webhook_patch.yaml to uncomment in the file config/default/kustomization.yaml.
  INFO[0000] Writing scaffold for you to edit...
  INFO[0000] api/v1/dpuoperatorconfig_webhook.go
  INFO[0000] api/v1/dpuoperatorconfig_webhook_test.go
  INFO[0000] api/v1/webhook_suite_test.go
  INFO[0000] Update dependencies:
  $ go mod tidy
  INFO[0000] Running make:
  $ make generate
  test -s /data/src/dpu-operator/bin/controller-gen && /data/src/dpu-operator/bin/controller-gen --version | grep -q v0.15.0 || \
  GOBIN=/data/src/dpu-operator/bin GOFLAGS='' go install sigs.k8s.io/controller-tools/cmd/[email protected]
  GOFLAGS='' /data/src/dpu-operator/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
  Error: load packages in root "/data/src/dpu-operator/api": err: exit status 1: stderr: go: updates to go.mod needed; to update it:
          go mod tidy
thom311 added a commit to thom311/dpu-operator that referenced this pull request Nov 21, 2024
We have multiple go.mod files, this does not seem to agree with operator-sdk.
operator-sdk will generate files and call `make generate`. However, that will then
fail because we didn't call `go mod tidy` for api/ directory.

Hack `make generate` to call `go mod tidy` first.

We will do this now, then run operator-sdk, and then revert this change
again. It will be reverted, because we don't want this behavior usually.
Usually, we want to separate "generate" from "vendor".

Otherwise:

  $ git checkout -B C origin/main && \
    git reset --hard HEAD && \
    git clean -fdx && \
    make operator-sdk && \
    ./bin/operator-sdk create webhook --group config --version v1 --kind DpuOperatorConfig --defaulting --programmatic-validation
  branch 'C' set up to track 'origin/main'.
  Reset branch 'C'
  Your branch is up to date with 'origin/main'.
  HEAD is now at e58a9c9 Merge pull request openshift#194 from thom311/th/hack-scripts-cleanup
  INFO[0000] Writing kustomize manifests for you to edit...
  ERRO[0000] Unable to find the target #- path: manager_webhook_patch.yaml to uncomment in the file config/default/kustomization.yaml.
  INFO[0000] Writing scaffold for you to edit...
  INFO[0000] api/v1/dpuoperatorconfig_webhook.go
  INFO[0000] api/v1/dpuoperatorconfig_webhook_test.go
  INFO[0000] api/v1/webhook_suite_test.go
  INFO[0000] Update dependencies:
  $ go mod tidy
  INFO[0000] Running make:
  $ make generate
  test -s /data/src/dpu-operator/bin/controller-gen && /data/src/dpu-operator/bin/controller-gen --version | grep -q v0.15.0 || \
  GOBIN=/data/src/dpu-operator/bin GOFLAGS='' go install sigs.k8s.io/controller-tools/cmd/[email protected]
  GOFLAGS='' /data/src/dpu-operator/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
  Error: load packages in root "/data/src/dpu-operator/api": err: exit status 1: stderr: go: updates to go.mod needed; to update it:
          go mod tidy
thom311 added a commit to thom311/dpu-operator that referenced this pull request Nov 21, 2024
We have multiple go.mod files, this does not seem to agree with operator-sdk.
operator-sdk will generate files and call `make generate`. However, that will then
fail because we didn't call `go mod tidy` for api/ directory.

Hack `make generate` to call `go mod tidy` first.

We will do this now, then run operator-sdk, and then revert this change
again. It will be reverted, because we don't want this behavior usually.
Usually, we want to separate "generate" from "vendor".

Otherwise:

  $ git checkout -B C origin/main && \
    git reset --hard HEAD && \
    git clean -fdx && \
    make operator-sdk && \
    ./bin/operator-sdk create webhook --group config --version v1 --kind DpuOperatorConfig --defaulting --programmatic-validation
  branch 'C' set up to track 'origin/main'.
  Reset branch 'C'
  Your branch is up to date with 'origin/main'.
  HEAD is now at e58a9c9 Merge pull request openshift#194 from thom311/th/hack-scripts-cleanup
  INFO[0000] Writing kustomize manifests for you to edit...
  ERRO[0000] Unable to find the target #- path: manager_webhook_patch.yaml to uncomment in the file config/default/kustomization.yaml.
  INFO[0000] Writing scaffold for you to edit...
  INFO[0000] api/v1/dpuoperatorconfig_webhook.go
  INFO[0000] api/v1/dpuoperatorconfig_webhook_test.go
  INFO[0000] api/v1/webhook_suite_test.go
  INFO[0000] Update dependencies:
  $ go mod tidy
  INFO[0000] Running make:
  $ make generate
  test -s /data/src/dpu-operator/bin/controller-gen && /data/src/dpu-operator/bin/controller-gen --version | grep -q v0.15.0 || \
  GOBIN=/data/src/dpu-operator/bin GOFLAGS='' go install sigs.k8s.io/controller-tools/cmd/[email protected]
  GOFLAGS='' /data/src/dpu-operator/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
  Error: load packages in root "/data/src/dpu-operator/api": err: exit status 1: stderr: go: updates to go.mod needed; to update it:
          go mod tidy
thom311 added a commit to thom311/dpu-operator that referenced this pull request Nov 27, 2024
We have multiple go.mod files, this does not seem to agree with operator-sdk.
operator-sdk will generate files and call `make generate`. However, that will then
fail because we didn't call `go mod tidy` for api/ directory.

Hack `make generate` to call `go mod tidy` first.

We will do this now, then run operator-sdk, and then revert this change
again. It will be reverted, because we don't want this behavior usually.
Usually, we want to separate "generate" from "vendor".

Otherwise:

  $ git checkout -B C origin/main && \
    git reset --hard HEAD && \
    git clean -fdx && \
    make operator-sdk && \
    ./bin/operator-sdk create webhook --group config --version v1 --kind DpuOperatorConfig --defaulting --programmatic-validation
  branch 'C' set up to track 'origin/main'.
  Reset branch 'C'
  Your branch is up to date with 'origin/main'.
  HEAD is now at e58a9c9 Merge pull request openshift#194 from thom311/th/hack-scripts-cleanup
  INFO[0000] Writing kustomize manifests for you to edit...
  ERRO[0000] Unable to find the target #- path: manager_webhook_patch.yaml to uncomment in the file config/default/kustomization.yaml.
  INFO[0000] Writing scaffold for you to edit...
  INFO[0000] api/v1/dpuoperatorconfig_webhook.go
  INFO[0000] api/v1/dpuoperatorconfig_webhook_test.go
  INFO[0000] api/v1/webhook_suite_test.go
  INFO[0000] Update dependencies:
  $ go mod tidy
  INFO[0000] Running make:
  $ make generate
  test -s /data/src/dpu-operator/bin/controller-gen && /data/src/dpu-operator/bin/controller-gen --version | grep -q v0.15.0 || \
  GOBIN=/data/src/dpu-operator/bin GOFLAGS='' go install sigs.k8s.io/controller-tools/cmd/[email protected]
  GOFLAGS='' /data/src/dpu-operator/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
  Error: load packages in root "/data/src/dpu-operator/api": err: exit status 1: stderr: go: updates to go.mod needed; to update it:
          go mod tidy
thom311 added a commit to thom311/dpu-operator that referenced this pull request Dec 2, 2024
We have multiple go.mod files, this does not seem to agree with operator-sdk.
operator-sdk will generate files and call `make generate`. However, that will then
fail because we didn't call `go mod tidy` for api/ directory.

Hack `make generate` to call `go mod tidy` first.

We will do this now, then run operator-sdk, and then revert this change
again. It will be reverted, because we don't want this behavior usually.
Usually, we want to separate "generate" from "vendor".

Otherwise:

  $ git checkout -B C origin/main && \
    git reset --hard HEAD && \
    git clean -fdx && \
    make operator-sdk && \
    ./bin/operator-sdk create webhook --group config --version v1 --kind DpuOperatorConfig --defaulting --programmatic-validation
  branch 'C' set up to track 'origin/main'.
  Reset branch 'C'
  Your branch is up to date with 'origin/main'.
  HEAD is now at e58a9c9 Merge pull request openshift#194 from thom311/th/hack-scripts-cleanup
  INFO[0000] Writing kustomize manifests for you to edit...
  ERRO[0000] Unable to find the target #- path: manager_webhook_patch.yaml to uncomment in the file config/default/kustomization.yaml.
  INFO[0000] Writing scaffold for you to edit...
  INFO[0000] api/v1/dpuoperatorconfig_webhook.go
  INFO[0000] api/v1/dpuoperatorconfig_webhook_test.go
  INFO[0000] api/v1/webhook_suite_test.go
  INFO[0000] Update dependencies:
  $ go mod tidy
  INFO[0000] Running make:
  $ make generate
  test -s /data/src/dpu-operator/bin/controller-gen && /data/src/dpu-operator/bin/controller-gen --version | grep -q v0.15.0 || \
  GOBIN=/data/src/dpu-operator/bin GOFLAGS='' go install sigs.k8s.io/controller-tools/cmd/[email protected]
  GOFLAGS='' /data/src/dpu-operator/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
  Error: load packages in root "/data/src/dpu-operator/api": err: exit status 1: stderr: go: updates to go.mod needed; to update it:
          go mod tidy
thom311 added a commit to thom311/dpu-operator that referenced this pull request Dec 23, 2024
We have multiple go.mod files, this does not seem to agree with operator-sdk.
operator-sdk will generate files and call `make generate`. However, that will then
fail because we didn't call `go mod tidy` for api/ directory.

Hack `make generate` to call `go mod tidy` first.

We will do this now, then run operator-sdk, and then revert this change
again. It will be reverted, because we don't want this behavior usually.
Usually, we want to separate "generate" from "vendor".

Otherwise:

  $ git checkout -B C origin/main && \
    git reset --hard HEAD && \
    git clean -fdx && \
    make operator-sdk && \
    ./bin/operator-sdk create webhook --group config --version v1 --kind DpuOperatorConfig --defaulting --programmatic-validation
  branch 'C' set up to track 'origin/main'.
  Reset branch 'C'
  Your branch is up to date with 'origin/main'.
  HEAD is now at e58a9c9 Merge pull request openshift#194 from thom311/th/hack-scripts-cleanup
  INFO[0000] Writing kustomize manifests for you to edit...
  ERRO[0000] Unable to find the target #- path: manager_webhook_patch.yaml to uncomment in the file config/default/kustomization.yaml.
  INFO[0000] Writing scaffold for you to edit...
  INFO[0000] api/v1/dpuoperatorconfig_webhook.go
  INFO[0000] api/v1/dpuoperatorconfig_webhook_test.go
  INFO[0000] api/v1/webhook_suite_test.go
  INFO[0000] Update dependencies:
  $ go mod tidy
  INFO[0000] Running make:
  $ make generate
  test -s /data/src/dpu-operator/bin/controller-gen && /data/src/dpu-operator/bin/controller-gen --version | grep -q v0.15.0 || \
  GOBIN=/data/src/dpu-operator/bin GOFLAGS='' go install sigs.k8s.io/controller-tools/cmd/[email protected]
  GOFLAGS='' /data/src/dpu-operator/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
  Error: load packages in root "/data/src/dpu-operator/api": err: exit status 1: stderr: go: updates to go.mod needed; to update it:
          go mod tidy
thom311 added a commit to thom311/dpu-operator that referenced this pull request Dec 23, 2024
We have multiple go.mod files, this does not seem to agree with operator-sdk.
operator-sdk will generate files and call `make generate`. However, that will then
fail because we didn't call `go mod tidy` for api/ directory.

Hack `make generate` to call `go mod tidy` first.

We will do this now, then run operator-sdk, and then revert this change
again. It will be reverted, because we don't want this behavior usually.
Usually, we want to separate "generate" from "vendor".

Otherwise:

  $ git checkout -B C origin/main && \
    git reset --hard HEAD && \
    git clean -fdx && \
    make operator-sdk && \
    ./bin/operator-sdk create webhook --group config --version v1 --kind DpuOperatorConfig --defaulting --programmatic-validation
  branch 'C' set up to track 'origin/main'.
  Reset branch 'C'
  Your branch is up to date with 'origin/main'.
  HEAD is now at e58a9c9 Merge pull request openshift#194 from thom311/th/hack-scripts-cleanup
  INFO[0000] Writing kustomize manifests for you to edit...
  ERRO[0000] Unable to find the target #- path: manager_webhook_patch.yaml to uncomment in the file config/default/kustomization.yaml.
  INFO[0000] Writing scaffold for you to edit...
  INFO[0000] api/v1/dpuoperatorconfig_webhook.go
  INFO[0000] api/v1/dpuoperatorconfig_webhook_test.go
  INFO[0000] api/v1/webhook_suite_test.go
  INFO[0000] Update dependencies:
  $ go mod tidy
  INFO[0000] Running make:
  $ make generate
  test -s /data/src/dpu-operator/bin/controller-gen && /data/src/dpu-operator/bin/controller-gen --version | grep -q v0.15.0 || \
  GOBIN=/data/src/dpu-operator/bin GOFLAGS='' go install sigs.k8s.io/controller-tools/cmd/[email protected]
  GOFLAGS='' /data/src/dpu-operator/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
  Error: load packages in root "/data/src/dpu-operator/api": err: exit status 1: stderr: go: updates to go.mod needed; to update it:
          go mod tidy
thom311 added a commit to thom311/dpu-operator that referenced this pull request Jan 7, 2025
We have multiple go.mod files, this does not seem to agree with operator-sdk.
operator-sdk will generate files and call `make generate`. However, that will then
fail because we didn't call `go mod tidy` for api/ directory.

Hack `make generate` to call `go mod tidy` first.

We will do this now, then run operator-sdk, and then revert this change
again. It will be reverted, because we don't want this behavior usually.
Usually, we want to separate "generate" from "vendor".

Otherwise:

  $ git checkout -B C origin/main && \
    git reset --hard HEAD && \
    git clean -fdx && \
    make operator-sdk && \
    ./bin/operator-sdk create webhook --group config --version v1 --kind DpuOperatorConfig --defaulting --programmatic-validation
  branch 'C' set up to track 'origin/main'.
  Reset branch 'C'
  Your branch is up to date with 'origin/main'.
  HEAD is now at e58a9c9 Merge pull request openshift#194 from thom311/th/hack-scripts-cleanup
  INFO[0000] Writing kustomize manifests for you to edit...
  ERRO[0000] Unable to find the target #- path: manager_webhook_patch.yaml to uncomment in the file config/default/kustomization.yaml.
  INFO[0000] Writing scaffold for you to edit...
  INFO[0000] api/v1/dpuoperatorconfig_webhook.go
  INFO[0000] api/v1/dpuoperatorconfig_webhook_test.go
  INFO[0000] api/v1/webhook_suite_test.go
  INFO[0000] Update dependencies:
  $ go mod tidy
  INFO[0000] Running make:
  $ make generate
  test -s /data/src/dpu-operator/bin/controller-gen && /data/src/dpu-operator/bin/controller-gen --version | grep -q v0.15.0 || \
  GOBIN=/data/src/dpu-operator/bin GOFLAGS='' go install sigs.k8s.io/controller-tools/cmd/[email protected]
  GOFLAGS='' /data/src/dpu-operator/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
  Error: load packages in root "/data/src/dpu-operator/api": err: exit status 1: stderr: go: updates to go.mod needed; to update it:
          go mod tidy
thom311 added a commit to thom311/dpu-operator that referenced this pull request Jan 13, 2025
We have multiple go.mod files, this does not seem to agree with operator-sdk.
operator-sdk will generate files and call `make generate`. However, that will then
fail because we didn't call `go mod tidy` for api/ directory.

Hack `make generate` to call `go mod tidy` first.

We will do this now, then run operator-sdk, and then revert this change
again. It will be reverted, because we don't want this behavior usually.
Usually, we want to separate "generate" from "vendor".

Otherwise:

  $ git checkout -B C origin/main && \
    git reset --hard HEAD && \
    git clean -fdx && \
    make operator-sdk && \
    ./bin/operator-sdk create webhook --group config --version v1 --kind DpuOperatorConfig --defaulting --programmatic-validation
  branch 'C' set up to track 'origin/main'.
  Reset branch 'C'
  Your branch is up to date with 'origin/main'.
  HEAD is now at e58a9c9 Merge pull request openshift#194 from thom311/th/hack-scripts-cleanup
  INFO[0000] Writing kustomize manifests for you to edit...
  ERRO[0000] Unable to find the target #- path: manager_webhook_patch.yaml to uncomment in the file config/default/kustomization.yaml.
  INFO[0000] Writing scaffold for you to edit...
  INFO[0000] api/v1/dpuoperatorconfig_webhook.go
  INFO[0000] api/v1/dpuoperatorconfig_webhook_test.go
  INFO[0000] api/v1/webhook_suite_test.go
  INFO[0000] Update dependencies:
  $ go mod tidy
  INFO[0000] Running make:
  $ make generate
  test -s /data/src/dpu-operator/bin/controller-gen && /data/src/dpu-operator/bin/controller-gen --version | grep -q v0.15.0 || \
  GOBIN=/data/src/dpu-operator/bin GOFLAGS='' go install sigs.k8s.io/controller-tools/cmd/[email protected]
  GOFLAGS='' /data/src/dpu-operator/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
  Error: load packages in root "/data/src/dpu-operator/api": err: exit status 1: stderr: go: updates to go.mod needed; to update it:
          go mod tidy
thom311 added a commit to thom311/dpu-operator that referenced this pull request Jan 24, 2025
We have multiple go.mod files, this does not seem to agree with operator-sdk.
operator-sdk will generate files and call `make generate`. However, that will then
fail because we didn't call `go mod tidy` for api/ directory.

Hack `make generate` to call `go mod tidy` first.

We will do this now, then run operator-sdk, and then revert this change
again. It will be reverted, because we don't want this behavior usually.
Usually, we want to separate "generate" from "vendor".

Otherwise:

  $ git checkout -B C origin/main && \
    git reset --hard HEAD && \
    git clean -fdx && \
    make operator-sdk && \
    ./bin/operator-sdk create webhook --group config --version v1 --kind DpuOperatorConfig --defaulting --programmatic-validation
  branch 'C' set up to track 'origin/main'.
  Reset branch 'C'
  Your branch is up to date with 'origin/main'.
  HEAD is now at e58a9c9 Merge pull request openshift#194 from thom311/th/hack-scripts-cleanup
  INFO[0000] Writing kustomize manifests for you to edit...
  ERRO[0000] Unable to find the target #- path: manager_webhook_patch.yaml to uncomment in the file config/default/kustomization.yaml.
  INFO[0000] Writing scaffold for you to edit...
  INFO[0000] api/v1/dpuoperatorconfig_webhook.go
  INFO[0000] api/v1/dpuoperatorconfig_webhook_test.go
  INFO[0000] api/v1/webhook_suite_test.go
  INFO[0000] Update dependencies:
  $ go mod tidy
  INFO[0000] Running make:
  $ make generate
  test -s /data/src/dpu-operator/bin/controller-gen && /data/src/dpu-operator/bin/controller-gen --version | grep -q v0.15.0 || \
  GOBIN=/data/src/dpu-operator/bin GOFLAGS='' go install sigs.k8s.io/controller-tools/cmd/[email protected]
  GOFLAGS='' /data/src/dpu-operator/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
  Error: load packages in root "/data/src/dpu-operator/api": err: exit status 1: stderr: go: updates to go.mod needed; to update it:
          go mod tidy
thom311 added a commit to thom311/dpu-operator that referenced this pull request Jan 30, 2025
We have multiple go.mod files, this does not seem to agree with operator-sdk.
operator-sdk will generate files and call `make generate`. However, that will then
fail because we didn't call `go mod tidy` for api/ directory.

Hack `make generate` to call `go mod tidy` first.

We will do this now, then run operator-sdk, and then revert this change
again. It will be reverted, because we don't want this behavior usually.
Usually, we want to separate "generate" from "vendor".

Otherwise:

  $ git checkout -B C origin/main && \
    git reset --hard HEAD && \
    git clean -fdx && \
    make operator-sdk && \
    ./bin/operator-sdk create webhook --group config --version v1 --kind DpuOperatorConfig --defaulting --programmatic-validation
  branch 'C' set up to track 'origin/main'.
  Reset branch 'C'
  Your branch is up to date with 'origin/main'.
  HEAD is now at e58a9c9 Merge pull request openshift#194 from thom311/th/hack-scripts-cleanup
  INFO[0000] Writing kustomize manifests for you to edit...
  ERRO[0000] Unable to find the target #- path: manager_webhook_patch.yaml to uncomment in the file config/default/kustomization.yaml.
  INFO[0000] Writing scaffold for you to edit...
  INFO[0000] api/v1/dpuoperatorconfig_webhook.go
  INFO[0000] api/v1/dpuoperatorconfig_webhook_test.go
  INFO[0000] api/v1/webhook_suite_test.go
  INFO[0000] Update dependencies:
  $ go mod tidy
  INFO[0000] Running make:
  $ make generate
  test -s /data/src/dpu-operator/bin/controller-gen && /data/src/dpu-operator/bin/controller-gen --version | grep -q v0.15.0 || \
  GOBIN=/data/src/dpu-operator/bin GOFLAGS='' go install sigs.k8s.io/controller-tools/cmd/[email protected]
  GOFLAGS='' /data/src/dpu-operator/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
  Error: load packages in root "/data/src/dpu-operator/api": err: exit status 1: stderr: go: updates to go.mod needed; to update it:
          go mod tidy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants