Skip to content

Commit

Permalink
Address PR feedback - lint, doc updates, dockerfiles and moving files.
Browse files Browse the repository at this point in the history
- Addresses all `golint` warnings including ones not caused by this PR
- Moves install files to correct place
- Updates docs with old references before structure
- Fixes broken links (not caused by this PR)
- Updates COPY command in other Dockerfiles
  • Loading branch information
Peter Kelly committed Sep 6, 2018
1 parent bc7eebd commit f12960e
Show file tree
Hide file tree
Showing 30 changed files with 74 additions and 55 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ nginx-ingress
!nginx-ingress/
osx-nginx-plus-ingress
nginx-plus-ingress
cmd/nginx-ic/nginx-ic
cmd/nginx-ingress/nginx-ingress

# NGINX Plus license files
*.crt
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Read the [documentation](https://github.com/nginxinc/kubernetes-ingress/tree/mas

* This Ingress Controller is written in Go and supports both the open source NGINX software and NGINX Plus.
* The project follows a standard Go project layout
* The main code is found at `cmd/nginx-ic/`
* The main code is found at `cmd/nginx-ingress/`
* The internal code is found at `internal/`
* Build files for Docker and CI are found under `build/`
* Deployment yaml files, and Helm files are found at `deployments/`
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ The table below summarizes the options regarding the images, manifests, helm cha
| Version | Description | Image for NGINX | Image for NGINX Plus | Installation Manifests and Helm Chart | Documentation and Examples |
| ------- | ----------- | --------------- | -------------------- | ---------------------------------------| -------------------------- |
| Latest stable release | For production use | `nginx/nginx-ingress:1.3.0`, `nginx/nginx-ingress:1.3.0-alpine` from [DockerHub](https://hub.docker.com/r/nginx/nginx-ingress/) or [build your own image](https://github.com/nginxinc/kubernetes-ingress/tree/v1.3.0/nginx-controller). | [Build your own image](https://github.com/nginxinc/kubernetes-ingress/tree/v1.3.0/nginx-controller). | [Manifests](https://github.com/nginxinc/kubernetes-ingress/tree/v1.3.0/install). [Helm chart](https://github.com/nginxinc/kubernetes-ingress/tree/v1.3.0/helm-chart). | [Documentation](https://github.com/nginxinc/kubernetes-ingress/tree/v1.3.0/docs). [Examples](https://github.com/nginxinc/kubernetes-ingress/tree/v1.3.0/examples). |
| Edge | For testing and experimenting | `nginx/nginx-ingress:edge`, `nginx/nginx-ingress:edge-alpine` from [DockerHub](https://hub.docker.com/r/nginx/nginx-ingress/) or [build your own image](https://github.com/nginxinc/kubernetes-ingress/tree/master/nginx-controller). | [Build your own image](https://github.com/nginxinc/kubernetes-ingress/tree/master/nginx-controller). | [Manifests](https://github.com/nginxinc/kubernetes-ingress/tree/master/install). [Helm chart](https://github.com/nginxinc/kubernetes-ingress/tree/master/helm-chart). | [Documentation](https://github.com/nginxinc/kubernetes-ingress/tree/master/docs). [Examples](https://github.com/nginxinc/kubernetes-ingress/tree/master/examples). |
| Edge | For testing and experimenting | `nginx/nginx-ingress:edge`, `nginx/nginx-ingress:edge-alpine` from [DockerHub](https://hub.docker.com/r/nginx/nginx-ingress/) or [build your own image](https://github.com/nginxinc/kubernetes-ingress/tree/master/build). | [Build your own image](https://github.com/nginxinc/kubernetes-ingress/tree/master/build). | [Manifests](https://github.com/nginxinc/kubernetes-ingress/tree/master/deployments). [Helm chart](https://github.com/nginxinc/kubernetes-ingress/tree/master/deployments/helm-chart). | [Documentation](https://github.com/nginxinc/kubernetes-ingress/tree/master/docs). [Examples](https://github.com/nginxinc/kubernetes-ingress/tree/master/examples). |

## Benefits of Using the Ingress Controller with NGINX Plus

Expand Down
2 changes: 1 addition & 1 deletion build/DockerfileForAlpine
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ RUN ln -sf /proc/1/fd/1 /var/log/nginx/access.log \
&& ln -sf /proc/1/fd/1 /var/log/nginx/stream-access.log \
&& ln -sf /proc/1/fd/2 /var/log/nginx/error.log

COPY nginx-ingress nginx/templates/nginx.ingress.tmpl nginx/templates/nginx.tmpl /
COPY nginx-ingress internal/nginx/templates/nginx.ingress.tmpl internal/nginx/templates/nginx.tmpl /

RUN rm /etc/nginx/conf.d/*

Expand Down
2 changes: 1 addition & 1 deletion build/DockerfileForPlus
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ RUN ln -sf /proc/1/fd/1 /var/log/nginx/access.log \

EXPOSE 80 443

COPY nginx-ingress nginx/templates/nginx-plus.ingress.tmpl nginx/templates/nginx-plus.tmpl /
COPY nginx-ingress internal/nginx/templates/nginx-plus.ingress.tmpl internal/nginx/templates/nginx-plus.tmpl /

RUN rm /etc/nginx/conf.d/* \
&& mkdir -p /etc/nginx/secrets
Expand Down
7 changes: 1 addition & 6 deletions build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ We build the image using the make utility and the provided `Makefile`. Let’s c
$ git clone https://github.com/nginxinc/kubernetes-ingress/
```
1. If you're using a stable release, check out the corresponding tag. For release 1.3.0, run:
```
$ git checkout v1.3.0
```
1. Build the image:
* For NGINX:
```
Expand All @@ -47,7 +42,7 @@ We build the image using the make utility and the provided `Makefile`. Let’s c
As the result, the image **myregistry.example.com/nginx-ingress:edge** is built and pushed to the registry. Note that the tag `edge` comes from the `VERSION` variable, defined in the Makefile.
* For NGINX Plus, first, make sure that the certificate (`nginx-repo.crt`) and the key (`nginx-repo.key`) of your license are located in the `nginx-controller` folder:
* For NGINX Plus, first, make sure that the certificate (`nginx-repo.crt`) and the key (`nginx-repo.key`) of your license are located in the root of the project:
```
$ ls nginx-repo.*
nginx-repo.crt nginx-repo.key
Expand Down
2 changes: 1 addition & 1 deletion cmd/nginx-ingress/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func main() {
}
}

func handleTermination(lbc *controller.LoadBalancerController, ngxc *nginx.NginxController, nginxDone chan error) {
func handleTermination(lbc *controller.LoadBalancerController, ngxc *nginx.Controller, nginxDone chan error) {
signalChan := make(chan os.Signal, 1)
signal.Notify(signalChan, syscall.SIGTERM)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,3 @@ spec:
- :9113
- -nginx.scrape-uri
- http://127.0.0.1:8080/stub_status

Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,3 @@ spec:
- :9113
- nginx.scrape-uri
- http://127.0.0.1:8080/stub_status

2 changes: 1 addition & 1 deletion deployments/helm-chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 0.1.2
appVersion: edge
description: NGINX Ingress Controller
sources:
- https://github.com/nginxinc/kubernetes-ingress/tree/master/helm-chart
- https://github.com/nginxinc/kubernetes-ingress/tree/master/deployment/helm-chart
keywords:
- ingress
- nginx
Expand Down
8 changes: 2 additions & 6 deletions deployments/helm-chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,9 @@ This chart deploys the NGINX Ingress controller in your Kubernetes cluster.
```
$ git clone https://github.com/nginxinc/kubernetes-ingress/
```
1. If you're using a stable release, check out the corresponding tag. For release 1.3.0, run:
2. Change your working directory to /deployments/helm-chart:
```
$ git checkout v1.3.0
```
2. Change your working directory to /helm-chart:
```
$ cd kubernetes-ingress/helm-chart
$ cd kubernetes-ingress/deployments/helm-chart
```
3. To install the chart with the release name my-release (my-release is the name that you choose):
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Make sure you have access to the Ingress controller image:
* For NGINX Ingress controller, use the image `nginx/nginx-ingress` from [DockerHub](https://hub.docker.com/r/nginx/nginx-ingress/).
* For NGINX Plus Ingress controller, build your own image and push it to your private Docker registry by following the instructions from [here](../build/README.md).

The installation manifests are located in the [install](../install) folder. In the steps below we assume that you will be running the commands from that folder.
The installation manifests are located in the [deployments](../deployments) folder. In the steps below we assume that you will be running the commands from that folder.

## 1. Create a Namespace, a SA and the Default Secret.

Expand Down
4 changes: 2 additions & 2 deletions examples/customization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The table below summarizes all of the options. For some of them, there are examp
| `nginx.org/redirect-to-https` | `redirect-to-https` | Sets the 301 redirect rule based on the value of the `http_x_forwarded_proto` header on the server block to force incoming traffic to be over HTTPS. Useful when terminating SSL in a load balancer in front of the Ingress controller — see [115](https://github.com/nginxinc/kubernetes-ingress/issues/115) | `False` | |
| `ingress.kubernetes.io/ssl-redirect` | `ssl-redirect` | Sets an unconditional 301 redirect rule for all incoming HTTP traffic to force incoming traffic over HTTPS. | `True` | |
| N/A | `error-log-level` | Sets the global [error log level](http://nginx.org/en/docs/ngx_core_module.html#error_log) for NGINX. | `notice` | |
| N/A | `log-format` | Sets the custom [log format](http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format). | See the [template file](../../nginx-controller/nginx/nginx.conf.tmpl). | |
| N/A | `log-format` | Sets the custom [log format](http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format). | See the [template file](../../internal/nginx/templates/nginx.tmpl). | |
| `nginx.org/hsts` | `hsts` | Enables [HTTP Strict Transport Security (HSTS)](https://www.nginx.com/blog/http-strict-transport-security-hsts-and-nginx/): the HSTS header is added to the responses from backends. The `preload` directive is included in the header. | `False` | |
| `nginx.org/hsts-max-age` | `hsts-max-age` | Sets the value of the `max-age` directive of the HSTS header. | `2592000` (1 month) |
| `nginx.org/hsts-include-subdomains` | `hsts-include-subdomains` | Adds the `includeSubDomains` directive to the HSTS header. | `False`| |
Expand Down Expand Up @@ -69,7 +69,7 @@ The table below summarizes all of the options. For some of them, there are examp
| `nginx.com/slow-start` | N/A | Sets the upstream server [slow-start period](https://docs.nginx.com/nginx/admin-guide/load-balancer/http-load-balancer/#server-slow-start). By default, slow-start is activated after a server becomes [available](https://docs.nginx.com/nginx/admin-guide/load-balancer/http-health-check/#passive-health-checks) or [healthy](https://docs.nginx.com/nginx/admin-guide/load-balancer/http-health-check/#active-health-checks). To enable slow-start for newly added servers, configure [mandatory active health checks](../health-checks). | `"0s"` | |
| N/A | `external-status-address` | Sets the address to be reported in the status of Ingress resources. Requires the `-report-status` command-line argument. Overrides the `-external-service` argument. | N/A | [Report Ingress Status](../../docs/report-ingress-status.md). |
| N/A | `stream-snippets` | Sets a custom snippet in stream context. | N/A | [Support for TCP/UDP Load Balancing](../tcp-udp). |
| N/A | `stream-log-format` | Sets the custom [log format](http://nginx.org/en/docs/stream/ngx_stream_log_module.html#log_format) for TCP/UDP load balancing. | See the [template file](../../nginx-controller/nginx/nginx.conf.tmpl). | |
| N/A | `stream-log-format` | Sets the custom [log format](http://nginx.org/en/docs/stream/ngx_stream_log_module.html#log_format) for TCP/UDP load balancing. | See the [template file](../../internal/nginx/templates/nginx.tmpl). | |

## Using ConfigMaps

Expand Down
14 changes: 13 additions & 1 deletion internal/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,12 @@ func NewLoadBalancerController(input NewLoadBalancerControllerInput) *LoadBalanc
return &lbc
}

// UpdateManagedAndMergeableIngresses invokes the UpdateManagedAndMergeableIngresses method on the Status Updater
func (lbc *LoadBalancerController) UpdateManagedAndMergeableIngresses(ingresses []v1beta1.Ingress, mergeableIngresses map[string]*nginx.MergeableIngresses) error {
return lbc.statusUpdater.UpdateManagedAndMergeableIngresses(ingresses, mergeableIngresses)
}

// AddLeaderHandler adds the handler for leader election to the controller
func (lbc *LoadBalancerController) AddLeaderHandler(leaderHandler leaderelection.LeaderCallbacks) {
var err error
lbc.leaderElector, err = NewLeaderElector(lbc.client, leaderHandler, lbc.controllerNamespace)
Expand All @@ -149,18 +151,22 @@ func (lbc *LoadBalancerController) AddLeaderHandler(leaderHandler leaderelection
}
}

// GetIngressClassKey returns the ingress class key
func (lbc *LoadBalancerController) GetIngressClassKey() string {
return ingressClassKey
}

// AddSyncQueue enqueues the provided item on the sync queue
func (lbc *LoadBalancerController) AddSyncQueue(item interface{}) {
lbc.syncQueue.Enqueue(item)
}

// WatchNginxConfigMaps sets the controller to watch config map changes
func (lbc *LoadBalancerController) WatchNginxConfigMaps() {
lbc.watchNginxConfigMaps = true
}

// AddSecretHandler adds the handler for secrets to the controller
func (lbc *LoadBalancerController) AddSecretHandler(handlers cache.ResourceEventHandlerFuncs) {
lbc.secretLister.Store, lbc.secretController = cache.NewInformer(
cache.NewListWatchFromClient(
Expand All @@ -174,6 +180,7 @@ func (lbc *LoadBalancerController) AddSecretHandler(handlers cache.ResourceEvent
)
}

// AddServiceHandler adds the handler for services to the controller
func (lbc *LoadBalancerController) AddServiceHandler(handlers cache.ResourceEventHandlerFuncs) {
lbc.svcLister, lbc.svcController = cache.NewInformer(
cache.NewListWatchFromClient(
Expand All @@ -187,6 +194,7 @@ func (lbc *LoadBalancerController) AddServiceHandler(handlers cache.ResourceEven
)
}

// AddIngressHandler adds the handler for ingresses to the controller
func (lbc *LoadBalancerController) AddIngressHandler(handlers cache.ResourceEventHandlerFuncs) {
lbc.ingressLister.Store, lbc.ingressController = cache.NewInformer(
cache.NewListWatchFromClient(
Expand All @@ -200,6 +208,7 @@ func (lbc *LoadBalancerController) AddIngressHandler(handlers cache.ResourceEven
)
}

// AddEndpointHandler adds the handler for endpoints to the controller
func (lbc *LoadBalancerController) AddEndpointHandler(handlers cache.ResourceEventHandlerFuncs) {
lbc.endpointLister.Store, lbc.endpointController = cache.NewInformer(
cache.NewListWatchFromClient(
Expand All @@ -213,6 +222,7 @@ func (lbc *LoadBalancerController) AddEndpointHandler(handlers cache.ResourceEve
)
}

// AddConfigMapHandler adds the handler for config maps to the controller
func (lbc *LoadBalancerController) AddConfigMapHandler(handlers cache.ResourceEventHandlerFuncs, namespace string) {
lbc.configMapLister.Store, lbc.configMapController = cache.NewInformer(
cache.NewListWatchFromClient(
Expand All @@ -226,6 +236,7 @@ func (lbc *LoadBalancerController) AddConfigMapHandler(handlers cache.ResourceEv
)
}

// GetDefaultServerSecret returns the default server secret
func (lbc *LoadBalancerController) GetDefaultServerSecret() string {
return lbc.defaultServerSecret
}
Expand Down Expand Up @@ -579,7 +590,7 @@ func (lbc *LoadBalancerController) syncExternalService(task queue.Task) {
}
}

// isExternalServiceForStatus matches the service specified by the external-service arg
// IsExternalServiceForStatus matches the service specified by the external-service arg
func (lbc *LoadBalancerController) IsExternalServiceForStatus(svc *api_v1.Service) bool {
return lbc.statusUpdater.namespace == svc.Namespace && lbc.statusUpdater.externalServiceName == svc.Name
}
Expand Down Expand Up @@ -805,6 +816,7 @@ items:
return nonMinions, minions, nil
}

// EnqueueIngressForService enqueues the ingress for the given service
func (lbc *LoadBalancerController) EnqueueIngressForService(svc *api_v1.Service) {
ings := lbc.getIngressesForService(svc)
for _, ing := range ings {
Expand Down
4 changes: 2 additions & 2 deletions internal/controller/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ func getMergableDefaults() (cafeMaster, coffeeMinion, teaMinion extensions.Ingre
cafeMasterIngEx, _ := lbc.createIngress(&cafeMaster)
ingExMap["default-cafe-master"] = cafeMasterIngEx

cnf := nginx.NewConfigurator(&nginx.NginxController{}, &nginx.Config{}, &plus.NginxAPIController{}, &nginx.TemplateExecutor{})
cnf := nginx.NewConfigurator(&nginx.Controller{}, &nginx.Config{}, &plus.NginxAPIController{}, &nginx.TemplateExecutor{})

// edit private field ingresses to use in testing
pointerVal := reflect.ValueOf(cnf)
Expand Down Expand Up @@ -782,7 +782,7 @@ func TestFindProbeForPods(t *testing.T) {

func TestGetServicePortForIngressPort(t *testing.T) {
fakeClient := fake.NewSimpleClientset()
cnf := nginx.NewConfigurator(&nginx.NginxController{}, &nginx.Config{}, &plus.NginxAPIController{}, &nginx.TemplateExecutor{})
cnf := nginx.NewConfigurator(&nginx.Controller{}, &nginx.Config{}, &plus.NginxAPIController{}, &nginx.TemplateExecutor{})
lbc := LoadBalancerController{
client: fakeClient,
ingressClass: "nginx",
Expand Down
1 change: 1 addition & 0 deletions internal/handlers/configMap.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"k8s.io/client-go/tools/cache"
)

// CreateConfigMapHandlers builds the handler funcs for config maps
func CreateConfigMapHandlers(lbc *controller.LoadBalancerController, name string) cache.ResourceEventHandlerFuncs {
return cache.ResourceEventHandlerFuncs{
AddFunc: func(obj interface{}) {
Expand Down
1 change: 1 addition & 0 deletions internal/handlers/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"k8s.io/client-go/tools/cache"
)

// CreateEndpointHandlers builds the handler funcs for endpoints
func CreateEndpointHandlers(lbc *controller.LoadBalancerController) cache.ResourceEventHandlerFuncs {
return cache.ResourceEventHandlerFuncs{
AddFunc: func(obj interface{}) {
Expand Down
1 change: 1 addition & 0 deletions internal/handlers/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"k8s.io/client-go/tools/cache"
)

// CreateIngressHandlers builds the handler funcs for ingresses
func CreateIngressHandlers(lbc *controller.LoadBalancerController) cache.ResourceEventHandlerFuncs {
return cache.ResourceEventHandlerFuncs{
AddFunc: func(obj interface{}) {
Expand Down
1 change: 1 addition & 0 deletions internal/handlers/leader.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"k8s.io/client-go/tools/leaderelection"
)

// CreateLeaderHandler builds the handler funcs for leader handling
func CreateLeaderHandler(lbc *controller.LoadBalancerController) leaderelection.LeaderCallbacks {
return leaderelection.LeaderCallbacks{
OnStartedLeading: func(stop <-chan struct{}) {
Expand Down
1 change: 1 addition & 0 deletions internal/handlers/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"k8s.io/client-go/tools/cache"
)

// CreateSecretHandlers builds the handler funcs for secrets
func CreateSecretHandlers(lbc *controller.LoadBalancerController) cache.ResourceEventHandlerFuncs {
return cache.ResourceEventHandlerFuncs{
AddFunc: func(obj interface{}) {
Expand Down
1 change: 1 addition & 0 deletions internal/handlers/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
api_v1 "k8s.io/api/core/v1"
)

// CreateServiceHandlers builds the handler funcs for services
func CreateServiceHandlers(lbc *controller.LoadBalancerController) cache.ResourceEventHandlerFuncs {
return cache.ResourceEventHandlerFuncs{
AddFunc: func(obj interface{}) {
Expand Down
14 changes: 7 additions & 7 deletions internal/nginx/configurator.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const JWTKeyAnnotation = "nginx.com/jwt-key"

// Configurator transforms an Ingress resource into NGINX Configuration
type Configurator struct {
nginx *NginxController
nginx *Controller
config *Config
nginxAPI *plus.NginxAPIController
templateExecutor *TemplateExecutor
Expand All @@ -37,7 +37,7 @@ type Configurator struct {
}

// NewConfigurator creates a new Configurator
func NewConfigurator(nginx *NginxController, config *Config, nginxAPI *plus.NginxAPIController, templateExecutor *TemplateExecutor) *Configurator {
func NewConfigurator(nginx *Controller, config *Config, nginxAPI *plus.NginxAPIController, templateExecutor *TemplateExecutor) *Configurator {
cnf := Configurator{
nginx: nginx,
config: config,
Expand Down Expand Up @@ -738,7 +738,7 @@ func parsePort(value string) (int, error) {
port, err := strconv.ParseInt(value, 10, 16)
if err != nil {
return 0, fmt.Errorf(
"Unable to parse port as integer: %s\n",
"Unable to parse port as integer: %s",
err,
)
}
Expand Down Expand Up @@ -1051,7 +1051,7 @@ func (cnf *Configurator) updatePlusEndpoints(ingEx *IngressEx) error {
func filterMasterAnnotations(annotations map[string]string) []string {
var removedAnnotations []string

for key, _ := range annotations {
for key := range annotations {
if _, notAllowed := masterBlacklist[key]; notAllowed {
removedAnnotations = append(removedAnnotations, key)
delete(annotations, key)
Expand All @@ -1064,7 +1064,7 @@ func filterMasterAnnotations(annotations map[string]string) []string {
func filterMinionAnnotations(annotations map[string]string) []string {
var removedAnnotations []string

for key, _ := range annotations {
for key := range annotations {
if _, notAllowed := minionBlacklist[key]; notAllowed {
removedAnnotations = append(removedAnnotations, key)
delete(annotations, key)
Expand All @@ -1085,8 +1085,8 @@ func mergeMasterAnnotationsIntoMinion(minionAnnotations map[string]string, maste
}

// GenerateNginxMainConfig generate NginxMainConfig from Config
func GenerateNginxMainConfig(config *Config) *NginxMainConfig {
nginxCfg := &NginxMainConfig{
func GenerateNginxMainConfig(config *Config) *MainConfig {
nginxCfg := &MainConfig{
MainSnippets: config.MainMainSnippets,
HTTPSnippets: config.MainHTTPSnippets,
StreamSnippets: config.MainStreamSnippets,
Expand Down
Loading

0 comments on commit f12960e

Please sign in to comment.