-
Notifications
You must be signed in to change notification settings - Fork 155
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
Update autoinstall-reference.rst #1933
base: main
Are you sure you want to change the base?
Conversation
Missing hypen for uri will result in an error, if it is the only value in list. error: { 'uri': 'http://archive.ubuntu.com/ubuntu/' } is not of type 'array'
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.
Hello and thank you for your contribution!
However, I think the change would introduce invalid autoinstall directives. A arches
directive (without a corresponding uri
) would be rejected by Subiquity.
Maybe there is something incorrect somewhere in the documentation?
@@ -270,9 +270,9 @@ The default is: | |||
primary: | |||
- country-mirror | |||
- arches: [i386, amd64] | |||
uri: "http://archive.ubuntu.com/ubuntu" | |||
- uri: "http://archive.ubuntu.com/ubuntu" |
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 change does not look right to me. The key called "primary" expects an array of elements, where each element can either be "country-mirror" or an object with a URI + optionally a set of architectures if applies to.
If we translate the YAML into JSON, we have:
primary:
- arches: [i386, amd64]
uri: http://archive.ubuntu.com/ubuntu
equivalent to
{
"primary": [
{
"arches": ["i386", "amd64"],
"uri": "http://archive.ubuntu.com/ubuntu"
}
]
}
and
primary:
- arches: [i386, amd64]
- uri: "http://archive.ubuntu.com/ubuntu"
equivalent to
{
"primary": [
{
"arches": ["i386", "amd64"]
}, {
"uri": "http://archive.ubuntu.com/ubuntu"
}
]
}
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.
- if you scroll down in the documentation you will see the uri already with an hyphen. -> https://canonical-subiquity.readthedocs-hosted.com/en/latest/reference/autoinstall-reference.html#geoip
- If i use arches + uri the hyphen for uri isn't necessary, but if i use only uri, the error mentioned get thrown.
my user-data looks like following for apt;
working one
apt:
mirror-selection:
primary:
- uri: "http://archive.ubuntu.com/ubuntu/"
fallback: offline-install
failed one, error see 1 comment
apt:
mirror-selection:
primary:
uri: "http://archive.ubuntu.com/ubuntu/"
fallback: offline-install
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.
got it;
primary is an array of country-mirror and an object with two properties; uri and arches
so each list needs an hyphen, so when uri is needed, the documentation should switch to the following;
why? with the following example in the docuentation u couldn't get in trouble if you only use the necessary property of the list.
primary:
- country-mirror
- uri: "http://archive.ubuntu.com/ubuntu"
arches: [i386, amd64]
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.
if you scroll down in the documentation you will see the uri already with an hyphen.
Right, the issue in the proposed change is having arches
on its own line with a hyphen.
- uri: my_uri
arches: [amd64]
and
- arches: [amd64]
uri: my_uri
are semantically equivalent. The primary
key should be an array of items. Either containing the string country-mirror
or an object which has a string property uri
and (optionally) an array of arches arches
which list the supported architectures for that uri.
The reason your second example fails is because it's missing the hyphen. In the following example:
primary:
uri: "http://archive.ubuntu.com/ubuntu/"
primary
is an object with some string property uri
. Whereas in:
primary:
- uri: "http://archive.ubuntu.com/ubuntu/"
primary
is an array of objects with one item. Where that one item has a string property uri
.
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.
I hadn't refreshed and didn't see your comment, apologies! I also had to look at the code for this one. Perhaps we should update the docs to better reflect what's expected.
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.
@ben-ba I'd be happy to accept this as a doc improvement. Would you like to update this PR with the switched arches
/ uri
statements?
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.
We'd also need you to sign the CLA before merging the change. We have some instructions on how to do so:
https://github.com/canonical/subiquity/blob/main/CONTRIBUTING.md#contributor-license-agreement
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.
PR updated, CLA signed.
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.
I would be really helpfully to read something about the validation of a autoinstall configuration with
./scripts/validate-autoinstall-user-data.py ../autoinstall/simple/user-data
Complaining is to easy, so i made an PR for this.
#1941
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.
I'm okay with the change, but I'll wait for another agree to mark approved.
Also, it looks like the CLA checker isn't happy. Could you confirm the email / github account you used to sign it is the same as this one? If it is, it may just be a little slow to update so we can try again later.
E-Mail address is the same, but maybe it's an issue, because it is hidden in my github account?! |
its weird or confusing... Let me explane what my goal is.
whats the final suggestions from an 'user' perspective; finally here an overview of different configs which are not working - not really clear by documentation or/and no error with the validation script (./scripts/validate-autoinstall-user-data.py ../autoinstall/simple/user-data) ------attempt 1------
------attempt 2------
so my expectation was, security would be also linuxmirror...
------attempt 3------
------attempt 4------
------attempt 5------
|
A few things:
|
Missing hyphen for uri will result in an error, if it is the only value in list.
error: { 'uri': 'http://archive.ubuntu.com/ubuntu/' } is not of type 'array'