Skip to content

Commit

Permalink
chore: Addressed review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Gettys committed Jun 2, 2022
1 parent 7d42321 commit 7a944f5
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 9 deletions.
3 changes: 0 additions & 3 deletions Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion api/v1/parameterset_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestParameterSetSpec_ToPorterDocument(t *testing.T) {
got, err := cs.ToPorterDocument()
if tt.wantErrMsg == "" {
require.NoError(t, err)
portertest.CompareGoldenFile(t, "testdata/parameter-set.yaml", string(got))
portertest.CompareGoldenFile(t, tt.wantFile, string(got))
} else {
portertests.RequireErrorContains(t, err, tt.wantErrMsg)
}
Expand Down
1 change: 0 additions & 1 deletion controllers/parameterset_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ func (r *ParameterSetReconciler) runParameterSet(ctx context.Context, log logr.L
return r.runPorter(ctx, log, ps)
}

// This could be the main "runFunction for each controller"
// Trigger an agent
func (r *ParameterSetReconciler) runPorter(ctx context.Context, log logr.Logger, ps *porterv1.ParameterSet) error {
action, err := r.createAgentAction(ctx, log, ps)
Expand Down
6 changes: 3 additions & 3 deletions controllers/parameterset_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func TestParameterSetReconiler_Reconcile(t *testing.T) {
require.NotNil(t, ps.Status.Action, "expected Action to be set")
var action porterv1.AgentAction
require.NoError(t, controller.Get(ctx, client.ObjectKey{Namespace: ps.Namespace, Name: ps.Status.Action.Name}, &action))
assert.Equal(t, "1", action.Labels[porterv1.LabelResourceGeneration], "The wrong action is set on the status")
assert.Equal(t, "1", action.Labels[porterv1.LabelResourceGeneration], "The wrong resource generation is set for the agent action")

// Mark the action as scheduled
action.Status.Phase = porterv1.PhasePending
Expand Down Expand Up @@ -97,7 +97,7 @@ func TestParameterSetReconiler_Reconcile(t *testing.T) {
// Verify the parameter set status was synced with the action
assert.NotNil(t, ps.Status.Action, "expected Action to still be set")
assert.Equal(t, porterv1.PhaseSucceeded, ps.Status.Phase, "incorrect Phase")
assert.True(t, apimeta.IsStatusConditionTrue(ps.Status.Conditions, string(string(porterv1.ConditionComplete))))
assert.True(t, apimeta.IsStatusConditionTrue(ps.Status.Conditions, string(porterv1.ConditionComplete)))

// Fail the action
action.Status.Phase = porterv1.PhaseFailed
Expand Down Expand Up @@ -153,7 +153,7 @@ func TestParameterSetReconiler_Reconcile(t *testing.T) {
// Verify that an action was created to delete it
require.NotNil(t, ps.Status.Action, "expected Action to be set")
require.NoError(t, controller.Get(ctx, client.ObjectKey{Namespace: ps.Namespace, Name: ps.Status.Action.Name}, &action))
assert.Equal(t, "3", action.Labels[porterv1.LabelResourceGeneration], "The wrong action is set on the status")
assert.Equal(t, "3", action.Labels[porterv1.LabelResourceGeneration], "The wrong resource generation is set for the agent action")

// Complete the delete action
action.Status.Phase = porterv1.PhaseSucceeded
Expand Down
11 changes: 11 additions & 0 deletions docs/content/file-formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ In addition to the normal fields available on a [Porter Installation document](/

See the glossary for more information about the [CredentialSet] resource.

The CredentialSet spec is the same schema as the CredentialSet resource in Porter.
You can copy/paste the output of the `porter credentials show NAME -o yaml` command into the CredentialSet resource spec (removing the status section).

In addition to the normal fields available on a [Porter Credential Set document](/reference/file-formats/), the following fields are supported:

```yaml
apiVersion: porter.sh/v1
kind: CredentialSet
Expand Down Expand Up @@ -66,6 +71,12 @@ spec:

See the glossary for more information about the [ParameterSet] resource.

The ParameterSet spec is the same schema as the ParameterSet resource in Porter.
You can copy/paste the output of the `porter parameters show NAME -o yaml` command into the ParameterSet resource spec (removing the status section).

In addition to the normal fields available on a [Porter Parameter Set document](/reference/file-formats/), the following fields are supported:


```yaml
apiVersion: porter.sh/v1
kind: ParameterSet
Expand Down
2 changes: 1 addition & 1 deletion installer/vanilla.porter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ install:
namespace: porter-operator-system
name: mongodb
chart: bitnami/mongodb
version: 10.27.2
version: 12.1.15
set:
auth.enabled: false
- exec:
Expand Down

0 comments on commit 7a944f5

Please sign in to comment.