Skip to content

Commit

Permalink
chore: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
spchortis committed Oct 3, 2023
1 parent 3ba173c commit b90ad15
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/cli/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ func (c icli) InitCMD() *cli.Command {
if err := c.loadFlagsFromConfig(ctx); err != nil {
return err
}

ignoredFlags := []string{namespaceFlag}

return c.checkRequiredFlags(ctx, ignoredFlags)
},
},
Expand Down
3 changes: 1 addition & 2 deletions src/cli/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,4 @@ func TestKnativeDomain(t *testing.T) {
t.Errorf("CLI should ask for an argument (knative new domain) if not detected")
}


}
}
14 changes: 7 additions & 7 deletions src/services/k8s/knative.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,18 +248,18 @@ func DomainUpd(kn_domain string, config *rest.Config) error {

configMap, err := client.CoreV1().ConfigMaps(namespace).Get(ctx, configMapName, metav1.GetOptions{})

if err != nil {
return fmt.Errorf("Getting ConfigMaps: %v", err)
}
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
}
_, 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)

Expand Down
1 change: 0 additions & 1 deletion src/services/k8s/knative_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,3 @@ func TestLoadManifest(t *testing.T) {
assert.Assert(t, annotations[UpdateTimestampAnnotationName] != "", "Missing %s annotation", UpdateTimestampAnnotationName)
assert.Assert(t, annotations[UpdateShaAnnotationName] == commitSha, "Expected %s SHA, got %s", commitSha, annotations[UpdateShaAnnotationName])
}

0 comments on commit b90ad15

Please sign in to comment.