Skip to content

Commit

Permalink
dev-tool: Add cfssl and cfssljson tool check
Browse files Browse the repository at this point in the history
VM provisioning with K8S=1 is failing due to missing certs, which is
caused by the unavailability of cfssl and cfssljson tools. This commit
is to add two simple checks in dev-tool to avoid any potential debugging
and troubleshooting time.

```
$ ./contrib/vagrant/scripts/00-create-certs.sh
----- 00-create-certs.sh: main: Generating certificates...
./contrib/vagrant/scripts/cert-gen-helpers.bash: line 50: cfssl: command not found
./contrib/vagrant/scripts/cert-gen-helpers.bash: line 50: cfssljson: command not found
```

Signed-off-by: Tam Mach <sayboras@yahoo.com>
  • Loading branch information
sayboras authored and pchaigno committed Jan 7, 2022
1 parent a6e9456 commit 1cbae93
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 23 deletions.
50 changes: 27 additions & 23 deletions Documentation/contributing/development/dev_setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,33 @@ Requirements
You need to have the following tools available in order to effectively
contribute to Cilium:

+--------------------------------------------------------------+------------------------------+--------------------------------------------------+
| Dependency | Version / Commit ID | Download Command |
+==============================================================+==============================+==================================================+
| git | latest | N/A (OS-specific) |
+--------------------------------------------------------------+------------------------------+--------------------------------------------------+
| clang | >= 10.0 (latest recommended) | N/A (OS-specific) |
+--------------------------------------------------------------+------------------------------+--------------------------------------------------+
| llvm | >= 10.0 (latest recommended) | N/A (OS-specific) |
+--------------------------------------------------------------+------------------------------+--------------------------------------------------+
| `go <https://golang.org/dl/>`_ | |GO_RELEASE| | N/A (OS-specific) |
+--------------------------------------------------------------+------------------------------+--------------------------------------------------+
+ `ginkgo <https://github.com/onsi/ginkgo>`__ | >= 1.4.0 | ``go get -u github.com/onsi/ginkgo/ginkgo`` |
+--------------------------------------------------------------+------------------------------+--------------------------------------------------+
+ `gomega <https://github.com/onsi/gomega>`_ | >= 1.2.0 | ``go get -u github.com/onsi/gomega`` |
+--------------------------------------------------------------+------------------------------+--------------------------------------------------+
+ `golangci-lint <https://github.com/golangci/golangci-lint>`_ | >= v1.27 | ``go get -u github.com/golangci/golangci-lint`` |
+--------------------------------------------------------------+------------------------------+--------------------------------------------------+
+ `Docker <https://docs.docker.com/engine/installation/>`_ | OS-Dependent | N/A (OS-specific) |
+--------------------------------------------------------------+------------------------------+--------------------------------------------------+
+ `Docker-Compose <https://docs.docker.com/compose/install/>`_ | OS-Dependent | N/A (OS-specific) |
+--------------------------------------------------------------+------------------------------+--------------------------------------------------+
+ python3-pip | latest | N/A (OS-specific) |
+--------------------------------------------------------------+------------------------------+--------------------------------------------------+
+--------------------------------------------------------------+------------------------------+---------------------------------------------------------+
| Dependency | Version / Commit ID | Download Command |
+==============================================================+==============================+=========================================================+
| git | latest | N/A (OS-specific) |
+--------------------------------------------------------------+------------------------------+---------------------------------------------------------+
| clang | >= 10.0 (latest recommended) | N/A (OS-specific) |
+--------------------------------------------------------------+------------------------------+---------------------------------------------------------+
| llvm | >= 10.0 (latest recommended) | N/A (OS-specific) |
+--------------------------------------------------------------+------------------------------+---------------------------------------------------------+
| `go <https://golang.org/dl/>`_ | |GO_RELEASE| | N/A (OS-specific) |
+--------------------------------------------------------------+------------------------------+---------------------------------------------------------+
+ `ginkgo <https://github.com/onsi/ginkgo>`__ | >= 1.4.0 | ``go get -u github.com/onsi/ginkgo/ginkgo`` |
+--------------------------------------------------------------+------------------------------+---------------------------------------------------------+
+ `gomega <https://github.com/onsi/gomega>`_ | >= 1.2.0 | ``go get -u github.com/onsi/gomega`` |
+--------------------------------------------------------------+------------------------------+---------------------------------------------------------+
+ `golangci-lint <https://github.com/golangci/golangci-lint>`_ | >= v1.27 | ``go get -u github.com/golangci/golangci-lint`` |
+--------------------------------------------------------------+------------------------------+---------------------------------------------------------+
+ `cfssl <https://github.com/cloudflare/cfssl>`_ | >= v1.6.0 | ``go get -u github.com/cloudflare/cfssl/cmd/cfssl`` |
+--------------------------------------------------------------+------------------------------+---------------------------------------------------------+
+ `cfssljson <https://github.com/cloudflare/cfssl>`_ | >= v1.6.0 | ``go get -u github.com/cloudflare/cfssl/cmd/cfssljson`` |
+--------------------------------------------------------------+------------------------------+---------------------------------------------------------+
+ `Docker <https://docs.docker.com/engine/installation/>`_ | OS-Dependent | N/A (OS-specific) |
+--------------------------------------------------------------+------------------------------+---------------------------------------------------------+
+ `Docker-Compose <https://docs.docker.com/compose/install/>`_ | OS-Dependent | N/A (OS-specific) |
+--------------------------------------------------------------+------------------------------+---------------------------------------------------------+
+ python3-pip | latest | N/A (OS-specific) |
+--------------------------------------------------------------+------------------------------+---------------------------------------------------------+

For `integration_testing`, you will need to run ``docker`` without privileges.
You can usually achieve this by adding your current user to the ``docker``
Expand Down
14 changes: 14 additions & 0 deletions tools/dev-doctor/rootcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,20 @@ func rootCmdRun(cmd *cobra.Command, args []string) {
versionArgs: []string{"--version"},
versionRegexp: regexp.MustCompile(`pip (\d+\.\d+\S*)`),
},
&binaryCheck{
name: "cfssl",
ifNotFound: checkWarning,
versionArgs: []string{"version"},
versionRegexp: regexp.MustCompile(`Version: (.*)`),
hint: "See https://github.com/cloudflare/cfssl#installation.",
},
&binaryCheck{
name: "cfssljson",
ifNotFound: checkWarning,
versionArgs: []string{"-version"},
versionRegexp: regexp.MustCompile(`Version: (.*)`),
hint: "See https://github.com/cloudflare/cfssl#installation.",
},
dockerGroupCheck{},
}

Expand Down

0 comments on commit 1cbae93

Please sign in to comment.