Skip to content

Commit

Permalink
reference resources
Browse files Browse the repository at this point in the history
  • Loading branch information
bfoley13 committed Oct 17, 2024
1 parent 071117b commit 861a8c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions pkg/cmdhelpers/addon_helpers.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cmdhelpers

import (
"errors"
"fmt"
"path"
"strings"
Expand All @@ -25,8 +24,8 @@ type referenceResource struct {

var ReferenceResources map[string][]referenceResource = map[string][]referenceResource{
"service": {
{Name: "namespace", Path: "metadata.namespace"},
{Name: "name", Path: "metadata.name"},
{Name: "service-namespace", Path: "metadata.namespace"},
{Name: "service-name", Path: "metadata.name"},
{Name: "service-port", Path: "spec.ports.port"},
},
}
Expand All @@ -50,10 +49,6 @@ func PromptAddonValues(dest string, addonConfig *config.DraftConfig) error {
log.Debug("got reference map")
// merge maps
for refName, refVal := range referenceMap {
// check for key collision
if _, err := addonConfig.GetVariable(refName); err == nil {
return errors.New("variable name collision between references and DraftConfig")
}
if strings.Contains(strings.ToLower(refName), "namespace") && refVal == "" {
refVal = "default" //hack here to have explicit namespacing, probably a better way to do this
}
Expand Down
2 changes: 1 addition & 1 deletion template/addons/azure/webapp_routing/draft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ variables:
kind: "kubernetesNamespace"
default:
disablePrompt: true
value: "namespace"
value: "default"
description: "specify the namespace for the ingress"
versions: ">=0.0.1"
- name: "service-port"
Expand Down

0 comments on commit 861a8c7

Please sign in to comment.