-
Notifications
You must be signed in to change notification settings - Fork 1.5k
data/bootstrap: Pull content out of pkg/asset/ignition/bootstrap #510
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
data/bootstrap: Pull content out of pkg/asset/ignition/bootstrap #510
Conversation
85543c3 to
2787e5f
Compare
2787e5f to
3434c2f
Compare
|
I don't think it's more helpful to move these template files out of the go package to terraform directory. |
Did you have complexity/performance concerns? I think this simplifies finding this content for folks who are not living in this code base. And 74f997a1a8 drops 70 lines from the repo, which is a coarse measure for "simpler" ;). |
|
@abhinavdahiya pefers the Go-literal approach. He's given a few reasons, including files like the kubelet kubeconfig which need tge same conten in multiple locations. I still prefer the /close |
We gutted the test back in openshift/installer@8ff1cee1 (hack/yaml-lint: No-op this script, 2018-09-28, openshift/installer#370). I'd left the job here in case we wanted to re-enable later, but with [1] rejected, I don't see that happening. [1]: openshift/installer#510
|
I quite liked this approach (should have kept up with my email). This gets us YAML linting, syntax highlighting, and no more of Go's poorly-designed multi-line strings. Can we reopen this? |
|
I'll let you sort this out wIth @abhinavdahiya ;). |
|
Few things i don't like about this PR
I think we want to do something like this for @rajatchopra 's manifest-template stuff but such that the asset can ask for the source of the template and then decide the destination. |
|
Ah, I agree with @abhinavdahiya's points. What I actually want is the |
Both the Go package and
Agreed. But we don't have any of those cases in this PR, and we can always use Go templates if we hit more of them in the future. Ideally, we could configure the bootstrap node so that we wouldn't need the same content present in multiple locations there either, so I don't expect there will be a ton of these cases.
Again, I don't expect a ton of these cases. Do we expect many of the bootstrap files to be platform-specific? There aren't any such files in this PR, anyway.
That's effectively what this is, right? You just use the URI into |
|
@wking Can you rebase this? I spoke with @abhinavdahiya and we want to pull this in. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The kube-dns files are not needed since #548 is merged.
3434c2f to
f45763d
Compare
|
Ok, rebased onto master with 3434c2f -> f45763d. I think I got all the upstream changes in; and Git's blame suggests I'm not adding much on my own in the hard-to-audit commit: $ find data/data/bootstrap -type f -exec git --no-pager blame -CC 775f799 {} \; | grep Trevor
775f7991 (W. Trevor King 2018-10-21 23:46:09 -0700 1) apiVersion: kubecontrolplane.config.openshift.io/v1
775f7991 (W. Trevor King 2018-10-21 23:46:09 -0700 2) kind: KubeControllerManagerConfig
775f7991 data/data/bootstrap/files/opt/tectonic/manifest-overrides/kube-proxy-daemonset.yaml (W. Trevor King 2018-10-21 23:46:09 -0700 1) # This is needed by kube-proxy.
775f7991 data/data/bootstrap/files/opt/tectonic/manifest-overrides/kube-proxy-daemonset.yaml (W. Trevor King 2018-10-21 23:46:09 -0700 2) # TODO: move to the networking operator renderer.
775f7991 data/data/bootstrap/files/opt/tectonic/manifest-overrides/kube-proxy-service-account.yaml (W. Trevor King 2018-10-21 23:46:09 -0700 1) # This is needed by kube-proxy.
775f7991 data/data/bootstrap/files/opt/tectonic/manifest-overrides/kube-proxy-service-account.yaml (W. Trevor King 2018-10-21 23:46:09 -0700 2) # TODO: move to the networking operator renderer.
775f7991 data/data/bootstrap/files/opt/tectonic/manifest-overrides/kube-proxy-kube-system-rbac-role-binding.yaml (W. Trevor King 2018-10-21 23:46:09 -0700 1) # This is needed by kube-proxy.
775f7991 data/data/bootstrap/files/opt/tectonic/manifest-overrides/kube-proxy-kube-system-rbac-role-binding.yaml (W. Trevor King 2018-10-21 23:46:09 -0700 2) # TODO: move to the networking operator renderer.
775f7991 data/data/bootstrap/files/opt/tectonic/manifest-overrides/kube-proxy-role-binding.yaml (W. Trevor King 2018-10-21 23:46:09 -0700 1) # This is needed by kube-proxy.
775f7991 data/data/bootstrap/files/opt/tectonic/manifest-overrides/kube-proxy-role-binding.yaml (W. Trevor King 2018-10-21 23:46:09 -0700 2) # TODO: move to the networking operator renderer.
775f7991 data/data/bootstrap/files/usr/local/bin/bootkube.sh.template (W. Trevor King 2018-10-21 23:46:09 -0700 1) #!/usr/bin/env bash
775f7991 data/data/bootstrap/files/usr/local/bin/bootkube.sh.template (W. Trevor King 2018-10-21 23:46:09 -0700 97) # TODO: Remove this when manifest-overrides is empty.
775f7991 data/data/bootstrap/files/usr/local/bin/bootkube.sh.template (W. Trevor King 2018-10-21 23:46:09 -0700 99) cp manifest-overrides/* manifests/
775f7991 data/data/bootstrap/files/usr/local/bin/report-progress.sh (W. Trevor King 2018-10-21 23:46:09 -0700 1) #!/usr/bin/env bash
775f7991 data/data/bootstrap/files/usr/local/bin/tectonic.sh (W. Trevor King 2018-10-21 23:46:09 -0700 1) #!/usr/bin/env bashAll of those are intentional additions. And the deletions are close to the additions: $ git show --shortstat --oneline 775f799 | cat
775f799 data/bootstrap: Pull content out of pkg/asset/ignition/bootstrap
21 files changed, 611 insertions(+), 642 deletions(-)so it's unlikely I'm removing much by accident. I've also gone through and tried to match up all the additions and removals locally, but it would still be good to give this a careful read in review. |
|
e2e-aws hung waiting for the API: /retest |
It's easier for humans and linters to find this content if it's not hidden in Go variables. Since we're effectively pulling these files from Git now (either at build time or at run-time depending on release vs. dev mode in hack/build.sh), I'm being a bit more relaxed about file modes than the previous implementation. Files are now either 0555 (if they are in a 'bin' directory) or 0600 (if they aren't). This is a change for files like manifests.Manifests, which had previously been 0644. I've flattened the manifest overrides into a single directly, because the filenames are sufficient for sorting them by operator. And all of the override manifests now have their own comment explaining their target and eventual location.
This reverts commit 8ff1cee (2018-09-28, openshift#370). We moved from Glide to dep in 1f45543 (vendor: switch from glide to dep, 2018-09-28, openshift#380), so we no longer need to worry about yamllint vs. Glide.yaml.
This makes the config a bit easier to read, and also supports folks
who want to run yamllint directly (without going through
hack/yaml-lint.sh).
I've added the document-start and indentation rules to avoid
complaints like:
$ hack/yaml-lint.sh
...
./data/data/bootstrap/files/opt/tectonic/manifest-overrides/kube-proxy-daemonset.yaml
3:1 warning missing document start "---" (document-start)
23:7 error wrong indentation: expected 8 but found 6 (indentation)
24:9 error wrong indentation: expected 10 but found 8 (indentation)
31:9 error wrong indentation: expected 10 but found 8 (indentation)
40:9 error wrong indentation: expected 10 but found 8 (indentation)
49:7 error wrong indentation: expected 8 but found 6 (indentation)
51:7 error wrong indentation: expected 8 but found 6 (indentation)
...
Avoiding:
$ hack/yaml-lint.sh
./data/data/bootstrap/files/opt/tectonic/bootkube-config-overrides/kube-apiserver-config-overrides.yaml
4:10 warning too few spaces before comment (comments)
./data/data/bootstrap/files/opt/tectonic/manifest-overrides/kube-proxy-role-binding.yaml
10:29 warning too few spaces before comment (comments)
f45763d to
9ebdb1d
Compare
|
Ah: $ ssh -i libra.pem [email protected] journalctl | grep EXEC | tail -n2
Nov 08 05:19:18 ip-10-0-15-40 systemd[1545]: Failed at step EXEC spawning /usr/local/bin/tectonic.sh: Permission denied
Nov 08 05:19:18 ip-10-0-15-40 systemd[1]: tectonic.service: main process exited, code=exited, status=203/EXEC
$ ssh -i libra.pem [email protected] ls -l /usr/local/bin
total 20
-rw-------. 1 root root 8454 Nov 8 05:13 bootkube.sh
-rw-------. 1 root root 467 Nov 8 05:13 report-progress.sh
-rw-------. 1 root root 1417 Nov 8 05:13 tectonic.shApparently vfsgen doesn't track the executable bit. I've pushed f45763d -> 9ebdb1d rebasing on master and switching the mode to depend on whether the file lives in a |
|
Green here :) |
|
/lgtm |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abhinavdahiya, crawford, wking The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
It's easier for humans and linters to find this content if it's not hidden in Go variables.
Since we're effectively pulling these files from Git now (either at build time or at run-time depending on release vs. dev mode in hack/build.sh), I'm being a bit more relaxed about file modes than the previous implementation. Files are now either 0555 (if they were executable) or 0600 (if they weren't). This is a change for files like
manifests.Manifests, which had previously been 0644.I've flattened the manifest overrides into a single directly, because the filenames are sufficient for sorting them by operator. And all of the override manifests now have their own comment explaining their target and eventual location.
I've also reverted #370 (no need to worry about
Glide.yamlsince #380), and adjusted some of YAML to keepyamllinthappy. Linter coverage like that is part of the appeal of usingdata.Assetsfor these.