Comments (4)
I prefer keeping the distro-specific functionality instead of a lot if/else. I.e., if this tool exists, use it, otherwise use the other tool. Additionally, a tool exists in the image doesn't mean that it's the preferred tool to use for that distro. As we started adding functionality beyond hostname/username, the difference in handling each distro will start growing.
We can solve the issue of "most distros don't work" by having a generic distro.
from azure-init.
An alternative to run-time detection would be build-time switches, i.e. give the packagers control over what tools they prefer.
from azure-init.
An alternative to run-time detection would be build-time switches, i.e. give the packagers control over what tools they prefer.
That's what Ignition does, one can tell it to run a certain binary for user adding, be it due to having a different path or because it's another tool (as long as the basic arguments are compatible). When multiple tools are supported with different arguments it's even stronger, but I would also keep the custom path setting in mind to make life easier when distros switch from sbin to bin and similar.
from azure-init.
Rust supports a custom build-time environment variable via rustc-env, which can be configured in build.rs
, a custom build script. Then each environment variable can be consumed by env!
in the compiled macro. For example, see sudo-rs. That looks more or less like what ignition does like Kai said, not in Go but in Rust.
If we also want to make it possible to configure at runtime, the most wide-spread way is to use clap, which supports command-line options coupled with environment variables.
Anyway I agree that we should remove distro-specific checks in the code.
I will soon try to come up with a draft PR.
from azure-init.
Related Issues (20)
- [RFE] Support for custom data (or document why it is not supported)
- [RFE] Support pre-provisioning on Azure
- [RFE] Disable provisioning with password HOT 1
- [RFE]: imds test coverage for functional_tests
- [RFE] Send user-agent as part of header for IMDS calls HOT 1
- [RFE] Report failures to Azure when there's an unrecoverable error
- VM provisioning succeeds even when azure-init returns error
- [RFE] azure-init should add retries around IMDS and Wireserver operations HOT 2
- [RFE] Output log to a known (perhaps configurable) location
- [RFE] Provide a mechanism to configure behavior of azure-init at runtime
- azure-init should not assume provisioning media is always at /dev/sr0 HOT 2
- libazureinit needs to update the sshd config when it provisions a user with password
- libazureinit currently does not bounce DHCP to publish hostname to Azure platform DNS HOT 1
- [RFE] passwordless sudo
- [RFE] Interaction with Linux Guest/Extension Agent (walinuxagent)
- Understand Type mismatch for coref 'Clause' vs 'Description' HOT 1
- [RFE] decouple mount/ovf logic out of get_username
- [RFE] improve way how build-time configuration variables are handled
- [RFE] improve image creation script to support multiple base image choices HOT 1
- [RFE] Select a MSRV HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-init.