@catladder/cli 1.89.3 → 1.90.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -24,7 +24,7 @@
24
24
  "node": ">=12.0.0"
25
25
  },
26
26
  "devDependencies": {
27
- "@catladder/pipeline": "1.89.3",
27
+ "@catladder/pipeline": "1.90.0",
28
28
  "@kubernetes/client-node": "^0.16.2",
29
29
  "@tsconfig/node14": "^1.0.1",
30
30
  "@types/common-tags": "^1.8.0",
@@ -57,5 +57,5 @@
57
57
  "typescript": "^4.5.4",
58
58
  "vorpal": "^1.12.0"
59
59
  },
60
- "version": "1.89.3"
60
+ "version": "1.90.0"
61
61
  }
@@ -45,12 +45,22 @@ const resolveJson = (v: Vars) =>
45
45
  })
46
46
  );
47
47
 
48
+ const getNonHiddenSecretEnvVarKeys = async (
49
+ env: string,
50
+ componentName: string
51
+ ) => {
52
+ const { secretEnvVarKeys } = await getEnvironment(env, componentName);
53
+ return secretEnvVarKeys.filter((k) => !k.hidden).map((k) => k.key);
54
+ };
48
55
  const getEnvVarsToEdit = async (
49
56
  instance: CommandInstance,
50
57
  env: string,
51
58
  componentName: string
52
59
  ) => {
53
- const { secretEnvVarKeys } = await getEnvironment(env, componentName);
60
+ const secretEnvVarKeys = await getNonHiddenSecretEnvVarKeys(
61
+ env,
62
+ componentName
63
+ );
54
64
 
55
65
  const allEnvVars = await getEnvVars(instance, env, componentName);
56
66
  return Object.fromEntries(
@@ -107,7 +117,11 @@ const doItFor = async (
107
117
  ? Object.keys(valuesToEdit[componentName][env])
108
118
  : [];
109
119
  // check whether newValues have the exact number of keys
110
- const { secretEnvVarKeys } = await getEnvironment(env, componentName);
120
+ const secretEnvVarKeys = await getNonHiddenSecretEnvVarKeys(
121
+ env,
122
+ componentName
123
+ );
124
+
111
125
  const extranous = difference(usedKeys, secretEnvVarKeys);
112
126
  const missing = difference(secretEnvVarKeys, usedKeys);
113
127
 
@@ -30,7 +30,12 @@ export const migrateSecrets = async (
30
30
  );
31
31
  await upsertAllVariables(
32
32
  vorpal,
33
- pick(secrets, environment.secretEnvVarKeys),
33
+ pick(
34
+ secrets,
35
+ environment.secretEnvVarKeys
36
+ .filter((k) => !k.hidden)
37
+ .map((k) => k.key)
38
+ ),
34
39
  newEnv,
35
40
  componentName
36
41
  );