-
Notifications
You must be signed in to change notification settings - Fork 2
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
chore: Simplify developer experience, no need for curl -H just browse a url #123
base: main
Are you sure you want to change the base?
Changes from all commits
e838c7a
442ecc7
ac552e7
cdd146c
db9347a
3ba173c
b90ad15
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ rules: | |
- ingresses | ||
- services | ||
- secrets | ||
- configmaps | ||
verbs: | ||
- create | ||
- delete | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -232,3 +232,36 @@ func Clean(namespace string, config *rest.Config, project *project.Project) erro | |
log.Info("The Knative service was successfully deleted", "host", config.Host, "name", project.Name, "namespace", namespace) | ||
return nil | ||
} | ||
|
||
func DomainUpd(kn_domain string, config *rest.Config) error { | ||
// Default Knative values | ||
configMapName := "config-domain" | ||
namespace := "knative-serving" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should not be hardcoding this imho, it limits the options in case someone has knative deployed in a different namespace. Let me see if we can set the right default for the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. checking if we can use namespace flag.. |
||
|
||
log.Info("Updating Knative default domain name...", "new domain", kn_domain, "configMap", configMapName, "namespace", namespace) | ||
ctx := context.Background() | ||
|
||
client, err := kubernetes.NewForConfig(config) | ||
if err != nil { | ||
return fmt.Errorf("Creating Kubernetes client %v", err) | ||
} | ||
|
||
configMap, err := client.CoreV1().ConfigMaps(namespace).Get(ctx, configMapName, metav1.GetOptions{}) | ||
|
||
if err != nil { | ||
return fmt.Errorf("Getting ConfigMaps: %v", err) | ||
} | ||
|
||
configMap.Data = make(map[string]string) | ||
|
||
configMap.Data[kn_domain] = "" | ||
|
||
_, err = client.CoreV1().ConfigMaps(namespace).Update(ctx, configMap, metav1.UpdateOptions{}) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
log.Info("Knative default domain name was successfully updated!", "new domain", kn_domain, "configMap", configMapName, "namespace", namespace) | ||
|
||
return nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make clear that a positional argument is required here?
PS. I've tried it with
test.example.com
and the config map now has both the domains, is this expected?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.