Skip to content

types/url: add data as a valid url scheme - #330

Closed
s-urbaniak wants to merge 1 commit into
coreos:masterfrom
s-urbaniak:fixurl
Closed

s-urbaniak wants to merge 1 commit into
coreos:masterfrom
s-urbaniak:fixurl

Conversation

@s-urbaniak

Copy link
Copy Markdown
Contributor

Currently the following ignition config fails on Openstack:

{
  "ignition": {
    "version": "2.0.0",
    "config": {}
  },
  "storage": {
    "files": [
      {
        "filesystem": "root",
        "path": "/etc/kubernetes/kubelet.env",
        "contents": {
          "source": "data:text/plain;charset=utf-8;base64,S1VCRUxFVF9JTUFHRV9VUkw9cXVheS5pby9jb3Jlb3MvaHlwZXJrdWJlIEtVQkVMRVRfSU1BR0VfVEFHPWZvb2Jhcg==",
          "verification": {}
        },
        "mode": 420,
        "user": {},
        "group": {}
      }
    ]
  }
}

with the following validation error:

$ journalctl -t ignition
Feb 27 13:21:35 t460s ignition[8459]: GET http://169.254.169.254/openstack/latest/user_data: attempt #1
Feb 27 13:21:35 t460s ignition[8459]: config drive ("/dev/disk/by-label/config-2") not found. Waiting...
Feb 27 13:21:35 t460s ignition[8459]: config drive ("/dev/disk/by-label/CONFIG-2") not found. Waiting...
Feb 27 13:21:35 t460s ignition[8459]: GET result: OK
Feb 27 13:21:35 t460s ignition[8459]: error at line 12, column 154
                                         11:           "contents": {
                                         12:             "source": "data:text/plain;charset=utf-8;base64,S1VCRUxFVF9JTUFHRV9VUkw9cXVheS5pby9jb3Jlb3MvaHlwZXJrdWJlIEtVQkVMRVRfSU1BR0VfVEFHPWZvb2Jhcg=="
                                                                                                                                                                                                     ^
                                      invalid url scheme
Feb 27 13:21:35 t460s ignition[8459]: failed to fetch config: config is not valid
Feb 27 13:21:35 t460s ignition[8459]: failed to acquire config: config is not valid

This fixes it

/cc @crawford @alexsomesan

@s-urbaniak

s-urbaniak commented Feb 27, 2017 •

Copy link
Copy Markdown
Contributor Author

@crawford

Copy link
Copy Markdown
Contributor

Ah, it works on EC2 because that image is using a tagged version of Ignition. This codebase has been shuffled around a bit since then. I'll have to figure out how this bug got reintroduced.

@crawford crawford left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I'm going to say no to this PR. There is some extra validation that can be done when a "data" URL is encountered. I'm going to backport the recent fixes which should address all of these issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants