Skip to content
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

Change zarf init to always install the docker registry #82

Merged
merged 11 commits into from
Oct 6, 2021

Conversation

jeff-mccoy
Copy link
Contributor

No description provided.

@jeff-mccoy jeff-mccoy changed the title Change zarf init to always install the docker registry Draft: Change zarf init to always install the docker registry Oct 3, 2021
@jeff-mccoy jeff-mccoy self-assigned this Oct 3, 2021
@@ -1,13 +1,13 @@
mirrors:
registry.dso.mil:
endpoint:
- "https://zarf.localhost"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seen this behavior in some restricted environments too, so just removing for now because it doesn't really do anything for us. That, and it failed the E2E with the new mirroring setup:
https://repo1.dso.mil/platform-one/big-bang/apps/product-tools/zarf/-/jobs/7058776.

@RothAndrew
Copy link
Contributor

@jeff-mccoy in cli/internals/util/pki.go

Change

if ip := net.ParseIP(host); ip != nil {
  template.IPAddresses = append(template.IPAddresses, ip)
} else {
  // Add localhost to make things cleaner
  template.DNSNames = append(template.DNSNames, host, "localhost", config.ZarfLocal, "*.localhost")
  if template.Subject.CommonName == "" {
    template.Subject.CommonName = host
  }
}

to

// We need to add `config.ZarfLocal` to the certificate, but the way to do that is different depending on whether it
// is a DNS name or a IP address. This really shouldn't be necessary since `config.ZarfLocal` is a const, but it
// lets us mess with the value of that const without having to change logic in this function
if ip := net.ParseIP(config.ZarfLocal); ip != nil {
  // config.ZarfLocal is an IP address
  template.IPAddresses = append(template.IPAddresses, ip)
  } else {
    // config.ZarfLocal is assumed to be a DNS name
    template.DNSNames = append(template.DNSNames, config.ZarfLocal)
  }

if ip := net.ParseIP(host); ip != nil {
  template.IPAddresses = append(template.IPAddresses, ip)
  } else {
    // Add localhost to make things cleaner
    template.DNSNames = append(template.DNSNames, host, "localhost", "*.localhost")
    if template.Subject.CommonName == "" {
      template.Subject.CommonName = host
  }
}

I have this staged if you'd like me to push it, or you can adjust to your style if you want.

image (2)

@jeff-mccoy jeff-mccoy marked this pull request as ready for review October 5, 2021 23:00
@jeff-mccoy
Copy link
Contributor Author

@RothAndrew
Copy link
Contributor

RothAndrew commented Oct 5, 2021

I'm seeing the error again about IP SANs, not sure why. still investigating

Edit: Nevermind, I forgot to git pull

@jeff-mccoy
Copy link
Contributor Author

That’s sounds like something I would do…. 😂

@RothAndrew
Copy link
Contributor

Other than the Repo1 comment LGTM

RothAndrew
RothAndrew previously approved these changes Oct 6, 2021
@jeff-mccoy jeff-mccoy changed the title Draft: Change zarf init to always install the docker registry Change zarf init to always install the docker registry Oct 6, 2021
@jeff-mccoy
Copy link
Contributor Author

@jeff-mccoy jeff-mccoy merged commit cd45237 into master Oct 6, 2021
@jeff-mccoy jeff-mccoy deleted the feature/everything-is-a-component branch October 6, 2021 06:45
@jeff-mccoy jeff-mccoy restored the feature/everything-is-a-component branch October 6, 2021 07:26
@RothAndrew
Copy link
Contributor

@jeff-mccoy can we delete this branch?

@jeff-mccoy jeff-mccoy deleted the feature/everything-is-a-component branch October 7, 2021 05:50
@renovate renovate bot mentioned this pull request Apr 21, 2023
1 task
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.

Consolidate image strategy, wrap "utility-cluster" into components, use registry2 over containerd imports
2 participants