Skip to content

Commit

Permalink
Remove out of date helm version release doc
Browse files Browse the repository at this point in the history
  • Loading branch information
BruceMacD committed Aug 10, 2021
1 parent a8344ac commit ff6dbea
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 27 deletions.
15 changes: 3 additions & 12 deletions docs/contributing.md
Expand Up @@ -67,16 +67,7 @@ make test

## Releasing a new version of Infra

### 1. Bump Helm versions

First, bump both the chart and app versions in `helm`:

* https://github.com/infrahq/infra/blob/main/helm/charts/infra/Chart.yaml
* https://github.com/infrahq/infra/blob/main/helm/charts/infra/charts/engine/Chart.yaml

Then, commit these changes and push them to the `main` branch (or create a PR).

### 2. Create a release on GitHub, marked as pre-release
### 1. Create a release on GitHub, marked as pre-release

1. Head over to https://github.com/infrahq/infra/releases and click **Draft a new Release**
2. Fill out the form with the new version as the tag and release name as shown below:
Expand All @@ -87,11 +78,11 @@ Then, commit these changes and push them to the `main` branch (or create a PR).

A new version of Infra will be prepared and released via GitHub actions.

### 3. Verify release
### 2. Verify release

Verify the [release job](https://github.com/infrahq/infra/actions/workflows/release.yml) succeeded.

### 4. Mark as released
### 3. Mark as released

1. Navigate back to https://github.com/infrahq/infra/releases and click on your release.
2. Uncheck **This is a pre-release**
Expand Down
14 changes: 7 additions & 7 deletions internal/registry/config.go
Expand Up @@ -139,14 +139,14 @@ func ApplyUserMapping(db *gorm.DB, users []ConfigUserMapping) ([]string, error)

for _, u := range users {
var user User
err := db.Where(&User{Email: u.Name}).First(&user).Error
if err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
usrReadErr := db.Where(&User{Email: u.Name}).First(&user).Error
if usrReadErr != nil {
if errors.Is(usrReadErr, gorm.ErrRecordNotFound) {
// skip this user, if they're created these roles will be added later
logging.L.Debug("skipping user in config import that has not yet been provisioned")
continue
}
return nil, err
return nil, usrReadErr
}

// add the user to groups
Expand All @@ -155,14 +155,14 @@ func ApplyUserMapping(db *gorm.DB, users []ConfigUserMapping) ([]string, error)
var group Group
grpReadErr := db.Where(&Group{Name: gName}).First(&group).Error
if grpReadErr != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
if errors.Is(grpReadErr, gorm.ErrRecordNotFound) {
logging.L.Debug("skipping unknown group \"" + gName + "\" on user")
continue
}
return nil, grpReadErr
}
if db.Model(&user).Where(&Group{Id: group.Id}).Association("Groups").Count() == 0 {
if err = db.Model(&user).Where(&Group{Id: group.Id}).Association("Groups").Append(&group); err != nil {
if err := db.Model(&user).Where(&Group{Id: group.Id}).Association("Groups").Append(&group); err != nil {
return nil, err
}
}
Expand Down Expand Up @@ -194,7 +194,7 @@ func ImportMappings(db *gorm.DB, groups []ConfigGroupMapping, users []ConfigUser
return err
}
// clean up existing groups which have been removed from the config
err = db.Where("1 = 1").Not(grpIdsToKeep).Delete(Group{}).Error
err = db.Not(grpIdsToKeep).Delete(Group{}).Error
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion internal/registry/config_test.go
Expand Up @@ -60,7 +60,7 @@ func setup() error {
func TestMain(m *testing.M) {
err := setup()
if err != nil {
fmt.Println("Could not initialize test data")
fmt.Println("Could not initialize test data: ", err)
os.Exit(1)
}
code := m.Run()
Expand Down
7 changes: 0 additions & 7 deletions internal/registry/grpc_test.go
Expand Up @@ -3,7 +3,6 @@ package registry
import (
"context"
"errors"
"fmt"
"strings"
"testing"

Expand Down Expand Up @@ -652,12 +651,6 @@ func TestListRolesForClusterReturnsRolesFromConfig(t *testing.T) {
returnedUserRoles[r.Name] = r.Users
}

for k, vs := range returnedUserRoles {
fmt.Println(k + ": ")
fmt.Println(vs)
fmt.Println()
}

// check default roles granted on user create
assert.Equal(t, 3, len(returnedUserRoles["view"]))
assert.True(t, containsUser(returnedUserRoles["view"], iosDevUser.Email))
Expand Down

0 comments on commit ff6dbea

Please sign in to comment.