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

fix: rename name to plugin in KongPlugin resource #122

Merged
merged 1 commit into from
Sep 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions internal/apis/plugin/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ type KongPlugin struct {
// Config contains the plugin configuration.
Config Configuration `json:"config,omitempty"`

// Name is the name of the plugin to which to apply the config
Name string `json:"name,omitempty"`
// PluginName is the name of the plugin to which to apply the config
PluginName string `json:"plugin,omitempty"`
}

// KongPluginList is a top-level list type. The client methods for lists are automatically created.
Expand Down
10 changes: 5 additions & 5 deletions internal/ingress/controller/kong.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (n *NGINXController) syncGlobalPlugins() error {
var duplicates []string // keep track of duplicate

for i := 0; i < len(targetGlobalPlugins); i++ {
name := targetGlobalPlugins[i].Name
name := targetGlobalPlugins[i].PluginName
// empty name skip it
if name == "" {
continue
Expand Down Expand Up @@ -482,7 +482,7 @@ func (n *NGINXController) syncServices(ingressCfg *ingress.Configuration) (bool,
// check the kong plugin configuration is up to date
if !pluginDeepEqual(k8sPlugin.Config, configuredPlugin) ||
(!k8sPlugin.Disabled != configuredPlugin.Enabled) {
glog.Infof("plugin %v configuration in kong is outdated. Updating...", k8sPlugin.Name)
glog.Infof("plugin %v configuration in kong is outdated. Updating...", k8sPlugin.PluginName)
p := &kongadminv1.Plugin{
Name: configuredPlugin.Name,
Config: kongadminv1.Configuration(k8sPlugin.Config),
Expand All @@ -509,7 +509,7 @@ func (n *NGINXController) syncServices(ingressCfg *ingress.Configuration) (bool,
continue
}

glog.Infof("plugin %v configuration in kong is up to date.", k8sPlugin.Name)
glog.Infof("plugin %v configuration in kong is up to date.", k8sPlugin.PluginName)
}
}
}
Expand Down Expand Up @@ -924,7 +924,7 @@ func (n *NGINXController) syncRoutes(ingressCfg *ingress.Configuration) (bool, e
// check the kong plugin configuration is up to date
if !pluginDeepEqual(k8sPlugin.Config, configuredPlugin) ||
(!k8sPlugin.Disabled != configuredPlugin.Enabled) {
glog.Infof("plugin %v configuration in kong is outdated. Updating...", k8sPlugin.Name)
glog.Infof("plugin %v configuration in kong is outdated. Updating...", k8sPlugin.PluginName)
p := &kongadminv1.Plugin{
Name: configuredPlugin.Name,
Config: kongadminv1.Configuration(k8sPlugin.Config),
Expand All @@ -941,7 +941,7 @@ func (n *NGINXController) syncRoutes(ingressCfg *ingress.Configuration) (bool, e
continue
}

glog.Infof("plugin %v configuration in kong is up to date.", k8sPlugin.Name)
glog.Infof("plugin %v configuration in kong is up to date.", k8sPlugin.PluginName)
}
}

Expand Down